net/bonding: fix activated slave in 8023ad mode
authorJerry Lilijun <jerry.lilijun@huawei.com>
Mon, 20 Nov 2017 07:15:41 +0000 (07:15 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
In the function bond_mode_8023ad_enable(), the var i is used as slave
port id to the function bond_mode_8023ad_activate_slave().

This variable is only a index for array internals->active_slaves.
So its need to be fixed and change i to internals->active_slaves[i].

Fixes: 46fb43683679 ("bond: add mode 4")
Cc: stable@dpdk.org
Signed-off-by: Jerry Lilijun <jerry.lilijun@huawei.com>
Tested-by: Kyle Larose <klarose@sandvine.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
drivers/net/bonding/rte_eth_bond_8023ad.c

index a1b8dbf..c452318 100644 (file)
@@ -1144,7 +1144,8 @@ bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev)
        uint8_t i;
 
        for (i = 0; i < internals->active_slave_count; i++)
-               bond_mode_8023ad_activate_slave(bond_dev, i);
+               bond_mode_8023ad_activate_slave(bond_dev,
+                               internals->active_slaves[i]);
 
        return 0;
 }