From: Jakub Kicinski <kuba@kernel.org>
To: Samiullah Khawaja <skhawaja@google.com>
Cc: Joe Damato <jdamato@fastly.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
almasrymina@google.com, willemb@google.com,
mkarsten@uwaterloo.ca, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v5] Add support to set napi threaded for individual napi
Date: Mon, 28 Apr 2025 11:23:06 -0700 [thread overview]
Message-ID: <20250428112306.62ff198b@kernel.org> (raw)
In-Reply-To: <CAAywjhTsPXtKGQejc_vOWzgF18u9XG74LzjZeP9i3TQGxUi6NA@mail.gmail.com>
On Fri, 25 Apr 2025 20:53:14 -0700 Samiullah Khawaja wrote:
> > > We should check the discussions we had when threaded NAPI was added.
> > > I feel nothing was exposed in terms of observability so leaving the
> > > thread running didn't seem all that bad back then. Stopping the NAPI
> > > polling safely is not entirely trivial, we'd need to somehow grab
> > > the SCHED bit like busy polling does, and then re-schedule.
> > > Or have the thread figure out that it's done and exit.
> >
> > Actually, we ended up adding the explicit ownership bits so it may not
> > be all that hard any more.. Worth trying.
> Agreed. NAPI kthread lets go of the ownership by unsetting the
> SCHED_THREADED flag at napi_complete_done. This makes sure that the
> next SCHED is scheduled when new IRQ arrives and no packets are
> missed. We just have to make sure that it does that if it sees the
> kthread_should_stop. Do you think we should handle this maybe as a
> separate series/patch orthogonal to this?
We need to handle the case Joe pointed out. The new Netlink attributes
must make sense from day 1. I think it will be cleanest to work on
killing the thread first, but it can be a separate series.
> Also some clarification, we can remove the kthread when disabling napi
> threaded state using device level or napi level setting using netlink.
> But do you think we should also stop the thread when disabling a NAPI?
> That would mean the NAPI would lose any configurations done on this
> kthread by the user and those configurations won't be restored when
> this NAPI is enabled again. Some drivers use enable/disable as a
> mechanism to do soft reset, so a simple softreset to change queue
> length etc might revert these configurations.
That part I think needs to stay as is, the thread can be started and
stopped on napi_add / del, IMO.
next prev parent reply other threads:[~2025-04-28 18:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 20:14 [PATCH net-next v5] Add support to set napi threaded for individual napi Samiullah Khawaja
2025-04-24 23:13 ` Joe Damato
2025-04-25 18:28 ` Samiullah Khawaja
2025-04-25 22:24 ` Joe Damato
2025-04-25 22:52 ` Samiullah Khawaja
2025-04-26 0:37 ` Jakub Kicinski
2025-04-26 2:34 ` Joe Damato
2025-04-26 2:47 ` Jakub Kicinski
2025-04-26 3:12 ` Jakub Kicinski
2025-04-26 3:53 ` Samiullah Khawaja
2025-04-28 18:23 ` Jakub Kicinski [this message]
2025-04-28 19:25 ` Samiullah Khawaja
2025-04-25 23:06 ` Samiullah Khawaja
2025-04-26 0:42 ` Jakub Kicinski
2025-04-26 2:31 ` Joe Damato
2025-04-26 14:41 ` Willem de Bruijn
2025-04-28 18:12 ` Joe Damato
2025-04-28 18:38 ` Jakub Kicinski
2025-04-28 21:29 ` Joe Damato
2025-04-28 22:32 ` Jakub Kicinski
2025-04-30 0:16 ` Joe Damato
2025-05-03 2:10 ` Jakub Kicinski
2025-05-03 3:04 ` Joe Damato
2025-05-05 18:56 ` Jakub Kicinski
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=20250428112306.62ff198b@kernel.org \
--to=kuba@kernel.org \
--cc=almasrymina@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jdamato@fastly.com \
--cc=mkarsten@uwaterloo.ca \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.