From: Ivan Ilchenko Date: Thu, 15 Oct 2020 13:30:39 +0000 (+0100) Subject: net/bonding: check stop call status X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fb0379bc5db3733127312e79db318192d3052715;p=dpdk.git net/bonding: check stop call status 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 Signed-off-by: Andrew Rybchenko --- diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index a4007fe07c..55c8e3167c 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -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" diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 99910e9488..57327de770 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -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,