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 58971A0471 for ; Thu, 18 Jul 2019 05:36:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 946201B95C; Thu, 18 Jul 2019 05:36:36 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 869945B3C; Thu, 18 Jul 2019 05:36:32 +0200 (CEST) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 2993F30C390; Wed, 17 Jul 2019 20:36:30 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 2993F30C390 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1563420990; bh=Pk9z0RVApwJOVNu61khE2BYRu3zb0qIMEFygVTk35/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r2dspvUt8BxXXTZPB4NhR9VFGbeRhPLtgGZZuQIVBuvl9NbssktOm9NNQLZ2pvbHW 40rDkuJFPybaEuMSB1mYxgjk6KomLjM2Oz6SEtP+qj43DnCjaNTrZQWZOAyjycjmVT CVZnpReVC0Ba2A1Jrh5yPq1tH+bZzg7bvixRgNpA= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.122.43.105]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id 6074DAC0761; Wed, 17 Jul 2019 20:36:29 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP , stable@dpdk.org, Lance Richardson Date: Thu, 18 Jul 2019 09:05:58 +0530 Message-Id: <20190718033616.37605-5-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190718033616.37605-1-ajit.khaparde@broadcom.com> References: <20190718033616.37605-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 04/22] net/bnxt: fix an unconditional wait in link update 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: Kalesh AP There is an unconditional delay in link update op. Fixed it to wait only if wait for request completion is set. Fixes: 7bc8e9a227ccbc64 ("net/bnxt: support async link notification") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Lance Richardson --- drivers/net/bnxt/bnxt_ethdev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 0c77a8c08..7e0fca31e 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -973,11 +973,12 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete) "Failed to retrieve link rc = 0x%x!\n", rc); goto out; } - rte_delay_ms(BNXT_LINK_WAIT_INTERVAL); - if (!wait_to_complete) + if (!wait_to_complete || new.link_status) break; - } while (!new.link_status && cnt--); + + rte_delay_ms(BNXT_LINK_WAIT_INTERVAL); + } while (cnt--); out: /* Timed out or success */ -- 2.20.1 (Apple Git-117)