net/failsafe: check stop call status
authorIvan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Thu, 15 Oct 2020 13:30:44 +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/failsafe
according to new return type.

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

index c6066c7..10b90fd 100644 (file)
@@ -282,7 +282,9 @@ fs_dev_remove(struct sub_device *sdev)
        switch (sdev->state) {
        case DEV_STARTED:
                failsafe_rx_intr_uninstall_subdevice(sdev);
-               rte_eth_dev_stop(PORT_ID(sdev));
+               ret = rte_eth_dev_stop(PORT_ID(sdev));
+               if (ret < 0)
+                       ERROR("Failed to stop sub-device %u", SUB_ID(sdev));
                sdev->state = DEV_ACTIVE;
                /* fallthrough */
        case DEV_ACTIVE:
index 5c606ff..632f2b2 100644 (file)
@@ -147,7 +147,9 @@ fs_dev_start(struct rte_eth_dev *dev)
                if (ret) {
                        if (!fs_err(sdev, ret))
                                continue;
-                       rte_eth_dev_stop(PORT_ID(sdev));
+                       if (fs_err(sdev, rte_eth_dev_stop(PORT_ID(sdev))) < 0)
+                               ERROR("Failed to stop sub-device %u",
+                                     SUB_ID(sdev));
                        fs_unlock(dev, 0);
                        return ret;
                }