Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp82796ybv; Wed, 5 Feb 2020 01:35:12 -0800 (PST) X-Google-Smtp-Source: APXvYqyqIHf+B1l2zDcYgNYBQlAeJKL8PMWURcOI1QyXsXNreFDBm/DzUGgcmY467CGwFAF9T48f X-Received: by 2002:aca:2312:: with SMTP id e18mr2301341oie.34.1580895312115; Wed, 05 Feb 2020 01:35:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580895312; cv=none; d=google.com; s=arc-20160816; b=GI+ooMPyw62i0TBwHaUQ+AyEYHZPwrExsBF97lRatHrSyZk8yIzrlFBeK3btQiGrgD YZX/3Nfz9ZLwLy3UDgocByLPWs5Bn4D89tCQPMGDAowM6/CTBJXfqXU0ydqHuwEJgcXN Y2v0Pl+zkU25HAeBoqljgEVZp9F0CcrU8AB4oFuISH8uq0FIku2JZasSZpUASOCt2khn O5UjffRoqZwuyMaGala9lhwoDenkTY1eklMeNLqnCXe423oL46fUGblhzWPpnkrRw3vB 3EacbpucahQurGl6BHEVRIAgTgaHzyfAYlCw3xcXp3kijfbHno2LOQgh3KC1oas+sI+Y FWRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2ks19Fx7WVH1xeHoO1SjwAwbPQ4+OyFHc1oFcztpRLQ=; b=pLJTo4Ow8PBocDwdUtAEkM0v4bRhOcy+4t/Ga36OlNE/xKtu3mvTlrgvLukmtI3zUJ SoJnPltYvjp+5VXN1n4/zFozCofTONOUJh6B0gZE5ytdHD9LG5DqYnLUziFgWVxU6jp7 Fs5yGuKG/PU3IX1o2b+vtTfPJksqDdjU+vxcUBxboMfR5qAWZHNm00UtV5VEmGdH0QIW OwCzYh87+d2X2i4JTfg5ATQLbJtIwQ5qLyY800ryxbyqp+wBevUNWZAVQhLpK8aFzuIe jQ8hfH/mgwAsxEQutf7Rl4RBkXWrOtVbmoHoICjR9QZLGQmHUm/4U6zClkZjRdzI+zcd vUlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k19si6196314otp.33.2020.02.05.01.34.59; Wed, 05 Feb 2020 01:35:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728195AbgBEJdu (ORCPT + 99 others); Wed, 5 Feb 2020 04:33:50 -0500 Received: from mga05.intel.com ([192.55.52.43]:19048 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728035AbgBEJdt (ORCPT ); Wed, 5 Feb 2020 04:33:49 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2020 01:33:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,405,1574150400"; d="scan'208";a="378683518" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004.jf.intel.com with ESMTP; 05 Feb 2020 01:33:43 -0800 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1izH43-0000Hp-JV; Wed, 05 Feb 2020 11:33:43 +0200 Date: Wed, 5 Feb 2020 11:33:43 +0200 From: Andy Shevchenko To: Michal Kubecek Cc: Kai-Heng Feng , davem@davemloft.ne, jeffrey.t.kirsher@intel.com, "David S. Miller" , Jakub Kicinski , Jiri Pirko , Pablo Neira Ayuso , Maxime Chevallier , Heiner Kallweit , Florian Fainelli , Greg Kroah-Hartman , Ido Schimmel , Jouni Hogander , YueHaibing , Eric Dumazet , Wang Hai , Thomas Gleixner , Li RongQing , open list , "open list:NETWORKING [GENERAL]" Subject: Re: [PATCH v2 2/2] net-sysfs: Ensure begin/complete are called in speed_show() and duplex_show() Message-ID: <20200205093343.GT10400@smile.fi.intel.com> References: <20200205081616.18378-1-kai.heng.feng@canonical.com> <20200205081616.18378-2-kai.heng.feng@canonical.com> <20200205090638.GS10400@smile.fi.intel.com> <20200205092345.GA14294@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200205092345.GA14294@unicorn.suse.cz> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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