From: Paolo Abeni <pabeni@redhat.com>
To: I Viswanath <viswanathiyyappan@gmail.com>,
kuba@kernel.org, horms@kernel.org, andrew+netdev@lunn.ch,
edumazet@google.com, xuanzhuo@linux.alibaba.com, mst@redhat.com,
jasowang@redhat.com, eperezma@redhat.com
Cc: netdev@vger.kernel.org, virtualization@lists.linux.dev
Subject: Re: [PATCH net-next v6 0/2] net: Split ndo_set_rx_mode into snapshot and deferred write
Date: Sun, 28 Dec 2025 16:20:44 +0100 [thread overview]
Message-ID: <f7840b22-38b5-4252-9663-4aefb993b211@redhat.com> (raw)
In-Reply-To: <20251227174225.699975-1-viswanathiyyappan@gmail.com>
On 12/27/25 6:42 PM, I Viswanath wrote:
> This is an implementation of the idea provided by Jakub here
>
> https://lore.kernel.org/netdev/20250923163727.5e97abdb@kernel.org/
>
> ndo_set_rx_mode is problematic because it cannot sleep.
>
> To address this, this series proposes dividing the concept of setting
> rx_mode into 2 stages: snapshot and deferred I/O. To achieve this, we
> reinterpret set_rx_mode and add create a new ndo write_rx_mode as
> explained below:
>
> The new set_rx_mode will be responsible for customizing the rx_mode
> snapshot which will be used by write_rx_mode to update the hardware
>
> In brief, the new flow looks something like:
>
> prepare_rx_mode():
> ndo_set_rx_mode();
> prepare_snapshot();
>
> write_rx_mode():
> use_ready_snapshot();
> ndo_write_rx_mode();
>
> write_rx_mode() is called from a work item and doesn't hold the
> netif_addr_lock lock during ndo_write_rx_mode() making it sleepable
> in that section.
>
> This model should work correctly if the following conditions hold:
>
> 1. write_rx_mode should use the rx_mode set by the most recent
> call to make_snapshot_ready before its execution.
>
> 2. If a make_snapshot_ready call happens during execution of write_rx_mode,
> write_rx_mode should be rescheduled.
>
> 3. All calls to modify rx_mode should pass through the prepare_rx_mode +
> schedule write_rx_mode execution flow. netif_rx_mode_schedule_work
> has been implemented in core for this purpose.
>
> 1 and 2 are implemented in core
>
> Drivers need to ensure 3 using netif_rx_mode_schedule_work
>
> To use this model, a driver needs to implement the
> ndo_write_rx_mode callback, change the set_rx_mode callback
> appropriately and replace all calls to modify rx mode with
> netif_rx_mode_schedule_work
>
> Signed-off-by: I Viswanath <viswanathiyyappan@gmail.com>
## Form letter - net-next-closed
The net-next tree is closed for new drivers, features, code refactoring
and optimizations due to the merge window and the winter break. We are
currently accepting bug fixes only.
Please repost when net-next reopens after Jan 2nd.
RFC patches sent for review only are obviously welcome at any time.
next prev parent reply other threads:[~2025-12-28 15:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-27 17:42 [PATCH net-next v6 0/2] net: Split ndo_set_rx_mode into snapshot and deferred write I Viswanath
2025-12-27 17:42 ` [PATCH net-next v6 1/2] net: refactor set_rx_mode into snapshot and deferred I/O I Viswanath
2025-12-27 17:42 ` [PATCH net-next v6 2/2] virtio-net: Implement ndo_write_rx_mode callback I Viswanath
2025-12-28 15:20 ` Paolo Abeni [this message]
2025-12-28 12:29 ` [PATCH net-next v6 0/2] net: Split ndo_set_rx_mode into snapshot and deferred write I Viswanath
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=f7840b22-38b5-4252-9663-4aefb993b211@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=horms@kernel.org \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux.dev \
--cc=viswanathiyyappan@gmail.com \
--cc=xuanzhuo@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).