lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 18 Nov 2020 13:20:34 -0800
From:   Wei Wang <weiwan@...gle.com>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        Felix Fietkau <nbd@....name>, Paolo Abeni <pabeni@...hat.com>,
        Hannes Frederic Sowa <hannes@...essinduktion.org>,
        Hillf Danton <hdanton@...a.com>
Subject: Re: [PATCH net-next v3 2/5] net: add sysfs attribute to control napi
 threaded mode

On Wed, Nov 18, 2020 at 12:36 PM Randy Dunlap <rdunlap@...radead.org> wrote:
>
> On 11/18/20 11:10 AM, Wei Wang wrote:
> > From: Paolo Abeni <pabeni@...hat.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@...hat.com>
> > Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
> > Signed-off-by: Wei Wang <weiwan@...gle.com>
> > Reviewed-by: Eric Dumazet <edumazet@...gle.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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ