From patchwork Sun Apr 26 14:36:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Vadai X-Patchwork-Id: 464689 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2B00E140083 for ; Mon, 27 Apr 2015 00:36:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752215AbbDZOgo (ORCPT ); Sun, 26 Apr 2015 10:36:44 -0400 Received: from ns1327.ztomy.com ([193.47.165.129]:50993 "EHLO mellanox.co.il" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751335AbbDZOgn (ORCPT ); Sun, 26 Apr 2015 10:36:43 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from amirv@mellanox.com) with ESMTPS (AES256-SHA encrypted); 26 Apr 2015 17:36:18 +0300 Received: from swl095.mtl.labs.mlnx (swl095.mtl.labs.mlnx [10.7.17.95]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t3QEaKnf024958; Sun, 26 Apr 2015 17:36:21 +0300 From: Amir Vadai To: "David S. Miller" Cc: netdev@vger.kernel.org, Or Gerlitz , Tal Alon , Ben Hutchings , Amir Vadai Subject: [PATCH net 1/2] ethtool: Use values instead of bit flags for RSS hash function Date: Sun, 26 Apr 2015 17:36:05 +0300 Message-Id: <1430058966-24046-2-git-send-email-amirv@mellanox.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1430058966-24046-1-git-send-email-amirv@mellanox.com> References: <1430058966-24046-1-git-send-email-amirv@mellanox.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The RX indirection hash function is eight bits. Using more than one hash function doesn't make sense, therefore using this field as a value instead of a bit flag. Moving from bit flags into value shouldn't introduce any backward compatibility issues, since currently there are only 2 functions, therfore the actual value in the field hfunc is the same like before 1 for Toeplitz and 2 for XOR. Fixes: 892311f ("ethtool: Support for configurable RSS hash function") Signed-off-by: Amir Vadai --- include/linux/ethtool.h | 9 ++------- net/core/ethtool.c | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 653dc9c..d19f31a 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -60,8 +60,8 @@ enum ethtool_phys_id_state { }; enum { - ETH_RSS_HASH_TOP_BIT, /* Configurable RSS hash function - Toeplitz */ - ETH_RSS_HASH_XOR_BIT, /* Configurable RSS hash function - Xor */ + ETH_RSS_HASH_TOP = 1, /* Configurable RSS hash function - Toeplitz */ + ETH_RSS_HASH_XOR = 2, /* Configurable RSS hash function - Xor */ /* * Add your fresh new hash function bits above and remember to update @@ -70,11 +70,6 @@ enum { ETH_RSS_HASH_FUNCS_COUNT }; -#define __ETH_RSS_HASH_BIT(bit) ((u32)1 << (bit)) -#define __ETH_RSS_HASH(name) __ETH_RSS_HASH_BIT(ETH_RSS_HASH_##name##_BIT) - -#define ETH_RSS_HASH_TOP __ETH_RSS_HASH(TOP) -#define ETH_RSS_HASH_XOR __ETH_RSS_HASH(XOR) #define ETH_RSS_HASH_UNKNOWN 0 #define ETH_RSS_HASH_NO_CHANGE 0 diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 1d00b89..1a1db95 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -103,8 +103,8 @@ static const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] static const char rss_hash_func_strings[ETH_RSS_HASH_FUNCS_COUNT][ETH_GSTRING_LEN] = { - [ETH_RSS_HASH_TOP_BIT] = "toeplitz", - [ETH_RSS_HASH_XOR_BIT] = "xor", + [ETH_RSS_HASH_TOP] = "toeplitz", + [ETH_RSS_HASH_XOR] = "xor", }; static int ethtool_get_features(struct net_device *dev, void __user *useraddr)