Received: by 10.213.65.68 with SMTP id h4csp680421imn; Fri, 6 Apr 2018 07:13:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx487RHw95j2x0vkW3q491+NPu3YV0DwjTkgPE30Ab5dxZP7Zo7Pe3gA5d5Dwq7SWXxwhJ9bw X-Received: by 2002:a17:902:728f:: with SMTP id d15-v6mr26842175pll.227.1523023994068; Fri, 06 Apr 2018 07:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523023994; cv=none; d=google.com; s=arc-20160816; b=GgI+GgERDjQwN4GTv+MjnFoO1eeX6vnHoeK+c01JnWkmQAW4FqGuq9ZvuULOfDmfdT H4x4O8Sw3abWGhmZuToF9+UiD6B6phCAP+82ioGTVcz0yK2IcRQAfi1QPwVyvKRETK55 7DcTjNYp9nF6V9mT1lLNt5556XQobi3C/iUcWnNp9v4l02cZDBkl+HggDaCoSZB9im2l ynJkBg0SN8w1djmwuXZ3V72Ve2Jtby8Fkrlm23L5wCx18bH0gid02NhSTbJJVRN3nXiE SAc7KdWeijt4/peyHJVWRqEPvOKARTC/NBim8GJMA8f5ZjVMGApSwL/O58fUvIOmY89s GgxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Y2Xem8SdhbOHw1O8lLc55XhOEWksMnTAZb/k8Pfou8E=; b=yM73gFyS+evSVr0Qe9RwuJzX1MXA3YMXfk/vOYoFrrYaQQV/iQYu50+QAIYR2wzv5G +jRC2aB6tWn/Jn8+oeDi3PLd+qYcBCZtGRMcuclSkZve8Zhz+E7r9PzrXtkNpHquGZaG mGqunDjSBmzqlcqcsjI272mMmIF6AAkTYOgjnr630t4VvoLLAr2yzcG/t9aEv3F9aEsA X3Mb+vRQfI66DMesuScucENX+ak/x2T5TQPqnB4ZwXyK4xpOpDRkEC4f+YtdGfUrVUxf 14hRUIguxlu4ADmAZwO7Gwg4KP4NwH2DlepN7cCzspONxmBE6er2wXaiorQ2353e7/pY qPFQ== 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 l20si7801563pff.297.2018.04.06.07.12.59; Fri, 06 Apr 2018 07:13:14 -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 S1756274AbeDFNkP (ORCPT + 99 others); Fri, 6 Apr 2018 09:40:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35394 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbeDFNkL (ORCPT ); Fri, 6 Apr 2018 09:40:11 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E7B98D9A; Fri, 6 Apr 2018 13:40:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Brugger , "David S. Miller" , Ben Hutchings Subject: [PATCH 4.14 62/67] net: hns: Fix ethtool private flags Date: Fri, 6 Apr 2018 15:24:32 +0200 Message-Id: <20180406084348.531497295@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084341.225558262@linuxfoundation.org> References: <20180406084341.225558262@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthias Brugger commit d61d263c8d82db7c4404a29ebc29674b1c0c05c9 upstream. The driver implementation returns support for private flags, while no private flags are present. When asked for the number of private flags it returns the number of statistic flag names. Fix this by returning EOPNOTSUPP for not implemented ethtool flags. Signed-off-by: Matthias Brugger Signed-off-by: David S. Miller Cc: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 2 +- drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c | 2 +- drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 2 +- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c @@ -666,7 +666,7 @@ static void hns_gmac_get_strings(u32 str static int hns_gmac_get_sset_count(int stringset) { - if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS) + if (stringset == ETH_SS_STATS) return ARRAY_SIZE(g_gmac_stats_string); return 0; --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c @@ -422,7 +422,7 @@ void hns_ppe_update_stats(struct hns_ppe int hns_ppe_get_sset_count(int stringset) { - if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS) + if (stringset == ETH_SS_STATS) return ETH_PPE_STATIC_NUM; return 0; } --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c @@ -876,7 +876,7 @@ void hns_rcb_get_stats(struct hnae_queue */ int hns_rcb_get_ring_sset_count(int stringset) { - if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS) + if (stringset == ETH_SS_STATS) return HNS_RING_STATIC_REG_NUM; return 0; --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c @@ -993,8 +993,10 @@ int hns_get_sset_count(struct net_device cnt--; return cnt; - } else { + } else if (stringset == ETH_SS_STATS) { return (HNS_NET_STATS_CNT + ops->get_sset_count(h, stringset)); + } else { + return -EOPNOTSUPP; } }