[EXTERNAL] Re: [PATCH v6 1/1] examples/l2fwd-jobstats: fix timer stats display with lock contention
Thomas Monjalon
thomas at monjalon.net
Tue Mar 17 17:40:02 CET 2026
16/03/2026 14:36, Rakesh Kudurumalla:
> Hi @Stephen Hemminger,
>
> Yes, you're correct that the architecture looks unusual. But since the primary goal here is to stress-test the stats/timer subsystem under contention rather than packet forwarding, I believe the current structure serves its purpose well.
>
> From: Stephen Hemminger <stephen at networkplumber.org>
> > > From: Rakesh Kudurumalla <rkudurumalla at marvell.com>
> > >
> > > 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 better availability 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>
> >
> > This does fix the problem, but this whole application seems like it is using an
> > unusual architecture. The main loop per thread spends most of its time
> > updating job stats and only periodically calls the actual rx/tx burst forwarding.
> > That is upside down??
We can discuss the future of this example.
For now, the fix is applied, thanks.
More information about the dev
mailing list