summaryrefslogtreecommitdiff
path: root/lib/nx-match.c
diff options
context:
space:
mode:
authorEric Garver <e@erig.me>2017-03-01 17:47:59 -0500
committerBen Pfaff <blp@ovn.org>2017-03-16 15:18:40 -0700
commitf0fb825a3785320430686834741c718ff4f8ebf4 (patch)
treee58d08de18a42bd74edbed5a9c0d8951d03e7d81 /lib/nx-match.c
parent4c71600d2256641b927e04b75e95751355e799f8 (diff)
downloadopenvswitch-f0fb825a3785320430686834741c718ff4f8ebf4.tar.gz
Add support for 802.1ad (QinQ tunneling)
Flow key handling changes: - Add VLAN header array in struct flow, to record multiple 802.1q VLAN headers. - Add dpif multi-VLAN capability probing. If datapath supports multi-VLAN, increase the maximum depth of nested OVS_KEY_ATTR_ENCAP. Refactor VLAN handling in dpif-xlate: - Introduce 'xvlan' to track VLAN stack during flow processing. - Input and output VLAN translation according to the xbundle type. Push VLAN action support: - Allow ethertype 0x88a8 in VLAN headers and push_vlan action. - Support push_vlan on dot1q packets. Use other_config:vlan-limit in table Open_vSwitch to limit maximum VLANs that can be matched. This allows us to preserve backwards compatibility. Add test cases for VLAN depth limit, Multi-VLAN actions and QinQ VLAN handling Co-authored-by: Thomas F Herbert <thomasfherbert@gmail.com> Signed-off-by: Thomas F Herbert <thomasfherbert@gmail.com> Co-authored-by: Xiao Liang <shaw.leon@gmail.com> Signed-off-by: Xiao Liang <shaw.leon@gmail.com> Signed-off-by: Eric Garver <e@erig.me> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/nx-match.c')
-rw-r--r--lib/nx-match.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/nx-match.c b/lib/nx-match.c
index 888591990..8fcae977c 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -986,7 +986,7 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
int match_len;
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 37);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 38);
/* Metadata. */
if (match->wc.masks.dp_hash) {
@@ -1029,8 +1029,8 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
/* 802.1Q. */
if (oxm) {
ovs_be16 VID_CFI_MASK = htons(VLAN_VID_MASK | VLAN_CFI);
- ovs_be16 vid = flow->vlan_tci & VID_CFI_MASK;
- ovs_be16 mask = match->wc.masks.vlan_tci & VID_CFI_MASK;
+ ovs_be16 vid = flow->vlans[0].tci & VID_CFI_MASK;
+ ovs_be16 mask = match->wc.masks.vlans[0].tci & VID_CFI_MASK;
if (mask == htons(VLAN_VID_MASK | VLAN_CFI)) {
nxm_put_16(b, MFF_VLAN_VID, oxm, vid);
@@ -1038,14 +1038,14 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
nxm_put_16m(b, MFF_VLAN_VID, oxm, vid, mask);
}
- if (vid && vlan_tci_to_pcp(match->wc.masks.vlan_tci)) {
+ if (vid && vlan_tci_to_pcp(match->wc.masks.vlans[0].tci)) {
nxm_put_8(b, MFF_VLAN_PCP, oxm,
- vlan_tci_to_pcp(flow->vlan_tci));
+ vlan_tci_to_pcp(flow->vlans[0].tci));
}
} else {
- nxm_put_16m(b, MFF_VLAN_TCI, oxm, flow->vlan_tci,
- match->wc.masks.vlan_tci);
+ nxm_put_16m(b, MFF_VLAN_TCI, oxm, flow->vlans[0].tci,
+ match->wc.masks.vlans[0].tci);
}
/* MPLS. */