From patchwork Mon Sep 3 10:21:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 145781 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2313494ljw; Mon, 3 Sep 2018 03:23:35 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb3ypf+pt9fjkPeEKzGQ8WczAb+ZVo/ZbVwhRhwbpOJChrCZDhK0/ArYJdYL4b7A4F5JlMe X-Received: by 2002:a63:4425:: with SMTP id r37-v6mr25518115pga.391.1535970214991; Mon, 03 Sep 2018 03:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535970214; cv=none; d=google.com; s=arc-20160816; b=Puj0L67mWzJoGilUFKhlab9JqhXIFiLSmD9QxAT/fFuoyjhpOzyxdXoNTCLwtI+mKV xCwRaKfTIA0gIYTNPcauYCEH3MVD5rsyYjupP8dIv6/9EOJu0rpAAk/KxFOqi6JS2GOT hGFq//M/77Ukmd1FT624wIx+YBBLc8KcynUKuohlg/9RbvZQOsDt/xYB7f61kdsvLuX7 f21Rt1c3tLvBNeEji34Tn6TLxFHoFEpm+PBEjG7LVB3/OmJl4B2oyuuEJCHhS2hgUBqG 4gag22RSFopZ+hW+LnX2w3Ych2f6f39aMi7sZnHOOj3+ik+eysacgKNSZwoSIskDHPQV oK/w== 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=IhdZGAF85+8lx7Yo/O0n87VGZKi8Le8MHHvbbw6RQhY=; b=HkDKTbOyKg/rnEP1mRuskFQxXZz2hBh+0vc1mtOaJQRrPK5LjTyQXe4kI+QRxat2kj kpewML1vaZ+swkdLYcSKxIgcJdqYnqlIF+DOCICOhXXzCL1ageLd5iz9d+2B3i4y2aBa evBs2fL8hJnYFHk+uhztNOyaHZvGU8hl37GZ7BeXREVBppHHGKtigqRJFww1IatIr+71 d8XqgCKDIyl6QHNDJAqLU5o6Wyotr84PR7MSywHF2ckGxSP5x2+giy29VQlN4kxOXcjs huvNVpQHquNY3bD+BhUbupXBApGu9VrTYJbgR6Q3ZoSiBzUIM9j/P2QrNAN1uuogjNdg s+jg== 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 p14-v6si16713862pgg.67.2018.09.03.03.23.34; Mon, 03 Sep 2018 03:23:34 -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 S1728061AbeICOnC (ORCPT + 32 others); Mon, 3 Sep 2018 10:43:02 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:51689 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725949AbeICOnC (ORCPT ); Mon, 3 Sep 2018 10:43:02 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E9F7171114CA6; Mon, 3 Sep 2018 18:23:24 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Mon, 3 Sep 2018 18:23:18 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 10/11] net: hns3: Remove redundant codes of query advertised flow control abilitiy Date: Mon, 3 Sep 2018 11:21:55 +0100 Message-ID: <20180903102156.18676-11-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180903102156.18676-1-salil.mehta@huawei.com> References: <20180903102156.18676-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen If the advertised flow control ability has been fetched using phy_ethtool_ksettings_get() or hclge_get_link_mode() then it is unnecessary to fetch them again later using hclge_get_flowctrl_adv(). This patch removes it. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 12 ------------ drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 15 --------------- 2 files changed, 27 deletions(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index dfce76e..41d817d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -591,18 +591,6 @@ static int hns3_get_link_ksettings(struct net_device *netdev, /* 4.mdio_support */ cmd->base.mdio_support = ETH_MDIO_SUPPORTS_C22; - /* 5.get flow control setttings */ - if (h->ae_algo->ops->get_flowctrl_adv) - h->ae_algo->ops->get_flowctrl_adv(h, &flowctrl_adv); - - if (flowctrl_adv & ADVERTISED_Pause) - ethtool_link_ksettings_add_link_mode(cmd, advertising, - Pause); - - if (flowctrl_adv & ADVERTISED_Asym_Pause) - ethtool_link_ksettings_add_link_mode(cmd, advertising, - Asym_Pause); - return 0; } diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 25d4fd9..c56db06 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5221,20 +5221,6 @@ static u32 hclge_get_fw_version(struct hnae3_handle *handle) return hdev->fw_version; } -static void hclge_get_flowctrl_adv(struct hnae3_handle *handle, - u32 *flowctrl_adv) -{ - struct hclge_vport *vport = hclge_get_vport(handle); - struct hclge_dev *hdev = vport->back; - struct phy_device *phydev = hdev->hw.mac.phydev; - - if (!phydev) - return; - - *flowctrl_adv |= (phydev->advertising & ADVERTISED_Pause) | - (phydev->advertising & ADVERTISED_Asym_Pause); -} - static void hclge_set_flowctrl_adv(struct hclge_dev *hdev, u32 rx_en, u32 tx_en) { struct phy_device *phydev = hdev->hw.mac.phydev; @@ -6335,7 +6321,6 @@ static const struct hnae3_ae_ops hclge_ops = { .get_tqps_and_rss_info = hclge_get_tqps_and_rss_info, .set_channels = hclge_set_channels, .get_channels = hclge_get_channels, - .get_flowctrl_adv = hclge_get_flowctrl_adv, .get_regs_len = hclge_get_regs_len, .get_regs = hclge_get_regs, .set_led_id = hclge_set_led_id,