summaryrefslogtreecommitdiff
path: root/include/openflow
diff options
context:
space:
mode:
authorJan Scheurich <jan.scheurich@ericsson.com>2017-04-25 16:29:59 +0000
committerBen Pfaff <blp@ovn.org>2017-05-03 16:56:40 -0700
commit2482b0b0c8c4ceae1f7e4620cd8620ce144e1bf3 (patch)
treedca094fdddf67d6e24e686ecaf96485e48ffcb59 /include/openflow
parentc2f4c39be4e288e7a08974aea53b18627a1ef9ef (diff)
downloadopenvswitch-2482b0b0c8c4ceae1f7e4620cd8620ce144e1bf3.tar.gz
userspace: Add packet_type in dp_packet and flow
This commit adds a packet_type attribute to the structs dp_packet and flow to explicitly carry the type of the packet as prepration for the introduction of the so-called packet type-aware pipeline (PTAP) in OVS. The packet_type is a big-endian 32 bit integer with the encoding as specified in OpenFlow verion 1.5. The upper 16 bits contain the packet type name space. Pre-defined values are defined in openflow-common.h: enum ofp_header_type_namespaces { OFPHTN_ONF = 0, /* ONF namespace. */ OFPHTN_ETHERTYPE = 1, /* ns_type is an Ethertype. */ OFPHTN_IP_PROTO = 2, /* ns_type is a IP protocol number. */ OFPHTN_UDP_TCP_PORT = 3, /* ns_type is a TCP or UDP port. */ OFPHTN_IPV4_OPTION = 4, /* ns_type is an IPv4 option number. */ }; The lower 16 bits specify the actual type in the context of the name space. Only name spaces 0 and 1 will be supported for now. For name space OFPHTN_ONF the relevant packet type is 0 (Ethernet). This is the default packet_type in OVS and the only one supported so far. Packets of type (OFPHTN_ONF, 0) are called Ethernet packets. In name space OFPHTN_ETHERTYPE the type is the Ethertype of the packet. A packet of type (OFPHTN_ETHERTYPE, <Ethertype>) is a standard L2 packet whith the Ethernet header (and any VLAN tags) removed to expose the L3 (or L2.5) payload of the packet. These will simply be called L3 packets. The Ethernet address fields dl_src and dl_dst in struct flow are not applicable for an L3 packet and must be zero. However, to maintain compatibility with the large code base, we have chosen to copy the Ethertype of an L3 packet into the the dl_type field of struct flow. This does not mean that it will be possible to match on dl_type for L3 packets with PTAP later on. Matching must be done on packet_type instead. New dp_packets are initialized with packet_type Ethernet. Ports that receive L3 packets will have to explicitly adjust the packet_type. Signed-off-by: Jean Tourrilhes <jt@labs.hpe.com> Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com> Co-authored-by: Zoltan Balogh <zoltan.balogh@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/openflow')
-rw-r--r--include/openflow/openflow-common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h
index 5936e3f09..3a0a57550 100644
--- a/include/openflow/openflow-common.h
+++ b/include/openflow/openflow-common.h
@@ -458,4 +458,13 @@ enum ofp_table_config {
OFPTC14_VACANCY_EVENTS = 1 << 3, /* Enable vacancy events. */
};
+/* Header and packet type name spaces. */
+enum ofp_header_type_namespaces {
+ OFPHTN_ONF = 0, /* ONF namespace. */
+ OFPHTN_ETHERTYPE = 1, /* ns_type is an Ethertype. */
+ OFPHTN_IP_PROTO = 2, /* ns_type is a IP protocol number. */
+ OFPHTN_UDP_TCP_PORT = 3, /* ns_type is a TCP or UDP port. */
+ OFPHTN_IPV4_OPTION = 4, /* ns_type is an IPv4 option number. */
+};
+
#endif /* openflow/openflow-common.h */