lkml.org 
[lkml]   [2020]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] net-sysfs: Ensure begin/complete are called in speed_show() and duplex_show()
On Wed, 5 Feb 2020 11:06:38 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> 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?
>
> Wouldn't be better to report 0?
>
> Where is the documentation part of this ABI change?
>

The speed value of -1 is defined in ethtool.h as:

#define SPEED_UNKNOWN -1



\
 
 \ /
  Last update: 2020-02-05 10:20    [W:0.043 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site