summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Scheurich <jan.scheurich@ericsson.com>2017-06-23 16:47:57 +0000
committerBen Pfaff <blp@ovn.org>2017-06-27 17:28:30 -0400
commit3d4b2e6eb74ed5bb5b35373aa8a489536938fee6 (patch)
treef086a8ec9d205140a69fd39db0c4c8be67ab855c /include
parentbe7ac2f3c105866542de5c1d4c7e2651250a3e92 (diff)
downloadopenvswitch-3d4b2e6eb74ed5bb5b35373aa8a489536938fee6.tar.gz
userspace: Add OXM field MFF_PACKET_TYPE
Allow packet type namespace OFPHTN_ETHERTYPE as alternative pre-requisite for matching L3 protocols (MPLS, IP, IPv6, ARP etc). Change the meta-flow definition of packet_type field to use the new custom format MFS_PACKET_TYPE representing "(NS,NS_TYPE)". Parsing routine for MFS_PACKET_TYPE added to meta-flow.c. Formatting routine for field packet_type extracted from match_format() and moved to flow.c to be used from meta-flow.c for formatting MFS_PACKET_TYPE. Updated the ovs-fields man page source meta-flow.xml with documentation for packet-type-aware bridges and added documentation for field packet_type. Added packet_type to the matching properties in tests/ofproto.at. If dl_type is unwildcarded due to later packet modification, make sure it is cleared again if the original packet_type was not PT_ETH. Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include')
-rw-r--r--include/openvswitch/match.h5
-rw-r--r--include/openvswitch/meta-flow.h20
2 files changed, 25 insertions, 0 deletions
diff --git a/include/openvswitch/match.h b/include/openvswitch/match.h
index 70da928fe..aca725265 100644
--- a/include/openvswitch/match.h
+++ b/include/openvswitch/match.h
@@ -23,6 +23,7 @@
struct ds;
struct ofputil_port_map;
+struct mf_field;
/* A flow classification match.
*
@@ -119,6 +120,10 @@ void match_set_ct_ipv6_dst_masked(struct match *, const struct in6_addr *,
const struct in6_addr *);
void match_set_packet_type(struct match *, ovs_be32 packet_type);
+void match_set_default_packet_type(struct match *);
+bool match_has_default_packet_type(const struct match *);
+void match_add_ethernet_prereq(struct match *, const struct mf_field *);
+
void match_set_skb_priority(struct match *, uint32_t skb_priority);
void match_set_dl_type(struct match *, ovs_be16);
void match_set_dl_src(struct match *, const struct eth_addr );
diff --git a/include/openvswitch/meta-flow.h b/include/openvswitch/meta-flow.h
index cbfd3ba65..fc109501d 100644
--- a/include/openvswitch/meta-flow.h
+++ b/include/openvswitch/meta-flow.h
@@ -133,6 +133,11 @@ struct ofputil_tlv_table_mod;
*
* TCP flags: See the description of tcp_flags in ovs-ofctl(8).
*
+ * packet type: A pair of packet type namespace NS and NS_TYPE within
+ * that namespace "(NS,NS_TYPE)". NS and NS_TYPE are formatted in
+ * decimal or hexadecimal as and accept decimal and hexadecimal (with
+ * 0x prefix) at parsing.
+ *
* Prerequisites:
*
* The field's prerequisites. The values should be straightfoward.
@@ -248,6 +253,20 @@ enum OVS_PACKED_ENUM mf_field_id {
*/
MFF_RECIRC_ID,
+ /* "packet_type".
+ *
+ * Define the packet type in OpenFlow 1.5+.
+ *
+ * Type: be32.
+ * Maskable: no.
+ * Formatting: packet type.
+ * Prerequisites: none.
+ * Access: read-only.
+ * NXM: none.
+ * OXM: OXM_OF_PACKET_TYPE(44) since OF1.5 and v2.8.
+ */
+ MFF_PACKET_TYPE,
+
/* "conj_id".
*
* ID for "conjunction" actions. Please refer to ovs-ofctl(8)
@@ -1860,6 +1879,7 @@ enum OVS_PACKED_ENUM mf_string {
MFS_FRAG, /* no, yes, first, later, not_later */
MFS_TNL_FLAGS, /* FLOW_TNL_F_* flags */
MFS_TCP_FLAGS, /* TCP_* flags */
+ MFS_PACKET_TYPE, /* "(NS,NS_TYPE)" */
};
struct mf_field {