From: Wei Wang <weiwan@google.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
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 2/5] net: add sysfs attribute to control napi threaded mode
Date: Wed, 18 Nov 2020 13:20:34 -0800 [thread overview]
Message-ID: <CAEA6p_BN7XRxc7Avw0rx5N+j_iGqVqB8gpok6AMaHkf2kjPNCA@mail.gmail.com> (raw)
In-Reply-To: <8578cfd8-dcaf-5a86-7803-922ee27d9e90@infradead.org>
On Wed, Nov 18, 2020 at 12:36 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> On 11/18/20 11:10 AM, Wei Wang wrote:
> > From: Paolo Abeni <pabeni@redhat.com>
> >
> > this patch adds a new sysfs attribute to the network
> > device class. Said attribute is a bitmask that allows controlling
> > the threaded mode for all the napi instances of the given
> > network device.
> >
> > The threaded mode can be switched only if related network device
> > is down.
> >
> > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> > Signed-off-by: Wei Wang <weiwan@google.com>
> > Reviewed-by: Eric Dumazet <edumazet@google.com>
>
> Hi,
>
> Could someone describe the bitmask (is it a bit per instance of the
> network device?).
> And how to use the sysfs interface, please?
>
It is 1 bit per napi. Depending on the driver implementation, 1 napi
could correspond to 1 tx queue, or 1 rx queue, or 1 pair of tx/rx
queues.
To set bits in the bit mask, you could do:
echo 0-14 > /sys/class/net/<dev>/threaded
to set consecutive bits.
or:
echo 0,2,4,6,8 > /sys/class/net/<dev>/threaded
to set individual bits.
To clear the bit mask, you could do:
echo > /sys/class/net/<dev>/threaded
> > ---
> > net/core/net-sysfs.c | 103 +++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 103 insertions(+)
> >
> > diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
> > index 94fff0700bdd..df8dd25e5e4b 100644
> > --- a/net/core/net-sysfs.c
> > +++ b/net/core/net-sysfs.c
>
>
> thanks.
> --
> ~Randy
>
next prev parent reply other threads:[~2020-11-18 21:20 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
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 [this message]
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_BN7XRxc7Avw0rx5N+j_iGqVqB8gpok6AMaHkf2kjPNCA@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 \
--cc=rdunlap@infradead.org \
/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).