netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] netdev: add support for Receive Side Scaling hash control
@ 2010-03-28 22:44 Stephen Hemminger
  2010-03-28 22:47 ` [PATCH 2/2] ethtool: add RSS command flag Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Stephen Hemminger @ 2010-03-28 22:44 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

This adds ethtool and device feature flag to allow control
of Receive Side Scaling hashing supported by many modern
controllers.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
I am working on RSS for sky2 device, but the hardware isn't fully cooperating
but thought others might want to use same API.

--- 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_RSS		= (1 << 28),	/* RSS is enabled */
 };
 
 /* 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_RSS		(1 << 28) /* Receive Side Scaling hash */
 
 	/* 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_RSS);
 
 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_RSS)
+		features |= NETIF_F_RSS;
+	else
+		features &= ~NETIF_F_RSS;
+
 	dev->features = features;
 	return 0;
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-03-31  6:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-28 22:44 [PATCH 1/2] netdev: add support for Receive Side Scaling hash control Stephen Hemminger
2010-03-28 22:47 ` [PATCH 2/2] ethtool: add RSS command flag Stephen Hemminger
2010-03-30  0:47 ` [PATCH 1/2] netdev: ethtool RXHASH flag Stephen Hemminger
2010-03-30  0:53   ` [PATCH 2/2] ethtool: RXHASH flag support Stephen Hemminger
2010-03-30 17:29     ` Jeff Garzik
2010-03-30 17:32       ` Stephen Hemminger
2010-03-30 17:37         ` Jeff Garzik
2010-03-30 21:05           ` Stephen Hemminger
2010-03-30 21:08             ` Jeff Garzik
2010-03-30 21:31               ` Stephen Hemminger
2010-03-30 22:58                 ` Jeff Garzik
2010-03-30 17:19   ` [PATCH 1/2] netdev: ethtool RXHASH flag Jeff Garzik
2010-03-31  6:52   ` David Miller
2010-03-31  6:52 ` [PATCH 1/2] netdev: add support for Receive Side Scaling hash control David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).