Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp897471ybh; Thu, 12 Mar 2020 13:08:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvcKZACTkm4/mMypONZkVda+/69rxXn5MMD02DhPipG//k8LMi8lVLAVBOciAJh2jIZyjtb X-Received: by 2002:a9d:bf7:: with SMTP id 110mr8246999oth.259.1584043704916; Thu, 12 Mar 2020 13:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584043704; cv=none; d=google.com; s=arc-20160816; b=oh2pyWU1StWJGk/wQ1ysVBJrm6F52AWau3tJcbqiTO3FjByzucriOn8ur2l3EHoJ8g iVpnuEuVB1MtXUVRyFL/2OitYwE+l7cVO8p5BSaVxO91tNYNLoFax9cj3jueKx0sE4y2 qyHS8dLyZu7IXcl3mij/DUw/mVLU/NL1ISrXRkzukAoonY0lW5F83U3+h+SK3RR2/p0J CWcJd8UNfsmqK2YeAVRX5AFK9OOUkQUMOHbVjXG8lHESd6HUObsHeGzuWctGbo/pt15o OmlnJmcMn5l75P8Rs3wGX0HjLK6x/ROg519sNckH8M6cRGUuMxHvnltnpUGpebrVfTGC mZ+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id; bh=0OLti8kz6yqNBPY13uzMXHXED2Tui6cO8gS0ZTeURBo=; b=ji1yFML18etf7gaPuD5UpejVRx7Sh2kg9L9OQU7kOLhCrH8/ye+xHtPdOKjzPNYZAd fQ5Vs0vsiJpLPGIRp4PUGKAxUUu4np1tbq8rUXXKnDPS7LqmwxGIlhCP2sTAfmNSd9ye zucS+F7FiTKg/yxcpEg0JuABxa1QbSmgTqNveRlBj8A+v5mT52iekxWNOjMDymcgwWrX eutr21eVIaS18IJNqBmOP01gbmuVg6Vix0uxeV2Sa6Nx+XkpP+/9OIkT4FPuUnUfF0Yk Ba3TW8c4eYZ+odJ7DTyqmiw0lkcImWC8w9D+SSt9Tk2pjwACXX4q/i1+fxYf2MFUguqC ueDA== 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 s199si3242076oih.169.2020.03.12.13.08.13; Thu, 12 Mar 2020 13:08: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 S1727074AbgCLUHr (ORCPT + 99 others); Thu, 12 Mar 2020 16:07:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:45110 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727059AbgCLUHp (ORCPT ); Thu, 12 Mar 2020 16:07:45 -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 C3C0FAC52; Thu, 12 Mar 2020 20:07:43 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 757EFE0C79; Thu, 12 Mar 2020 21:07:43 +0100 (CET) Message-Id: <0c49efc15415f6fc2cba940d34495c52cb3e6532.1584043144.git.mkubecek@suse.cz> In-Reply-To: References: From: Michal Kubecek Subject: [PATCH net-next v2 02/15] ethtool: update mapping of features to legacy ioctl requests To: David Miller , Jakub Kicinski , netdev@vger.kernel.org Cc: Jiri Pirko , Andrew Lunn , Florian Fainelli , John Linville , Johannes Berg , linux-kernel@vger.kernel.org Date: Thu, 12 Mar 2020 21:07:43 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Legacy ioctl request like ETHTOOL_GTXCSUM are still used by ethtool utility to get values of legacy flags (which rather work as feature groups). These are calculated from values of actual features and request to set them is implemented as an attempt to set all features mapping to them but there are two inconsistencies: - tx-checksum-fcoe-crc is shown under tx-checksumming but NETIF_F_FCOE_CRC is not included in ETHTOOL_GTXCSUM/ETHTOOL_STXCSUM - tx-scatter-gather-fraglist is shown under scatter-gather but NETIF_F_FRAGLIST is not included in ETHTOOL_GSG/ETHTOOL_SSG As the mapping in ethtool output is more correct from logical point of view, fix ethtool_get_feature_mask() to match it. Signed-off-by: Michal Kubecek --- net/ethtool/ioctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index b2684ffa26de..ae97c82c7052 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -198,13 +198,14 @@ static netdev_features_t ethtool_get_feature_mask(u32 eth_cmd) switch (eth_cmd) { case ETHTOOL_GTXCSUM: case ETHTOOL_STXCSUM: - return NETIF_F_CSUM_MASK | NETIF_F_SCTP_CRC; + return NETIF_F_CSUM_MASK | NETIF_F_FCOE_CRC_BIT | + NETIF_F_SCTP_CRC; case ETHTOOL_GRXCSUM: case ETHTOOL_SRXCSUM: return NETIF_F_RXCSUM; case ETHTOOL_GSG: case ETHTOOL_SSG: - return NETIF_F_SG; + return NETIF_F_SG | NETIF_F_FRAGLIST; case ETHTOOL_GTSO: case ETHTOOL_STSO: return NETIF_F_ALL_TSO; -- 2.25.1