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.
> -----Original Message----- > From: Stephen Hemminger <[email protected]> > Sent: Monday, March 2, 2026 9:18 PM > To: Rakesh Kudurumalla <[email protected]> > Cc: Pawel Wodkowski <[email protected]>; Pablo de Lara > <[email protected]>; [email protected]; Jerin Jacob > <[email protected]>; Nithin Kumar Dabilpuram > <[email protected]>; [email protected] > Subject: [EXTERNAL] Re: [PATCH v6 1/1] examples/l2fwd-jobstats: fix timer > stats display with lock contention > > On Mon, 2 Mar 2026 11: 48: 05 +0530 rkudurumalla > <rkudurumalla@ marvell. com> wrote: > From: Rakesh Kudurumalla > <rkudurumalla@ marvell. com> > > Race condition between jobstats and time > metrics > for forwarding and flushing ZjQcmQRYFpfptBannerStart Prioritize > security for external emails: > Confirm sender and content safety before clicking links or opening > attachments <https://us-phishalarm- > ewt.proofpoint.com/EWT/v1/CRVmXkqW!tM3Z1f8UYnW69E- > 8WVxabgLBnjenXs- > Q7zZlpNFDtzEovrPgbLIXPV9yb_zhviTyHuvZsJVX17MSajtzju0guOTk$> > Report Suspicious > > ZjQcmQRYFpfptBannerEnd > On Mon, 2 Mar 2026 11:48:05 +0530 > rkudurumalla <[email protected]> wrote: > > > 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??

