net/bonding: check stop call status
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Thu, 15 Oct 2020 13:30:39 +0000 (14:30 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 20:26:41 +0000 (22:26 +0200)
rte_eth_dev_stop() return value was changed from void to int,
so this patch modify usage of this function across net/bonding
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/bonding/rte_eth_bond_api.c
drivers/net/bonding/rte_eth_bond_pmd.c

index a4007fe..55c8e31 100644 (file)
@@ -237,7 +237,12 @@ slave_rte_flow_prepare(uint16_t slave_id, struct bond_dev_private *internals)
        uint16_t slave_port_id = internals->slaves[slave_id].port_id;
 
        if (internals->flow_isolated_valid != 0) {
-               rte_eth_dev_stop(slave_port_id);
+               if (rte_eth_dev_stop(slave_port_id) != 0) {
+                       RTE_BOND_LOG(ERR, "Failed to stop device on port %u",
+                                    slave_port_id);
+                       return -1;
+               }
+
                if (rte_flow_isolate(slave_port_id, internals->flow_isolated,
                    &ferror)) {
                        RTE_BOND_LOG(ERR, "rte_flow_isolate failed for slave"
index 99910e9..57327de 100644 (file)
@@ -1694,7 +1694,10 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
        struct bond_dev_private *internals = bonded_eth_dev->data->dev_private;
 
        /* Stop slave */
-       rte_eth_dev_stop(slave_eth_dev->data->port_id);
+       errval = rte_eth_dev_stop(slave_eth_dev->data->port_id);
+       if (errval != 0)
+               RTE_BOND_LOG(ERR, "rte_eth_dev_stop: port %u, err (%d)",
+                            slave_eth_dev->data->port_id, errval);
 
        /* Enable interrupts on slave device if supported */
        if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
@@ -2110,7 +2113,11 @@ bond_ethdev_close(struct rte_eth_dev *dev)
        while (internals->slave_count != skipped) {
                uint16_t port_id = internals->slaves[skipped].port_id;
 
-               rte_eth_dev_stop(port_id);
+               if (rte_eth_dev_stop(port_id) != 0) {
+                       RTE_BOND_LOG(ERR, "Failed to stop device on port %u",
+                                    port_id);
+                       skipped++;
+               }
 
                if (rte_eth_bond_slave_remove(bond_port_id, port_id) != 0) {
                        RTE_BOND_LOG(ERR,