From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA2ABA0A02 for ; Mon, 17 May 2021 18:11:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B38DB410E0; Mon, 17 May 2021 18:11:11 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 5137140041 for ; Mon, 17 May 2021 18:11:10 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lifpm-0007Yl-4a; Mon, 17 May 2021 16:11:10 +0000 From: Christian Ehrhardt To: Rohit Raj Cc: Hemant Agrawal , dpdk stable Date: Mon, 17 May 2021 18:07:21 +0200 Message-Id: <20210517161039.3132619-12-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> References: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/dpaa2: fix getting link status' has been queued to stable release 19.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/19/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/0a67bed904a140e88b4f9ae1330e2be1a2a31043 Thanks. Christian Ehrhardt --- >From 0a67bed904a140e88b4f9ae1330e2be1a2a31043 Mon Sep 17 00:00:00 2001 From: Rohit Raj Date: Wed, 24 Feb 2021 18:12:51 +0530 Subject: [PATCH] net/dpaa2: fix getting link status [ upstream commit eadcfd95ffde80b679b757d060f889f683c96266 ] According to DPDK Documentation, rte_eth_link_get API can wait up to 9 seconds for auto-negotiation to finish and then returns link status. In current implementation of rte_eth_link_get API in DPAA2 drivers, it was not waiting for auto negotiation to finish and was returning link status DOWN It can cause issues with DPDK applications which relies on rte_eth_link_get API for link status and does not support link status interrupt. Similar kind of issue was seen in TRex Application. This patch fixes this bug by adding wait for up to 9 seconds for auto negotiation to finish. Fixes: c56c86ff87c1 ("net/dpaa2: update link status") Signed-off-by: Rohit Raj Acked-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 5b7529690b..acdff22521 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -31,6 +31,8 @@ #define DRIVER_LOOPBACK_MODE "drv_loopback" #define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch" +#define CHECK_INTERVAL 100 /* 100ms */ +#define MAX_REPEAT_TIME 90 /* 9s (90 * 100ms) in total */ /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = @@ -1662,23 +1664,32 @@ error: /* return 0 means link status changed, -1 means not changed */ static int dpaa2_dev_link_update(struct rte_eth_dev *dev, - int wait_to_complete __rte_unused) + int wait_to_complete) { int ret; struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private; struct rte_eth_link link; struct dpni_link_state state = {0}; + uint8_t count; if (dpni == NULL) { DPAA2_PMD_ERR("dpni is NULL"); return 0; } - ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state); - if (ret < 0) { - DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret); - return -1; + for (count = 0; count <= MAX_REPEAT_TIME; count++) { + ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, + &state); + if (ret < 0) { + DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret); + return -1; + } + if (state.up == ETH_LINK_DOWN && + wait_to_complete) + rte_delay_ms(CHECK_INTERVAL); + else + break; } memset(&link, 0, sizeof(struct rte_eth_link)); -- 2.31.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-17 17:40:30.030739387 +0200 +++ 0012-net-dpaa2-fix-getting-link-status.patch 2021-05-17 17:40:29.103808941 +0200 @@ -1 +1 @@ -From eadcfd95ffde80b679b757d060f889f683c96266 Mon Sep 17 00:00:00 2001 +From 0a67bed904a140e88b4f9ae1330e2be1a2a31043 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit eadcfd95ffde80b679b757d060f889f683c96266 ] + @@ -21 +22,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index 38774e255b..a81c73438e 100644 +index 5b7529690b..acdff22521 100644 @@ -42 +43 @@ -@@ -1805,23 +1807,32 @@ error: +@@ -1662,23 +1664,32 @@ error: