netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	davem@davemloft.ne, jeffrey.t.kirsher@intel.com,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@mellanox.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ido Schimmel <idosch@mellanox.com>,
	Jouni Hogander <jouni.hogander@unikie.com>,
	YueHaibing <yuehaibing@huawei.com>,
	Eric Dumazet <edumazet@google.com>,
	Wang Hai <wanghai26@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Li RongQing <lirongqing@baidu.com>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] net-sysfs: Ensure begin/complete are called in speed_show() and duplex_show()
Date: Wed, 5 Feb 2020 11:33:43 +0200	[thread overview]
Message-ID: <20200205093343.GT10400@smile.fi.intel.com> (raw)
In-Reply-To: <20200205092345.GA14294@unicorn.suse.cz>

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



  reply	other threads:[~2020-02-05  9:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  8:16 [PATCH v2 1/2] igb: Use device_lock() insead of rtnl_lock() Kai-Heng Feng
2020-02-05  8:16 ` [PATCH v2 2/2] net-sysfs: Ensure begin/complete are called in speed_show() and duplex_show() Kai-Heng Feng
2020-02-05  9:06   ` Andy Shevchenko
2020-02-05  9:19     ` Stephen Hemminger
2020-02-05  9:23     ` Michal Kubecek
2020-02-05  9:33       ` Andy Shevchenko [this message]
2020-02-07  4:11 ` [Intel-wired-lan] [PATCH v2 1/2] igb: Use device_lock() insead of rtnl_lock() Dan Carpenter

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=20200205093343.GT10400@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=davem@davemloft.ne \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hkallweit1@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jiri@mellanox.com \
    --cc=jouni.hogander@unikie.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=tglx@linutronix.de \
    --cc=wanghai26@huawei.com \
    --cc=yuehaibing@huawei.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 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).