aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-03-29 10:47:27 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-31 02:51:08 -0400
commitb00fabb4020d17bda4bea59507e09fadf573088d (patch)
treedb746ff4c223cc5ba98927d9f9421285952c7231
parent757b77e2b208490868cf21fd22d796eb9bd199c5 (diff)
netdev: ethtool RXHASH flag
This adds ethtool and device feature flag to allow control of receive hashing offload. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/ethtool.h1
-rw-r--r--include/linux/netdevice.h1
-rw-r--r--net/core/ethtool.c7
3 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index b33f316bb92e..b391969a0dd9 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -310,6 +310,7 @@ struct ethtool_perm_addr {
310enum ethtool_flags { 310enum ethtool_flags {
311 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ 311 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
312 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ 312 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
313 ETH_FLAG_RXHASH = (1 << 28),
313}; 314};
314 315
315/* The following structures are for supporting RX network flow 316/* The following structures are for supporting RX network flow
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 53c272f2a734..b5670ab5107c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -785,6 +785,7 @@ struct net_device {
785#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ 785#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */
786#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ 786#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
787#define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ 787#define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */
788#define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */
788 789
789 /* Segmentation offload features */ 790 /* Segmentation offload features */
790#define NETIF_F_GSO_SHIFT 16 791#define NETIF_F_GSO_SHIFT 16
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index f4cb6b6299d9..73c81edde8d9 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -121,7 +121,7 @@ int ethtool_op_set_ufo(struct net_device *dev, u32 data)
121 * NETIF_F_xxx values in include/linux/netdevice.h 121 * NETIF_F_xxx values in include/linux/netdevice.h
122 */ 122 */
123static const u32 flags_dup_features = 123static const u32 flags_dup_features =
124 (ETH_FLAG_LRO | ETH_FLAG_NTUPLE); 124 (ETH_FLAG_LRO | ETH_FLAG_NTUPLE | ETH_FLAG_RXHASH);
125 125
126u32 ethtool_op_get_flags(struct net_device *dev) 126u32 ethtool_op_get_flags(struct net_device *dev)
127{ 127{
@@ -152,6 +152,11 @@ int ethtool_op_set_flags(struct net_device *dev, u32 data)
152 features &= ~NETIF_F_NTUPLE; 152 features &= ~NETIF_F_NTUPLE;
153 } 153 }
154 154
155 if (data & ETH_FLAG_RXHASH)
156 features |= NETIF_F_RXHASH;
157 else
158 features &= ~NETIF_F_RXHASH;
159
155 dev->features = features; 160 dev->features = features;
156 return 0; 161 return 0;
157} 162}