From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D485C4363C for ; Sat, 3 Oct 2020 00:02:06 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 826C4206DB for ; Sat, 3 Oct 2020 00:02:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linuxonhyperv.com header.i=@linuxonhyperv.com header.b="GjedeONI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 826C4206DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxonhyperv.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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; } -- 1.8.3.1