From patchwork Sat Oct 3 00:01:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 79565 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A6BD1A04B5; Sat, 3 Oct 2020 02:02:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF2431C198; Sat, 3 Oct 2020 02:02:02 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id C5CF61C1EB; Sat, 3 Oct 2020 02:02:00 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1004) id F104120B4905; Fri, 2 Oct 2020 17:01:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F104120B4905 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1601683318; bh=/FJihz6tQvUdpIxRpM8Zb0xN2Uupl6EP4/rScQc/+Ss=; h=From:To:Cc:Subject:Date:From; b=GjedeONIr9p46Isk/ua81XPrHI5z3HftjEw6hyuNGVlzmKzUIotmTSg4PfsbysWxD hltHhNEAkNQsOdJciDQK05tRnTjzt4SyVykvxFJfpYZ5uytU6imFyrPmuGYuOyJE5Q SCl2gf0k2bRVq9spCAbYXzcO8w97IqfOiHP+wrSw= From: Long Li To: Gaetan Rivet Cc: dev@dpdk.org, Long Li , stable@dpdk.org Date: Fri, 2 Oct 2020 17:01:48 -0700 Message-Id: <1601683308-18738-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/failsafe: check correct error code while handling sub-device add 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: Long Li When adding a sub-device, it's possible that the sub-device is configured successfully but later fails to start. This error should not be masked. The driver needs to check the error status to prevent endless loop of trying to start the sub-device. fixes (ae80146c5a1b net/failsafe: fix removed device handling) cc: stable@dpdk.org Signed-off-by: Long Li --- drivers/net/failsafe/failsafe_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index 651578a..c58c0de 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -497,7 +497,7 @@ int failsafe_eth_new_event_callback(uint16_t port_id, fs_err(struct sub_device *sdev, int err) { /* A device removal shouldn't be reported as an error. */ - if (sdev->remove == 1 || err == -EIO) + if (sdev->remove == 1 && err == -EIO) return rte_errno = 0; return err; }