Received: by 10.213.65.68 with SMTP id h4csp661874imn; Fri, 6 Apr 2018 06:58:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx48JfbTip+UBIc8QFWAwzPY1HZhnWud7a3mBYeccpuVMIKEOFiY8gEnbrpHYyfN3csUlajip X-Received: by 2002:a17:902:2cc1:: with SMTP id n59-v6mr27967544plb.198.1523023106322; Fri, 06 Apr 2018 06:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523023106; cv=none; d=google.com; s=arc-20160816; b=xoT8TPghOtSb0pNKuRkMhBCSOvLPfu+mrDiDVwXv3iYJItgwBpV7XSxEjy9+bHAYHm dT6Ocqj5HwSrxuh/VWEvFfSbIh+mmxG96V06Yy7CATHPSjsbuQ6tTpmkYoaSvPyLZnDx /Jgkei1xcpbcvUd9uU0TfP3cn8xSbNhACg0Uuj8kXoZon31RdOkp7SslqU701D27cru/ sb9+O5nYgshsAWlZyJyro3v7B5P7THbrP1G5wRxk+0vozSH+xgXRZPXwIQU8Aoa9+FzA +CSK850wWDMOgFKtiVhV1VKLRXumycFjCUIwXEd7zqiq1qErzK4m37ByF6v7nEsGVINV 4Waw== 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=tjsXXLl+5LKRSBaw7V6b5f6OooVln746W2QRbOruJyQ=; b=iSuzyXwZHtY0tO3PFeJkbmhf9aNXaXdesELcESVx3Pb6S4RoDh3/bVAxnYemJIZE/V h8Uz8KoCG4liwHRKtoE4kecHENHi+yBHdSEZ+5W0uqobo+qloDeTPCsRjRtb8iSL0ivM LmZ3UBg58t78VXn+QkP+C+hdAh9ooQlbuTIzV8JaGedM0hwh6Q/7eGvKPmWfJ+ReIaDu lWUChgQF6tLn3FVXzebpRCqGop4RqOw4SkaHUrl18NJD1lfzl0aybNWOkOl6SWVCzOny 5QevFSH9+WWbXSLV6258xxr5frTU7WsWulHXgHynuetBDa0indqPQg9QIOg+NsKPGYI8 e2Ng== 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 8si7973727pfv.115.2018.04.06.06.58.12; Fri, 06 Apr 2018 06:58:26 -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 S1756775AbeDFNnj (ORCPT + 99 others); Fri, 6 Apr 2018 09:43:39 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37362 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756751AbeDFNne (ORCPT ); Fri, 6 Apr 2018 09:43:34 -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 E5D38DFF; Fri, 6 Apr 2018 13:43:33 +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.15 67/72] net: hns: Fix ethtool private flags Date: Fri, 6 Apr 2018 15:24:42 +0200 Message-Id: <20180406084353.884440565@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084349.367583460@linuxfoundation.org> References: <20180406084349.367583460@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.15-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; } }