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]
Message-ID: <20200205093343.GT10400@smile.fi.intel.com>
Date:   Wed, 5 Feb 2020 11:33:43 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Michal Kubecek <mkubecek@...e.cz>
Cc:     Kai-Heng Feng <kai.heng.feng@...onical.com>, davem@...emloft.ne,
        jeffrey.t.kirsher@...el.com,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jiri Pirko <jiri@...lanox.com>,
        Pablo Neira Ayuso <pablo@...filter.org>,
        Maxime Chevallier <maxime.chevallier@...tlin.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Ido Schimmel <idosch@...lanox.com>,
        Jouni Hogander <jouni.hogander@...kie.com>,
        YueHaibing <yuehaibing@...wei.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Wang Hai <wanghai26@...wei.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Li RongQing <lirongqing@...du.com>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] net-sysfs: Ensure begin/complete are called in
 speed_show() and duplex_show()

On Wed, Feb 05, 2020 at 10:23:45AM +0100, Michal Kubecek wrote:
> On Wed, Feb 05, 2020 at 11:06:38AM +0200, Andy Shevchenko wrote:
> > On Wed, Feb 05, 2020 at 04:16:16PM +0800, Kai-Heng Feng wrote:
> > > Device like igb gets runtime suspended when there's no link partner. We
> > > can't get correct speed under that state:
> > > $ cat /sys/class/net/enp3s0/speed
> > > 1000
> > > 
> > > In addition to that, an error can also be spotted in dmesg:
> > > [  385.991957] igb 0000:03:00.0 enp3s0: PCIe link lost
> > > 
> > > It's because the igb device doesn't get runtime resumed before calling
> > > get_link_ksettings().
> > > 
> > > So let's use a new helper to call begin() and complete() like what
> > > dev_ethtool() does, to runtime resume/suspend or power up/down the
> > > device properly.
> > > 
> > > Once this fix is in place, igb can show the speed correctly without link
> > > partner:
> > > $ cat /sys/class/net/enp3s0/speed
> > > -1
> > 
> > What is the meaning of -1? Does it tells us "Hey, something is bad in hardware
> > I can't tell you the speed" or does it imply anything else?
> 
> It's SPEED_UNKNOWN constant printed with "%d" template.
> 
> > Wouldn't be better to report 0?
> > 
> > Where is the documentation part of this ABI change?
> 
> It's not an ABI change, /sys/class/net/*/speed already shows -1 when the
> device reports SPEED_UNKNOWN. The only change is that after this patch,
> igb driver reports SPEED_UNKNOWN rather than an outdated value if there
> is no link.

Thanks for elaboration.
Perhaps add a couple of words to the commit message that there is no ABI
changes.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ