[dpdk-stable] patch 'net/dpaa: fix getting link status' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 17:59:23 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

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/12/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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/c725e11eb3b131f59dcabca5c9056831ef257473

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From c725e11eb3b131f59dcabca5c9056831ef257473 Mon Sep 17 00:00:00 2001
From: Rohit Raj <rohit.raj at nxp.com>
Date: Wed, 24 Feb 2021 18:12:52 +0530
Subject: [PATCH] net/dpaa: fix getting link status
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 89b9bb08dd7f742a7ba20d1812b4fe1b4ddf5008 ]

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 DPAA 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 statusand does not support link status
interrupt.

This patch fixes this bug by adding wait for up to 9 seconds for auto
negotiation to finish.

Fixes: 2aa10990a8dd ("bus/dpaa: enable link state interrupt")

Signed-off-by: Rohit Raj <rohit.raj at nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 0c87c136d7..79e39451b3 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -49,6 +49,9 @@
 #include <process.h>
 #include <fmlib/fm_ext.h>
 
+#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 =
 		DEV_RX_OFFLOAD_JUMBO_FRAME |
@@ -669,23 +672,30 @@ dpaa_dev_tx_burst_mode_get(struct rte_eth_dev *dev,
 }
 
 static int dpaa_eth_link_update(struct rte_eth_dev *dev,
-				int wait_to_complete __rte_unused)
+				int wait_to_complete)
 {
 	struct dpaa_if *dpaa_intf = dev->data->dev_private;
 	struct rte_eth_link *link = &dev->data->dev_link;
 	struct fman_if *fif = dev->process_private;
 	struct __fman_if *__fif = container_of(fif, struct __fman_if, __if);
 	int ret, ioctl_version;
+	uint8_t count;
 
 	PMD_INIT_FUNC_TRACE();
 
 	ioctl_version = dpaa_get_ioctl_version_number();
 
-
 	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
-		ret = dpaa_get_link_status(__fif->node_name, link);
-		if (ret)
-			return ret;
+		for (count = 0; count <= MAX_REPEAT_TIME; count++) {
+			ret = dpaa_get_link_status(__fif->node_name, link);
+			if (ret)
+				return ret;
+			if (link->link_status == ETH_LINK_DOWN &&
+			    wait_to_complete)
+				rte_delay_ms(CHECK_INTERVAL);
+			else
+				break;
+		}
 	} else {
 		link->link_status = dpaa_intf->valid;
 	}
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:27.082257900 +0800
+++ 0015-net-dpaa-fix-getting-link-status.patch	2021-05-10 23:59:26.330000000 +0800
@@ -1 +1 @@
-From 89b9bb08dd7f742a7ba20d1812b4fe1b4ddf5008 Mon Sep 17 00:00:00 2001
+From c725e11eb3b131f59dcabca5c9056831ef257473 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 89b9bb08dd7f742a7ba20d1812b4fe1b4ddf5008 ]
@@ -20 +22,0 @@
-Cc: stable at dpdk.org
@@ -29 +31 @@
-index d643514de6..c59873dd8a 100644
+index 0c87c136d7..79e39451b3 100644


More information about the stable mailing list