Received: by 10.213.65.68 with SMTP id h4csp704019imn; Fri, 6 Apr 2018 07:33:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx48+pIzVWUbDQwLQKk2sligKOjE0uMrojrzH11+vFW5CBH9EkA0vmr9dVp4ANX1eK+RAcvrq X-Received: by 10.99.0.136 with SMTP id 130mr17555823pga.368.1523025204076; Fri, 06 Apr 2018 07:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523025204; cv=none; d=google.com; s=arc-20160816; b=XL8UGUoIoAqksBKMgAxYWkEGOf+iEub5BZDJk6wTp57loVFWWniZoF5oBFontC/AvF ZAmWDb/AS4wNFM+Wq7fR7HHYkSVTMSkFNhF+lBjjeb4NdEg30JeQfeZZqGEH62jIVG/A eG5zVTgcVPsyYrQI0O/1Jo8d+GvenyaoxdqnWdFCzHXmeef4smXh4wr1aFEfYGMQtNxC 7jMKHwpppXLsf3EY7rjBF/2GL2Srg++JD3lAwreC/yYMELmwqssc5vkmDbY88vgGq2Vz Cni/IeHXVZXwD6BCnxXVrV3W4u/k1lhBHbm0cycO06snFsuvxAtwThoAcOAGz0sQ5SLv Dbog== 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=wVArdynoP9yFfuhAbJWa9BdakJRtPdGubgEN6XppNsc=; b=T/5LPd3brM8x1UyPVkRNOrXl6Ig44YswcXp3NXq/FD+OTFj/lJ/SIItz4lUKytE0n2 +nF2eU6uMrvVaYerurSwBz+Pu8XodasFSBOZDGjvDIbdrLMrQ+3YO7FAJuc8TALDtqPv /dRKoLaGOx0a5887LSYXQJfAizyufVFDL45QxGyRbUcMBNVxYtPHurQnG7BodJkoVRDm e4yEx3zC6/HmCJqApMjHXlP1iUfzGYnt+jD7X0RUaAl8LrhsiKd+xYwHXFn1Ofy0ZmTr BU/A7lTbB9OtBx1VluM6CL+fzyc7oP5GkGFMjL+BdrMuXCqaoTag1qfEIlYrOp3GL4qD bZcw== 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 3-v6si8581964plo.475.2018.04.06.07.32.58; Fri, 06 Apr 2018 07:33:24 -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 S932136AbeDFNgy (ORCPT + 99 others); Fri, 6 Apr 2018 09:36:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60002 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755920AbeDFNgw (ORCPT ); Fri, 6 Apr 2018 09:36:52 -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 676DF97A; Fri, 6 Apr 2018 13:36:42 +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.9 095/102] net: hns: Fix ethtool private flags Date: Fri, 6 Apr 2018 15:24:16 +0200 Message-Id: <20180406084344.802126735@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@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.9-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 @@ -671,7 +671,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 @@ -798,7 +798,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 @@ -1017,8 +1017,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; } }