aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/rte_eth_bond_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/rte_eth_bond_api.c')
-rw-r--r--drivers/net/bonding/rte_eth_bond_api.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 21bcd504..ac084c4f 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -19,7 +19,10 @@ int
check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev)
{
/* Check valid pointer */
- if (eth_dev->device->driver->name == NULL)
+ if (eth_dev == NULL ||
+ eth_dev->device == NULL ||
+ eth_dev->device->driver == NULL ||
+ eth_dev->device->driver->name == NULL)
return -1;
/* return 0 if driver name matches */
@@ -126,6 +129,12 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id)
RTE_ASSERT(active_count < RTE_DIM(internals->active_slaves));
internals->active_slave_count = active_count;
+ /* Resetting active_slave when reaches to max
+ * no of slaves in active list
+ */
+ if (internals->active_slave >= active_count)
+ internals->active_slave = 0;
+
if (eth_dev->data->dev_started) {
if (internals->mode == BONDING_MODE_8023AD) {
bond_mode_8023ad_start(eth_dev);