From patchwork Tue Mar 30 00:47:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 48923 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 2F12AB7C8E for ; Tue, 30 Mar 2010 11:54:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754970Ab0C3AyL (ORCPT ); Mon, 29 Mar 2010 20:54:11 -0400 Received: from mail.vyatta.com ([76.74.103.46]:48933 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754881Ab0C3AyK (ORCPT ); Mon, 29 Mar 2010 20:54:10 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vyatta.com (Postfix) with ESMTP id 170F94F427C; Mon, 29 Mar 2010 17:54:05 -0700 (PDT) X-Virus-Scanned: amavisd-new at tahiti.vyatta.com Received: from mail.vyatta.com ([127.0.0.1]) by localhost (mail.vyatta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B8TxTVRQeYuG; Mon, 29 Mar 2010 17:54:04 -0700 (PDT) Received: from nehalam (unknown [10.250.0.103]) by mail.vyatta.com (Postfix) with ESMTP id 58C9B4F4283; Mon, 29 Mar 2010 17:54:04 -0700 (PDT) Date: Mon, 29 Mar 2010 17:47:27 -0700 From: Stephen Hemminger To: David Miller Cc: netdev@vger.kernel.org Subject: [PATCH 1/2] netdev: ethtool RXHASH flag Message-ID: <20100329174727.4654e19c@nehalam> In-Reply-To: <20100328154448.701c89ee@nehalam> References: <20100328154448.701c89ee@nehalam> Organization: Vyatta X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This adds ethtool and device feature flag to allow control of receive hashing offload. Signed-off-by: Stephen Hemminger Acked-by: Jeff Garzik --- Supersedes earlier patch, decided to call it RXHASH not RSS since we don't care about other vendors acronyms -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/include/linux/ethtool.h 2010-03-28 14:09:58.611267016 -0700 +++ b/include/linux/ethtool.h 2010-03-28 14:19:45.032516128 -0700 @@ -310,6 +310,7 @@ struct ethtool_perm_addr { enum ethtool_flags { ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ + ETH_FLAG_RXHASH = (1 << 28), }; /* The following structures are for supporting RX network flow --- a/include/linux/netdevice.h 2010-03-28 14:12:13.092517615 -0700 +++ b/include/linux/netdevice.h 2010-03-28 14:13:47.232915349 -0700 @@ -785,6 +785,7 @@ struct net_device { #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ +#define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */ /* Segmentation offload features */ #define NETIF_F_GSO_SHIFT 16 --- a/net/core/ethtool.c 2010-03-28 14:12:25.012207457 -0700 +++ b/net/core/ethtool.c 2010-03-28 14:19:41.548521569 -0700 @@ -121,7 +121,7 @@ int ethtool_op_set_ufo(struct net_device * NETIF_F_xxx values in include/linux/netdevice.h */ static const u32 flags_dup_features = - (ETH_FLAG_LRO | ETH_FLAG_NTUPLE); + (ETH_FLAG_LRO | ETH_FLAG_NTUPLE | ETH_FLAG_RXHASH); u32 ethtool_op_get_flags(struct net_device *dev) { @@ -152,6 +152,11 @@ int ethtool_op_set_flags(struct net_devi features &= ~NETIF_F_NTUPLE; } + if (data & ETH_FLAG_RXHASH) + features |= NETIF_F_RXHASH; + else + features &= ~NETIF_F_RXHASH; + dev->features = features; return 0; }