patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/4] examples/qos_sched: fix errors when TX port not up
       [not found] <20230203100533.10377-1-bruce.richardson@intel.com>
@ 2023-02-03 10:05 ` Bruce Richardson
  2023-02-17 16:19   ` Dumitrescu, Cristian
  0 siblings, 1 reply; 2+ messages in thread
From: Bruce Richardson @ 2023-02-03 10:05 UTC (permalink / raw)
  To: dev; +Cc: jasvinder.singh, Bruce Richardson, stable, Cristian Dumitrescu

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")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@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 0709aec10c..6020367705 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -326,6 +326,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);
@@ -356,6 +358,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.37.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH 1/4] examples/qos_sched: fix errors when TX port not up
  2023-02-03 10:05 ` [PATCH 1/4] examples/qos_sched: fix errors when TX port not up Bruce Richardson
@ 2023-02-17 16:19   ` Dumitrescu, Cristian
  0 siblings, 0 replies; 2+ messages in thread
From: Dumitrescu, Cristian @ 2023-02-17 16:19 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Singh, Jasvinder, stable



> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: Friday, February 3, 2023 10:06 AM
> To: dev@dpdk.org
> Cc: Singh, Jasvinder <jasvinder.singh@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; stable@dpdk.org; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>
> Subject: [PATCH 1/4] examples/qos_sched: fix errors when TX port not up
> 
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  examples/qos_sched/init.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-17 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230203100533.10377-1-bruce.richardson@intel.com>
2023-02-03 10:05 ` [PATCH 1/4] examples/qos_sched: fix errors when TX port not up Bruce Richardson
2023-02-17 16:19   ` Dumitrescu, Cristian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).