net/bonding: stop and deactivate slaves on stop
authorRadu Nicolau <radu.nicolau@intel.com>
Wed, 1 Aug 2018 13:18:43 +0000 (14:18 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 28 Sep 2018 11:59:05 +0000 (13:59 +0200)
When a bonding port is stopped also stop and deactivate all slaves.
Otherwise slaves will be still listed as active.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
drivers/net/bonding/rte_eth_bond_pmd.c

index 4df0e84..1d6245a 100644 (file)
@@ -2174,12 +2174,15 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
                        tlb_last_obytets[internals->active_slaves[i]] = 0;
        }
 
-       internals->link_status_polling_enabled = 0;
-       for (i = 0; i < internals->slave_count; i++)
-               internals->slaves[i].last_link_status = 0;
-
        eth_dev->data->dev_link.link_status = ETH_LINK_DOWN;
        eth_dev->data->dev_started = 0;
+
+       internals->link_status_polling_enabled = 0;
+       for (i = 0; i < internals->slave_count; i++) {
+               internals->slaves[i].last_link_status = 0;
+               rte_eth_dev_stop(internals->slaves[i].port_id);
+               deactivate_slave(eth_dev, internals->slaves[i].port_id);
+       }
 }
 
 void