From: David Wei <dw@davidwei.uk>
To: Jakub Kicinski <kuba@kernel.org>
Cc: io-uring@vger.kernel.org, netdev@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>,
Pavel Begunkov <asml.silence@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net v1] net: io_uring/zcrx: call netdev_queue_get_dma_dev() under instance lock
Date: Tue, 28 Oct 2025 15:44:05 -0700 [thread overview]
Message-ID: <842b9023-1b86-455b-9aaa-20cdf0234c35@davidwei.uk> (raw)
In-Reply-To: <20251028153820.414b3956@kernel.org>
On 2025-10-28 15:38, Jakub Kicinski wrote:
> On Tue, 28 Oct 2025 14:26:39 -0700 David Wei wrote:
>> netdev ops must be called under instance lock or rtnl_lock, but
>> io_register_zcrx_ifq() isn't doing this for netdev_queue_get_dma_dev().
>>
>> Fix this by taking the instance lock.
>>
>> Opted to do this by hand instead of netdev_get_by_index_lock(), which is
>> an older helper that doesn't take netdev tracker.
>
> Fixes tag missing.
Sorry, will add, keep forgetting this...
>
> netdev_get_by_index_lock() + netdev_hold() would be a better choice indeed.
> Just a reference doesn't hold off device shutdown.
Got it, I'll switch to this.
>
> Is there a chance to reorder the io_zcrx_create_area() call, keep
> holding the lock and call __net_mp_open_rxq() ?
Yeah, I also thought about it, wasn't sure if it was appropriate to
extend the critical section. I'll do this in v2.
prev parent reply other threads:[~2025-10-28 22:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 21:26 [PATCH net v1] net: io_uring/zcrx: call netdev_queue_get_dma_dev() under instance lock David Wei
2025-10-28 22:38 ` Jakub Kicinski
2025-10-28 22:44 ` David Wei [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=842b9023-1b86-455b-9aaa-20cdf0234c35@davidwei.uk \
--to=dw@davidwei.uk \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=io-uring@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox