net/bonding: fix reset active slave
authorHari Kumar Vemula <hari.kumarx.vemula@intel.com>
Mon, 18 Feb 2019 11:59:23 +0000 (11:59 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 22 Feb 2019 13:39:49 +0000 (14:39 +0100)
commit7f949ae391527200266afa59097317ef0047111e
tree580ca7d3881f7550a0a951517e58fed4decc027c
parent90d2eb059e665738e5b775a7d0f164356acaac04
net/bonding: fix reset active slave

test_alb_reply_from_client test fails due to incorrect active slave
array's index. This was due to invalid active slave count.

Count of internals->active_slave is not updated even when active slave
is deactivated.
Hence active slave count always keeps incrementing beyond the actual
active slaves.

Fix is to set the internals->active_slave to starting index 0 whenever
it exceeds the number of slaves in active slave list and also update
the active slave count during slave de-activation.

Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness")
Cc: stable@dpdk.org
Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
drivers/net/bonding/rte_eth_bond_api.c
drivers/net/bonding/rte_eth_bond_pmd.c