[dpdk-stable] patch 'examples/ioat: fix invalid link status check' has been queued to stable release 19.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Feb 17 18:44:57 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/19/20. 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.

Thanks.

Luca Boccassi

---
>From 87eb3209962373df52201e3805f68c5a886b57f4 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power at intel.com>
Date: Fri, 7 Feb 2020 10:24:02 +0000
Subject: [PATCH] examples/ioat: fix invalid link status check

[ upstream commit 2582bb980d287b05f378e5a4a467f217a5d63926 ]

The return value of the get link function call was not checked, and
could return a negative value indicating a failure. This meant the
link_status of the link being checked is invalid, because the link was
not filled with data. The return value is now checked, and if the return
value is not 0 for success, the loop continues with the next port.

To avoid confusion between variable names, the existing retval variable
is renamed to link_status, to better represent its use.

Coverity issue: 350348
Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver")

Signed-off-by: Ciara Power <ciara.power at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 examples/ioat/ioatfwd.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index 8a6076828d..7255ff3c9e 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -697,7 +697,7 @@ check_link_status(uint32_t port_mask)
 {
 	uint16_t portid;
 	struct rte_eth_link link;
-	int retval = 0;
+	int ret, link_status = 0;
 
 	printf("\nChecking link status\n");
 	RTE_ETH_FOREACH_DEV(portid) {
@@ -705,7 +705,12 @@ check_link_status(uint32_t port_mask)
 			continue;
 
 		memset(&link, 0, sizeof(link));
-		rte_eth_link_get(portid, &link);
+		ret = rte_eth_link_get(portid, &link);
+		if (ret < 0) {
+			printf("Port %u link get failed: err=%d\n",
+					portid, ret);
+			continue;
+		}
 
 		/* Print link status */
 		if (link.link_status) {
@@ -714,11 +719,11 @@ check_link_status(uint32_t port_mask)
 				portid, link.link_speed,
 				(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
 				("full-duplex") : ("half-duplex\n"));
-			retval = 1;
+			link_status = 1;
 		} else
 			printf("Port %d Link Down\n", portid);
 	}
-	return retval;
+	return link_status;
 }
 
 static void
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-17 17:00:15.503431407 +0000
+++ 0005-examples-ioat-fix-invalid-link-status-check.patch	2020-02-17 17:00:15.267949888 +0000
@@ -1,8 +1,10 @@
-From 2582bb980d287b05f378e5a4a467f217a5d63926 Mon Sep 17 00:00:00 2001
+From 87eb3209962373df52201e3805f68c5a886b57f4 Mon Sep 17 00:00:00 2001
 From: Ciara Power <ciara.power at intel.com>
 Date: Fri, 7 Feb 2020 10:24:02 +0000
 Subject: [PATCH] examples/ioat: fix invalid link status check
 
+[ upstream commit 2582bb980d287b05f378e5a4a467f217a5d63926 ]
+
 The return value of the get link function call was not checked, and
 could return a negative value indicating a failure. This meant the
 link_status of the link being checked is invalid, because the link was
@@ -14,7 +16,6 @@
 
 Coverity issue: 350348
 Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver")
-Cc: stable at dpdk.org
 
 Signed-off-by: Ciara Power <ciara.power at intel.com>
 Acked-by: Bruce Richardson <bruce.richardson at intel.com>


More information about the stable mailing list