diff options
author | Jan Scheurich <jan.scheurich@ericsson.com> | 2017-06-23 16:47:57 +0000 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-06-27 17:28:30 -0400 |
commit | 3d4b2e6eb74ed5bb5b35373aa8a489536938fee6 (patch) | |
tree | f086a8ec9d205140a69fd39db0c4c8be67ab855c /ofproto | |
parent | be7ac2f3c105866542de5c1d4c7e2651250a3e92 (diff) | |
download | openvswitch-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 'ofproto')
-rw-r--r-- | ofproto/ofproto-dpif-xlate.c | 6 | ||||
-rw-r--r-- | ofproto/tunnel.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 48c4bad4a..0fe6584b7 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -6125,8 +6125,11 @@ xlate_wc_init(struct xlate_ctx *ctx) flow_wildcards_init_catchall(ctx->wc); /* Some fields we consider to always be examined. */ + WC_MASK_FIELD(ctx->wc, packet_type); WC_MASK_FIELD(ctx->wc, in_port); - WC_MASK_FIELD(ctx->wc, dl_type); + if (is_ethernet(&ctx->xin->flow, NULL)) { + WC_MASK_FIELD(ctx->wc, dl_type); + } if (is_ip_any(&ctx->xin->flow)) { WC_MASK_FIELD_MASK(ctx->wc, nw_frag, FLOW_NW_FRAG_MASK); } @@ -6158,6 +6161,7 @@ xlate_wc_finish(struct xlate_ctx *ctx) if (ctx->xin->upcall_flow->packet_type != htonl(PT_ETH)) { ctx->wc->masks.dl_dst = eth_addr_zero; ctx->wc->masks.dl_src = eth_addr_zero; + ctx->wc->masks.dl_type = 0; } /* ICMPv4 and ICMPv6 have 8-bit "type" and "code" fields. struct flow diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index e27a9fb75..fa99b3102 100644 --- a/ofproto/tunnel.c +++ b/ofproto/tunnel.c @@ -386,8 +386,6 @@ tnl_wc_init(struct flow *flow, struct flow_wildcards *wc) && IP_ECN_is_ce(flow->tunnel.ip_tos)) { wc->masks.nw_tos |= IP_ECN_MASK; } - /* Match on packet_type for tunneled packets.*/ - wc->masks.packet_type = OVS_BE32_MAX; } } |