DPDK patches and discussions
 help / color / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Chas Williams <chas3@att.com>, "Min Hu (Connor)" <humin29@huawei.com>
Cc: <dev@dpdk.org>, Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH 05/11] net/bonding: check eth dev stop status
Date: Wed, 14 Oct 2020 14:29:00 +0100
Message-ID: <1602682146-4722-6-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1602682146-4722-1-git-send-email-arybchenko@solarflare.com>

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

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 |  7 ++++++-
 drivers/net/bonding/rte_eth_bond_pmd.c | 13 +++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)

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 1c404b2edd..6cb03d40d7 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1694,7 +1694,12 @@ 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);
+		return errval;
+	}
 
 	/* Enable interrupts on slave device if supported */
 	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
@@ -2110,7 +2115,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,
-- 
2.17.1


  parent reply index

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 13:28 [dpdk-dev] [PATCH 00/11] ethdev: change device stop to return status Andrew Rybchenko
2020-10-14 13:28 ` [dpdk-dev] [PATCH 01/11] ethdev: change eth dev stop function to return int Andrew Rybchenko
2020-10-14 13:33   ` Thomas Monjalon
2020-10-14 13:40     ` Andrew Rybchenko
2020-10-14 17:29   ` Ferruh Yigit
2020-10-14 13:28 ` [dpdk-dev] [PATCH 02/11] test/event: check eth dev stop status Andrew Rybchenko
2020-10-14 13:28 ` [dpdk-dev] [PATCH 03/11] app: " Andrew Rybchenko
2020-10-14 17:34   ` Ferruh Yigit
2020-10-14 13:28 ` [dpdk-dev] [PATCH 04/11] examples: " Andrew Rybchenko
2020-10-14 17:38   ` Ferruh Yigit
2020-10-14 13:29 ` Andrew Rybchenko [this message]
2020-10-14 17:45   ` [dpdk-dev] [PATCH 05/11] net/bonding: " Ferruh Yigit
2020-10-14 13:29 ` [dpdk-dev] [PATCH 06/11] kni: " Andrew Rybchenko
2020-10-14 13:29 ` [dpdk-dev] [PATCH 07/11] test/bonding: " Andrew Rybchenko
2020-10-14 13:29 ` [dpdk-dev] [PATCH 08/11] app/flow-perf: " Andrew Rybchenko
2020-10-15  8:04   ` Wisam Monther
2020-10-14 13:29 ` [dpdk-dev] [PATCH 09/11] app/testpmd: " Andrew Rybchenko
2020-10-14 13:29 ` [dpdk-dev] [PATCH 10/11] net/failsafe: " Andrew Rybchenko
2020-10-15 10:37   ` [dpdk-dev] [PATCH v2] " Gaetan Rivet
2020-10-14 13:29 ` [dpdk-dev] [PATCH 11/11] ethdev: change stop device callback to return int Andrew Rybchenko
2020-10-14 18:08   ` Ferruh Yigit
2020-10-15 10:40     ` Gaëtan Rivet
2020-10-15 13:30 ` [dpdk-dev] [PATCH v2 00/11] ethdev: change device stop to return status Andrew Rybchenko
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 01/11] ethdev: change eth dev stop function to return int Andrew Rybchenko
2020-10-16  9:22     ` Ferruh Yigit
2020-10-16 11:20     ` Kinsella, Ray
2020-10-16 17:13       ` Andrew Rybchenko
2020-10-19  9:37         ` Kinsella, Ray
2020-10-16 16:20     ` Ferruh Yigit
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 02/11] test/event: check eth dev stop status Andrew Rybchenko
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 03/11] app: " Andrew Rybchenko
2020-10-16  1:28     ` Min Hu (Connor)
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 04/11] examples: " Andrew Rybchenko
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 05/11] net/bonding: " Andrew Rybchenko
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 06/11] kni: " Andrew Rybchenko
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 07/11] test/bonding: " Andrew Rybchenko
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 08/11] app/flow-perf: " Andrew Rybchenko
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 09/11] app/testpmd: " Andrew Rybchenko
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 10/11] net/failsafe: " Andrew Rybchenko
2020-10-15 13:30   ` [dpdk-dev] [PATCH v2 11/11] ethdev: change stop device callback to return int Andrew Rybchenko
2020-10-16 18:37     ` Ferruh Yigit
2020-10-18  8:55     ` Xu, Rosen
2020-10-16 18:54   ` [dpdk-dev] [PATCH v2 00/11] ethdev: change device stop to return status Ferruh Yigit

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1602682146-4722-6-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=Ivan.Ilchenko@oktetlabs.ru \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=humin29@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox