netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Samiullah Khawaja <skhawaja@google.com>
Cc: "David S . Miller " <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	almasrymina@google.com, willemb@google.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: Restore napi threaded state only when it is enabled
Date: Tue, 22 Jul 2025 18:36:47 -0700	[thread overview]
Message-ID: <20250722183647.1fd15767@kernel.org> (raw)
In-Reply-To: <20250721233608.111860-1-skhawaja@google.com>

On Mon, 21 Jul 2025 23:36:08 +0000 Samiullah Khawaja wrote:
> Commit 2677010e7793 ("Add support to set NAPI threaded for individual
> NAPI") added support to enable/disable threaded napi using netlink. This
> also extended the napi config save/restore functionality to set the napi
> threaded state. This breaks the netdev reset when threaded napi is

"This breaks the netdev reset" is very vague.

> enabled at device level as the napi_restore_config tries to stop the
> kthreads as napi->config->thread is false when threaded is enabled at
> device level.

My reading of the commit message is that the WARN triggers, but
looking at the code I think you mean that we fail to update the
config when we set at the device level?

> The napi_restore_config should only restore the napi threaded state when
> threaded is enabled at NAPI level.
> 
> The issue can be reproduced on virtio-net device using qemu. To
> reproduce the issue run following,
> 
>   echo 1 > /sys/class/net/threaded
>   ethtool -L eth0 combined 1

Maybe we should add that as a test under tools/testing/drivers/net -
it will run against netdevsim but also all drivers we test which
currently means virtio and fbnic, but hopefully soon more. Up to you.

I'm not sure I agree with the semantics, tho. IIUC you're basically
making the code prefer threaded option. If user enables threading
for the device, then disables it for a NAPI - reconfiguration will
lose the fact that specific NAPI instance was supposed to have threading
disabled. Why not update napi->config in netif_set_threaded() instead?
-- 
pw-bot: cr

  reply	other threads:[~2025-07-23  1:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21 23:36 [PATCH net-next] net: Restore napi threaded state only when it is enabled Samiullah Khawaja
2025-07-23  1:36 ` Jakub Kicinski [this message]
2025-07-23  2:36   ` Samiullah Khawaja
2025-07-23 14:56     ` Jakub Kicinski
2025-07-29 19:30       ` Samiullah Khawaja

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=20250722183647.1fd15767@kernel.org \
    --to=kuba@kernel.org \
    --cc=almasrymina@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=skhawaja@google.com \
    --cc=willemb@google.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).