From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4E9CA04DB; Thu, 15 Oct 2020 12:38:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9B6AF1DE45; Thu, 15 Oct 2020 12:38:00 +0200 (CEST) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by dpdk.org (Postfix) with ESMTP id 49F7A1DE44 for ; Thu, 15 Oct 2020 12:37:58 +0200 (CEST) Received: from inocybe.home (lfbn-poi-1-843-59.w86-254.abo.wanadoo.fr [86.254.165.59]) (Authenticated sender: grive@u256.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 61011200007; Thu, 15 Oct 2020 10:37:56 +0000 (UTC) From: Gaetan Rivet To: dev@dpdk.org Cc: Ivan Ilchenko , Andrew Rybchenko Date: Thu, 15 Oct 2020 12:37:50 +0200 Message-Id: <20201015103750.2368783-1-grive@u256.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <1602682146-4722-11-git-send-email-arybchenko@solarflare.com> References: <1602682146-4722-11-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] net/failsafe: check eth dev stop status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Ivan Ilchenko 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 Signed-off-by: Andrew Rybchenko --- Hello Andrew, Thanks for doing this. I had some comments, so instead I made a v2. Changes: * Use SUB_ID() instead of PORT_ID() for error reporting. The sub-device ID is the one failsafe uses to communicate with upper layers (app & user). * Run rte_eth_dev_stop() through fs_err() as well. Though your implementation of rte_eth_dev_stop() cannot return -EIO for the moment, I don't think it is precluded from happening later. Regards, drivers/net/failsafe/failsafe_ether.c | 4 +++- drivers/net/failsafe/failsafe_ops.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index f18935a7e2..7c6e28dc93 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -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: diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index 0ce7dfc8a6..5bcc250b5e 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -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; } -- 2.28.0