Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp815214ybt; Wed, 17 Jun 2020 14:56:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiLQ0rXy17dXFCN/58fLi7jqUumnP2uB0Uex/dDw19/A01mEBMna63amA9N7JwsyVkd6gI X-Received: by 2002:aa7:c403:: with SMTP id j3mr1209320edq.294.1592431010287; Wed, 17 Jun 2020 14:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592431010; cv=none; d=google.com; s=arc-20160816; b=kouxlm9dE3uQJR8NUwVwGnmlAcZX7zHe2+11wjHPiJOnzaz09zoP5HsecX2si9owjv 89kVZw4YH68ixeEUyX/1s0Ow2W0mS2nHnOuy3j02rxgx0fpSpXmwTHhnicstTRwACkDL 2wlGUaYd6ycC3ZSTwV7lgWbMDuj9eqSssWdbqcGdRCzbOcXQJ+cckhU5VPCPxeamBzLp eFcyUGlzqV9YK3aZDbEihol2wx3psHZdJ5g2adY9THHhckJd/Tu7I3p1b+iCgb3MxMwb XKo74XqX7EnOyCUNPoz6oOqsU4CQVRFlT8eQ/NTa2JDjS7jY/i9qasMdAGS8My3xBkvv bWpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=VrvgV++RDuqqBbD7iPvfpAnsuTof9rzraLq1Z8Ax27Y=; b=jG1GIZchg/1KO/9CNd58XvEt6gk9z1f7DeATK0quBFmk+xgqdc2sx1ra6HwYwvTVjO li/FhKa/D08xrpnYTbAEY2fhW/2Kuf5HdFKa3K3qdKr3sPkYuV2AfoOPzIQyhHYxEp7U r04TugYo+th8PRRZsgAGrSuwpzzN5sNjlm0GU+4nK5/2GEnTwB2PKxp1SkDjMfOkXyL8 xCDTitEGYXi9XbOrGiExBZut3vbIFYRpLnSAEfMFKNlqLFZ71TdU5vvEcc32Ejx0O0S1 jh0oA9GDoGgTCJm1AKeMBcyPbUOacnVpkptEEotu2mpv8jzzkIQYtVV0l6fJba/7iwr/ gr2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x15si712269edq.90.2020.06.17.14.56.27; Wed, 17 Jun 2020 14:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726998AbgFQVyW (ORCPT + 99 others); Wed, 17 Jun 2020 17:54:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:60762 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbgFQVyW (ORCPT ); Wed, 17 Jun 2020 17:54:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 95581ABE4; Wed, 17 Jun 2020 21:54:22 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 07DD4602E9; Wed, 17 Jun 2020 23:54:17 +0200 (CEST) Date: Wed, 17 Jun 2020 23:54:17 +0200 From: Michal Kubecek To: Alexander Lobakin Cc: "David S. Miller" , Jakub Kicinski , Andrew Lunn , Florian Fainelli , Richard Cochran , Antoine Tenart , Aya Levin , Steffen Klassert , Willem de Bruijn , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH resend net] net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string Message-ID: <20200617215417.kx3fz2jw3qijqz7p@lion.mk-sys.cz> References: <9oPfKdiVuoDf251VBJXgNs-Hv-HWPnIJk52x-SQc1frfg8QSf9z3rCL-CBSafkp9SO0CjNzU8QvUv9Abe4SvoUpejeob9OImDPbflzRC-0Y=@pm.me> <20200617211844.kupsyijuurjpb5kd@lion.mk-sys.cz> <5u_BsHq6Jk0q09sGWsVKfvv0NRa5kBHjxdOr9VpNknRnxHpbRO_80JSHl_AWS-C_wBS7B15KetRleLaluF8tOysTNYyLVRUG4BRFQZxnhXw=@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5u_BsHq6Jk0q09sGWsVKfvv0NRa5kBHjxdOr9VpNknRnxHpbRO_80JSHl_AWS-C_wBS7B15KetRleLaluF8tOysTNYyLVRUG4BRFQZxnhXw=@pm.me> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 17, 2020 at 09:38:47PM +0000, Alexander Lobakin wrote: > Hi Michal, > > On Thursday, 18 June 2020, 0:18, Michal Kubecek wrote: > > > On Wed, Jun 17, 2020 at 08:42:47PM +0000, Alexander Lobakin wrote: > > > > > Commit 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") missed > > > an entry for NETIF_F_GSO_FRAGLIST in netdev_features_strings array. As > > > a result, fraglist GSO feature is not shown in 'ethtool -k' output and > > > can't be toggled on/off. > > > The fix is trivial. > > > > > > Fixes: 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") > > > Signed-off-by: Alexander Lobakin alobakin@pm.me > > > > > > ---------------------------------------------------------------------------------------------------------------- > > > > > > net/ethtool/common.c | 1 + > > > 1 file changed, 1 insertion(+) > > > diff --git a/net/ethtool/common.c b/net/ethtool/common.c > > > index 423e640e3876..47f63526818e 100644 > > > --- a/net/ethtool/common.c > > > +++ b/net/ethtool/common.c > > > @@ -43,6 +43,7 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = { > > > [NETIF_F_GSO_SCTP_BIT] = "tx-sctp-segmentation", > > > [NETIF_F_GSO_ESP_BIT] = "tx-esp-segmentation", > > > [NETIF_F_GSO_UDP_L4_BIT] = "tx-udp-segmentation", > > > > > > - [NETIF_F_GSO_FRAGLIST_BIT] = "tx-gso-list", > > > [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc", > > > [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp", > > > > > > > Reviewed-by: Michal Kubecekmkubecek@suse.cz > > Thanks! > > > AFAICS the name for NETIF_F_GSO_TUNNEL_REMCSUM_BIT is also missing but > > IMHO it will be better to fix that by a separate patch with its own > > Fixes tag. > > Oh, nice catch! I'll make a separate for this one. > I also wanted to add any sort of static_assert() / BUILD_BUG_ON() to > prevent such misses, but don't see any easy pattern to check for now, > as netdev_features_strings[] is always NETDEV_FEATURE_COUNT-sized. The key problem is that unlike e.g. link modes, new netdev features are not always added at the end. So even if we changed netdev_features_strings[] array to have size determined automatically from initializers, adding new netdev feature somewhere in the middle (e.g. GSO one) without updating netdev_features_strings[] would not be caught as simple array size check would not notice the hole (actually, there are also two intended holes in the array). Michal