[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b5d2beb4-eb8d-4cb6-a50c-c3800fe8eff0@iogearbox.net>
Date: Mon, 12 Jan 2026 10:15:59 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Stanislav Fomichev <stfomichev@...il.com>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org, kuba@...nel.org,
davem@...emloft.net, razor@...ckwall.org, pabeni@...hat.com,
willemb@...gle.com, sdf@...ichev.me, john.fastabend@...il.com,
martin.lau@...nel.org, jordan@...fe.io, maciej.fijalkowski@...el.com,
magnus.karlsson@...el.com, dw@...idwei.uk, toke@...hat.com,
yangzhenze@...edance.com, wangdongdong.6@...edance.com
Subject: Re: [PATCH net-next v5 02/16] net: Implement
netdev_nl_queue_create_doit
On 1/11/26 9:55 PM, Stanislav Fomichev wrote:
> On 01/09, Daniel Borkmann wrote:
[...]
>> +void netdev_rx_queue_lease(struct netdev_rx_queue *rxq_dst,
>> + struct netdev_rx_queue *rxq_src)
>> +{
>> + netdev_assert_locked(rxq_src->dev);
>> + netdev_assert_locked(rxq_dst->dev);
>> +
>> + WARN_ON_ONCE(READ_ONCE(rxq_src->dev->reg_state) == NETREG_UNREGISTERING);
>
> I might have missed some of your discussions with Jakub, but what is
> this WARN_ON_ONCE above trying to catch? And why not handle it explicitly
> (via returning an error from netdev_rx_queue_lease)?
This is basically just an assertion. The unregistering part is handled internally
via __netdev_put_lock() which releases the held reference on the netdev, and if
the netdev is still registered it tries to lock the instance lock. If its
being unregistered that function returns NULL and therefore we bail out in the
netdev_nl_queue_create_doit() at netdev_put_lock() getting a NULL device back.
Thanks,
Daniel
Powered by blists - more mailing lists