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 <[email protected]>
> > > From: Rakesh Kudurumalla <[email protected]>
> > >
> > > 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: [email protected]
> > >
> > > Signed-off-by: Rakesh Kudurumalla <[email protected]>
> > 
> > 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.



Reply via email to