[PATCH v3 1/1] examples/l2fwd-jobstats: fix lock availability

Thomas Monjalon thomas at monjalon.net
Tue Jul 30 18:12:20 CEST 2024


Hello,

30/07/2024 12:03, Rakesh Kudurumalla:
> This patch addresses the issue by introducing a delay

Please start with describing the issue.

> before acquiring the lock in the loop. This delay allows for better
> availability of the lock, ensuring that show_lcore_stats() can
> periodically update the statistics even when forwarding jobs are running.

Why a delay is better than a pause?

> @@ -542,7 +542,7 @@ l2fwd_main_loop(void)
>  		} while (likely(stats_read_pending == 0));
>  
>  		rte_spinlock_unlock(&qconf->lock);
> -		rte_pause();
> +		rte_delay_us(10);
>  	}





More information about the dev mailing list