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

Stephen Hemminger stephen at networkplumber.org
Sun Aug 11 18:17:19 CEST 2024


On Sun, 11 Aug 2024 21:29:57 +0530
Rakesh Kudurumalla <rkudurumalla at marvell.com> wrote:

> Race condition between jobstats and time metrics
> for forwarding and flushing is maintained using spinlock.
> Timer metrics are not displayed properly due to the
> frequent unavailability of the lock.This patch fixes
> the issue by introducing a delay before acquiring
> the lock in the loop. This delay allows for betteravailability
> of the lock, ensuring that show_lcore_stats() can
> periodically update the statistics even when forwarding
> jobs are running.
> 
> Fixes: 204896f8d66c ("examples/l2fwd-jobstats: add new example")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla at marvell.com>

Would be better if this code used RCU and not a lock


More information about the stable mailing list