Re: [PATCH net-next 1/7] bng_en: add per-PF workqueue, timer, and slow-path task
From: Bhargava Chenna Marreddy
Date: Thu Feb 26 2026 - 09:28:30 EST
On Wed, Feb 25, 2026 at 8:02 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Mon, 23 Feb 2026 22:06:35 +0530 Bhargava Marreddy wrote:
> > + if (atomic_read(&bn->intr_sem) != 0)
> > + goto bnge_restart_timer;
> > +
> > + /* Periodic work added by later patches */
> > +
> > +bnge_restart_timer:
> > + mod_timer(&bn->timer, jiffies + bn->current_interval);
>
> This intr_sem thing looks highly questionable.
>
> It provides no synchronization guarantee since the state of intr_sem
> may change immediately after the read. Please use normal locking
> primitives and/or cancel the timer _sync() if you want to make sure
> it's not running.
Hi Jakub,
Agreed. The intr_sem will be removed in v2. The timer already checks
BNGE_STATE_OPEN, which is cleared before del_timer_sync() in the
close path. This ensures the timer either exits early upon seeing the
cleared bit or is synchronized by the cancel call.
Thanks,
Bhargava Marreddy
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature