summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-ipfix.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 /ofproto/ofproto-dpif-ipfix.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 'ofproto/ofproto-dpif-ipfix.c')
-rw-r--r--ofproto/ofproto-dpif-ipfix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ofproto/ofproto-dpif-ipfix.c b/ofproto/ofproto-dpif-ipfix.c
index 23a04ce6c..3f90f21c7 100644
--- a/ofproto/ofproto-dpif-ipfix.c
+++ b/ofproto/ofproto-dpif-ipfix.c
@@ -1581,7 +1581,7 @@ ipfix_cache_entry_init(struct ipfix_flow_cache_entry *entry,
/* Choose the right template ID matching the protocols in the
* sampled packet. */
- l2 = (flow->vlan_tci == 0) ? IPFIX_PROTO_L2_ETH : IPFIX_PROTO_L2_VLAN;
+ l2 = (flow->vlans[0].tci == 0) ? IPFIX_PROTO_L2_ETH : IPFIX_PROTO_L2_VLAN;
switch(ntohs(flow->dl_type)) {
case ETH_TYPE_IP:
@@ -1659,8 +1659,8 @@ ipfix_cache_entry_init(struct ipfix_flow_cache_entry *entry,
if (l2 == IPFIX_PROTO_L2_VLAN) {
struct ipfix_data_record_flow_key_vlan *data_vlan;
- uint16_t vlan_id = vlan_tci_to_vid(flow->vlan_tci);
- uint8_t priority = vlan_tci_to_pcp(flow->vlan_tci);
+ uint16_t vlan_id = vlan_tci_to_vid(flow->vlans[0].tci);
+ uint8_t priority = vlan_tci_to_pcp(flow->vlans[0].tci);
data_vlan = dp_packet_put_zeros(&msg, sizeof *data_vlan);
data_vlan->vlan_id = htons(vlan_id);