summaryrefslogtreecommitdiff
path: root/utilities
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 /utilities
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 'utilities')
-rw-r--r--utilities/ovs-ofctl.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index e8dcbd680..f154c5202 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -4141,8 +4141,8 @@ ofctl_check_vlan(struct ovs_cmdl_context *ctx)
enum ofputil_protocol usable_protocols; /* Unused for now. */
match_init_catchall(&match);
- match.flow.vlan_tci = htons(strtoul(ctx->argv[1], NULL, 16));
- match.wc.masks.vlan_tci = htons(strtoul(ctx->argv[2], NULL, 16));
+ match.flow.vlans[0].tci = htons(strtoul(ctx->argv[1], NULL, 16));
+ match.wc.masks.vlans[0].tci = htons(strtoul(ctx->argv[2], NULL, 16));
/* Convert to and from string. */
string_s = match_to_string(&match, OFP_DEFAULT_PRIORITY);
@@ -4153,8 +4153,8 @@ ofctl_check_vlan(struct ovs_cmdl_context *ctx)
ovs_fatal(0, "%s", error_s);
}
printf("%04"PRIx16"/%04"PRIx16"\n",
- ntohs(fm.match.flow.vlan_tci),
- ntohs(fm.match.wc.masks.vlan_tci));
+ ntohs(fm.match.flow.vlans[0].tci),
+ ntohs(fm.match.wc.masks.vlans[0].tci));
free(string_s);
/* Convert to and from NXM. */
@@ -4168,8 +4168,8 @@ ofctl_check_vlan(struct ovs_cmdl_context *ctx)
printf("%s\n", ofperr_to_string(error));
} else {
printf("%04"PRIx16"/%04"PRIx16"\n",
- ntohs(nxm_match.flow.vlan_tci),
- ntohs(nxm_match.wc.masks.vlan_tci));
+ ntohs(nxm_match.flow.vlans[0].tci),
+ ntohs(nxm_match.wc.masks.vlans[0].tci));
}
free(nxm_s);
ofpbuf_uninit(&nxm);
@@ -4183,14 +4183,15 @@ ofctl_check_vlan(struct ovs_cmdl_context *ctx)
if (error) {
printf("%s\n", ofperr_to_string(error));
} else {
- uint16_t vid = ntohs(nxm_match.flow.vlan_tci) &
+ uint16_t vid = ntohs(nxm_match.flow.vlans[0].tci) &
(VLAN_VID_MASK | VLAN_CFI);
- uint16_t mask = ntohs(nxm_match.wc.masks.vlan_tci) &
+ uint16_t mask = ntohs(nxm_match.wc.masks.vlans[0].tci) &
(VLAN_VID_MASK | VLAN_CFI);
printf("%04"PRIx16"/%04"PRIx16",", vid, mask);
- if (vid && vlan_tci_to_pcp(nxm_match.wc.masks.vlan_tci)) {
- printf("%02"PRIx8"\n", vlan_tci_to_pcp(nxm_match.flow.vlan_tci));
+ if (vid && vlan_tci_to_pcp(nxm_match.wc.masks.vlans[0].tci)) {
+ printf("%02"PRIx8"\n",
+ vlan_tci_to_pcp(nxm_match.flow.vlans[0].tci));
} else {
printf("--\n");
}
@@ -4206,8 +4207,8 @@ ofctl_check_vlan(struct ovs_cmdl_context *ctx)
(of10_raw.wildcards & htonl(OFPFW10_DL_VLAN)) != 0,
of10_raw.dl_vlan_pcp,
(of10_raw.wildcards & htonl(OFPFW10_DL_VLAN_PCP)) != 0,
- ntohs(of10_match.flow.vlan_tci),
- ntohs(of10_match.wc.masks.vlan_tci));
+ ntohs(of10_match.flow.vlans[0].tci),
+ ntohs(of10_match.wc.masks.vlans[0].tci));
/* Convert to and from OpenFlow 1.1. */
ofputil_match_to_ofp11_match(&match, &of11_raw);
@@ -4217,8 +4218,8 @@ ofctl_check_vlan(struct ovs_cmdl_context *ctx)
(of11_raw.wildcards & htonl(OFPFW11_DL_VLAN)) != 0,
of11_raw.dl_vlan_pcp,
(of11_raw.wildcards & htonl(OFPFW11_DL_VLAN_PCP)) != 0,
- ntohs(of11_match.flow.vlan_tci),
- ntohs(of11_match.wc.masks.vlan_tci));
+ ntohs(of11_match.flow.vlans[0].tci),
+ ntohs(of11_match.wc.masks.vlans[0].tci));
}
/* "print-error ENUM": Prints the type and code of ENUM for every OpenFlow