patch 'examples/qos_sched: fix Tx port config when link down' has been queued to stable release 20.11.8

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Feb 23 10:37:15 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.8

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/25/23. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/66cce69e5c34aea0db9d5e34d44206b26c261dac

Thanks.

Luca Boccassi

---
>From 66cce69e5c34aea0db9d5e34d44206b26c261dac Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Fri, 3 Feb 2023 10:05:30 +0000
Subject: [PATCH] examples/qos_sched: fix Tx port config when link down

[ upstream commit 665b49c51639a10c553433bc2bcd85c7331c631e ]

The Tx port config will fail if the port is not up,
so wait 10 seconds on startup for it to start.

Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
---
 examples/qos_sched/init.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 33e8a75526..c6310fc374 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -387,6 +387,8 @@ int app_init(void)
 	for(i = 0; i < nb_pfc; i++) {
 		uint32_t socket = rte_lcore_to_socket_id(qos_conf[i].rx_core);
 		struct rte_ring *ring;
+		struct rte_eth_link link = {0};
+		int retry_count = 100, retry_delay = 100; /* try every 100ms for 10 sec */
 
 		snprintf(ring_name, MAX_NAME_LEN, "ring-%u-%u", i, qos_conf[i].rx_core);
 		ring = rte_ring_lookup(ring_name);
@@ -417,6 +419,14 @@ int app_init(void)
 		app_init_port(qos_conf[i].rx_port, qos_conf[i].mbuf_pool);
 		app_init_port(qos_conf[i].tx_port, qos_conf[i].mbuf_pool);
 
+		rte_eth_link_get(qos_conf[i].tx_port, &link);
+		if (link.link_status == 0)
+			printf("Waiting for link on port %u\n", qos_conf[i].tx_port);
+		while (link.link_status == 0 && retry_count--) {
+			rte_delay_ms(retry_delay);
+			rte_eth_link_get(qos_conf[i].tx_port, &link);
+		}
+
 		qos_conf[i].sched_port = app_init_sched_port(qos_conf[i].tx_port, socket);
 	}
 
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:31.154440596 +0000
+++ 0071-examples-qos_sched-fix-Tx-port-config-when-link-down.patch	2023-02-23 09:36:28.354172297 +0000
@@ -1 +1 @@
-From 665b49c51639a10c553433bc2bcd85c7331c631e Mon Sep 17 00:00:00 2001
+From 66cce69e5c34aea0db9d5e34d44206b26c261dac Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 665b49c51639a10c553433bc2bcd85c7331c631e ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index d28350e14a..7a27c03b64 100644
+index 33e8a75526..c6310fc374 100644
@@ -22 +23 @@
-@@ -328,6 +328,8 @@ int app_init(void)
+@@ -387,6 +387,8 @@ int app_init(void)
@@ -31 +32 @@
-@@ -358,6 +360,14 @@ int app_init(void)
+@@ -417,6 +419,14 @@ int app_init(void)


More information about the stable mailing list