From: Chas Williams Date: Tue, 3 Apr 2018 16:01:22 +0000 (-0400) Subject: net/bonding: fix setting VLAN ID on slave ports X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3639903f488976e61752103bed546d5b87147ad0;p=dpdk.git net/bonding: fix setting VLAN ID on slave ports The pos returned is just the offset of the slab. You need to use this to offset the bits in the slab. Fixes: c771e4ef38 ("net/bonding: enable slave VLAN filter") Cc: stable@dpdk.org Signed-off-by: Chas Williams Acked-by: Radu Nicolau --- diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index f854b73755..d5b7260e4c 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -211,9 +211,12 @@ slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) for (i = 0, mask = 1; i < RTE_BITMAP_SLAB_BIT_SIZE; i ++, mask <<= 1) { - if (unlikely(slab & mask)) + if (unlikely(slab & mask)) { + uint16_t vlan_id = pos + i; + res = rte_eth_dev_vlan_filter(slave_port_id, - (uint16_t)pos, 1); + vlan_id, 1); + } } found = rte_bitmap_scan(internals->vlan_filter_bmp, &pos, &slab);