Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp76373ybv; Wed, 5 Feb 2020 01:27:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwlSP3on35MrnzilWNTQrySafyQR0UrlqPsDBkWTgKAEq6bh389MMQ1xvX3kt8MDQMEg7MA X-Received: by 2002:aca:2118:: with SMTP id 24mr2223850oiz.28.1580894826323; Wed, 05 Feb 2020 01:27:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580894826; cv=none; d=google.com; s=arc-20160816; b=Q12msQAr/YQO4lDsKq0u7IvzcVx7BDbT5rdC1zeNFxwzH+wMiJSAReHL9IMAarJaLg JRG8xiAGwnu5H5FRmFnwlQl2uklx8kIXqhGECJneGjQ47tDCJTc6AB50LfjcffSGGgAf z2eHEiKdJ/re6GDmQZgjhDe+eTbcRWPUH81ppGLPe+tduPT5zeOkWpnNudS6HuGy3Pw4 R+gIQdVL+UN1YWJQyhgTnCeUQhZYzI+zAb7LZcGvQmOW2lemK1GS/EaD023ucpRv33Yy gHgObgASLXUMQyij2ARY7OBBprl7xTVUiUn3z7IWAQiDP6HhsLyVuIB+T4iYyteUxMcq bS4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Cyk3XpO52mqJKz3qQ5D/pRo1y1Rix9lEqRlN9Fcy0mo=; b=hC8TiqlSm03zuGI3Ra3ZCddMxT4GVecyFrDIkZp0MFWOeWEnSxeKo6bAqbSfaZ4g08 CMIFx8l95zCFvE7ywLZLImE5eNyPhM5NdOA1NuBhK378aFfHif4XXhG/tC8BN1eeyn+5 aH1pkuY2ffThdY9cmMfJKudU6kZBl1avvLlaZ93f4aM4McbJfYsGaaIqsxNddpPaey3z HaOfEsWJCYrZJgWWPGApXa7rtd3KBFQU4qCi8Wc/2eo4iVuZYmuh476tz6FZ7nwnBPIp PDULn7T+tzi1AlyYJza7Mosl6208FwL0OoIk8VKcfuA9bdxuBdndCITISOEx9aKMKWAM A+ew== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6si13115819otq.115.2020.02.05.01.26.53; Wed, 05 Feb 2020 01:27:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728239AbgBEJXx (ORCPT + 99 others); Wed, 5 Feb 2020 04:23:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:49454 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728222AbgBEJXx (ORCPT ); Wed, 5 Feb 2020 04:23:53 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6C2ACB1F7; Wed, 5 Feb 2020 09:23:48 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id D53B2E03A8; Wed, 5 Feb 2020 10:23:45 +0100 (CET) Date: Wed, 5 Feb 2020 10:23:45 +0100 From: Michal Kubecek To: Andy Shevchenko 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: <20200205092345.GA14294@unicorn.suse.cz> References: <20200205081616.18378-1-kai.heng.feng@canonical.com> <20200205081616.18378-2-kai.heng.feng@canonical.com> <20200205090638.GS10400@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200205090638.GS10400@smile.fi.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 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. Michal