All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Wang <weiwan@google.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: David Miller <davem@davemloft.net>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>, Felix Fietkau <nbd@nbd.name>,
	Paolo Abeni <pabeni@redhat.com>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Hillf Danton <hdanton@sina.com>
Subject: Re: [PATCH net-next v3 1/5] net: implement threaded-able napi poll loop support
Date: Sat, 21 Nov 2020 18:23:33 -0800	[thread overview]
Message-ID: <CAEA6p_ATLr-=xQ8cZLJE3cbWn=cFx11kpWm0cV2J2hiaOVFPzg@mail.gmail.com> (raw)
In-Reply-To: <20201121163136.024d636c@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>

On Sat, Nov 21, 2020 at 4:31 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 18 Nov 2020 11:10:05 -0800 Wei Wang wrote:
> > +int napi_set_threaded(struct napi_struct *n, bool threaded)
> > +{
> > +     ASSERT_RTNL();
> > +
> > +     if (n->dev->flags & IFF_UP)
> > +             return -EBUSY;
> > +
> > +     if (threaded == !!test_bit(NAPI_STATE_THREADED, &n->state))
> > +             return 0;
> > +     if (threaded)
> > +             set_bit(NAPI_STATE_THREADED, &n->state);
> > +     else
> > +             clear_bit(NAPI_STATE_THREADED, &n->state);
>
> Do we really need the per-NAPI control here? Does anyone have use cases
> where that makes sense? The user would be guessing which NAPI means
> which queue and which bit, currently.

Thanks for reviewing this.
I think one use case might be that if the driver uses separate napi
for tx and rx, one might want to only enable threaded mode for rx, and
leave tx completion in interrupt mode.


>
> > +     /* if the device is initializing, nothing todo */
> > +     if (test_bit(__LINK_STATE_START, &n->dev->state))
> > +             return 0;
> > +
> > +     napi_thread_stop(n);
> > +     napi_thread_start(n);
> > +     return 0;
> > +}
> > +EXPORT_SYMBOL(napi_set_threaded);
>
> Why was this exported? Do we still need that?
>

Yea. I guess it is not needed.

> Please rejig the patches into a reviewable form. You can use the
> Co-developed-by tag to give people credit on individual patches.

Will do. Thanks!

  reply	other threads:[~2020-11-22  2:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 19:10 [PATCH net-next v3 0/5] implement kthread based napi poll Wei Wang
2020-11-18 19:10 ` [PATCH net-next v3 1/5] net: implement threaded-able napi poll loop support Wei Wang
2020-11-22  0:31   ` Jakub Kicinski
2020-11-22  2:23     ` Wei Wang [this message]
2020-11-23 18:56       ` Jakub Kicinski
2020-11-23 19:07         ` Wei Wang
2020-11-18 19:10 ` [PATCH net-next v3 2/5] net: add sysfs attribute to control napi threaded mode Wei Wang
2020-11-18 20:36   ` Randy Dunlap
2020-11-18 21:20     ` Wei Wang
2020-11-18 19:10 ` [PATCH net-next v3 3/5] net: extract napi poll functionality to __napi_poll() Wei Wang
2020-11-18 19:10 ` [PATCH net-next v3 4/5] net: modify kthread handler to use __napi_poll() Wei Wang
2020-11-18 19:10 ` [PATCH net-next v3 5/5] net: improve napi threaded config Wei Wang
2020-11-18 20:14 ` [PATCH net-next v3 0/5] implement kthread based napi poll Wei Wang

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='CAEA6p_ATLr-=xQ8cZLJE3cbWn=cFx11kpWm0cV2J2hiaOVFPzg@mail.gmail.com' \
    --to=weiwan@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=hdanton@sina.com \
    --cc=kuba@kernel.org \
    --cc=nbd@nbd.name \
    --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 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.