net/bonding: support matching QinQ ethertype
authorYunjian Wang <wangyunjian@huawei.com>
Tue, 7 Aug 2018 08:10:46 +0000 (16:10 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 28 Aug 2018 13:27:39 +0000 (15:27 +0200)
We assume VLAN ethtertype is 0x8100 in get_vlan_offset() function,
but it could be 0x88A8 if QinQ is supported.

Fixes: 06fe78b98ccd ("bond: add mode 6")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Chas Williams <chas3@att.com>
drivers/net/bonding/rte_eth_bond_pmd.c

index 58f7377..4417422 100644 (file)
@@ -37,7 +37,8 @@ get_vlan_offset(struct ether_hdr *eth_hdr, uint16_t *proto)
 {
        size_t vlan_offset = 0;
 
-       if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto) {
+       if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto ||
+               rte_cpu_to_be_16(ETHER_TYPE_QINQ) == *proto) {
                struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1);
 
                vlan_offset = sizeof(struct vlan_hdr);