Received: by 10.223.164.221 with SMTP id h29csp2898155wrb; Thu, 2 Nov 2017 20:53:30 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SP2kaqkPb6HD1uu9YTkw9p5Hj/31rXM19/IxMit6Wz+XLYmkuTST1+y3upMRnlmBHg++pU X-Received: by 10.84.240.136 with SMTP id z8mr5417207plk.240.1509681210681; Thu, 02 Nov 2017 20:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509681210; cv=none; d=google.com; s=arc-20160816; b=fW2CnXkEvXkslITKXHvp+XNdy737ZrjGMXRgeert1G4LeI+ftxZezLU0SZTOZj69QF 5fZGNrC2W4hn7m6YuUuJatDEkA1zbIt3NVFtcJl+5soIqjUMSNeZjRImm6m8OWBnP9V1 h1qi0ASxhIgQDyiXjk2R1jeDFpGjvjONUK7atWvzLy2aKZG8K6YVbdPUy34tjNUazHAS R07TMqTBNm668nGvYKiBMo1Ir9O6XtiPiADhH5tNcxwvCTk14b9kjdTMauzL+IJV4JGn yJXykxSJ/GEAYUyU3DSBkXLiIEmh7jN9mUsAxSwfC4lgSMO/XFz/ZskjBq4eTwCuAPhw WBfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=kFMuEMc3SC/4/30gdIAUDm1UMa6W3Q84Wp4Y/Ms5KPg=; b=m/e6Q9g8+L7aobUOMRqCxejSl3npGh+hTB+3MCy+xVVNpkRKWhfNrldPPcksLlNWau 9UHeqZ7WZFmckfIA00iITv+3MXSGD3RG54DQ//lJTfAJB9RbLSoOJPOxyVpYFJv7orLf cgbv8ghYoylz9m+x/Hx3aHtF7tx4OdQ8oiyWdUEbBeUF/bd1qLYiO7zP3/1/nv0ACuia l9dHdAScqHrz2v3/jEs81vFHYijatnMfHXfq4Qyw85EHrJzgxHrvOpFdgLK25xWKk1W/ BbLciQXtn3D2o6PHBTw8FXzts/LIUN1jIbh9NmJkm/r6rWDoxcGDGrLkfUWvM4YeGL1i 42Qw== 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 r12si4903301pgp.586.2017.11.02.20.53.17; Thu, 02 Nov 2017 20:53:30 -0700 (PDT) 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 S1755565AbdKCDwZ (ORCPT + 97 others); Thu, 2 Nov 2017 23:52:25 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9941 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbdKCDvL (ORCPT ); Thu, 2 Nov 2017 23:51:11 -0400 Received: from 172.30.72.58 (EHLO DGGEMS411-HUB.china.huawei.com) ([172.30.72.58]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKE90171; Fri, 03 Nov 2017 11:51:04 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.361.1; Fri, 3 Nov 2017 11:50:55 +0800 From: Lipeng To: CC: , , , , Subject: [PATCH net-next 2/6] net: hns3: fix for getting advertised_caps in hns3_get_link_ksettings Date: Fri, 3 Nov 2017 12:18:26 +0800 Message-ID: <1509682710-94908-3-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509682710-94908-1-git-send-email-lipeng321@huawei.com> References: <1509682710-94908-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.59FBE7A9.002A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: f24a3144f5406d3d735d2d1f7acb2726 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang This patch fixes a bug for ethtool's get_link_ksettings(). The advertising for autoneg is always added to advertised_caps whether autoneg is enable or disable. This patch fixes it. Fixes: 496d03e (net: hns3: Add Ethtool support to HNS3 driver) Signed-off-by: Fuyun Liang Signed-off-by: Lipeng --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c index 367b20c..0e10a43 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c @@ -640,6 +640,9 @@ static int hns3_get_link_ksettings(struct net_device *netdev, break; } + if (!cmd->base.autoneg) + advertised_caps &= ~HNS3_LM_AUTONEG_BIT; + /* now, map driver link modes to ethtool link modes */ hns3_driv_to_eth_caps(supported_caps, cmd, false); hns3_driv_to_eth_caps(advertised_caps, cmd, true); -- 1.9.1 From 1583001145518840698@xxx Fri Nov 03 00:05:35 +0000 2017 X-GM-THRID: 1581815054429934205 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread