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:   Tue, 22 Mar 2022 01:03:58 +0530
From:   Prasanna Vengateshan <prasanna.vengateshan@...rochip.com>
To:     Andrew Lunn <andrew@...n.ch>
CC:     <netdev@...r.kernel.org>, <olteanv@...il.com>,
        <robh+dt@...nel.org>, <UNGLinuxDriver@...rochip.com>,
        <woojung.huh@...rochip.com>, <hkallweit1@...il.com>,
        <linux@...linux.org.uk>, <davem@...emloft.net>, <kuba@...nel.org>,
        <linux-kernel@...r.kernel.org>, <vivien.didelot@...il.com>,
        <f.fainelli@...il.com>, <devicetree@...r.kernel.org>
Subject: Re: [PATCH v9 net-next 08/11] net: dsa: microchip: add support for
 ethtool port counters

On Sun, 2022-03-20 at 02:26 +0100, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> On Fri, Mar 18, 2022 at 02:25:37PM +0530, Prasanna Vengateshan wrote:
> > Added support for get_eth_**_stats() (phy/mac/ctrl) and
> > get_stats64()
> > 
> > Reused the KSZ common APIs for get_ethtool_stats() & get_sset_count()
> > along with relevant lan937x hooks for KSZ common layer and added
> > support for get_strings()
> 
> 
> > +static void lan937x_get_stats64(struct dsa_switch *ds, int port,
> > +                             struct rtnl_link_stats64 *s)
> > +{
> > +     struct ksz_device *dev = ds->priv;
> > +     struct ksz_port_mib *mib = &dev->ports[port].mib;
> > +     u64 *ctr = mib->counters;
> > +
> > +     mutex_lock(&mib->cnt_mutex);
> 
> I think for stats64 you are not allowed to block.
> 
> https://lore.kernel.org/netdev/20220218104330.g3vfbpdqltdkp4sr@skbuf/T/
> 
> There was talk of changing this. but i don't think it ever happened.
> 
>       Andrew

Looks like it has been changed from mutex_lock() to spin_lock() since
ndo_get_stats64 runs in atomic context. I will adopt the same. Thanks for the
feedback.

Prasanna V

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ