diff mbox

[1/2] netdev: ethtool RXHASH flag

Message ID 20100329174727.4654e19c@nehalam
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger March 30, 2010, 12:47 a.m. UTC
This adds ethtool and device feature flag to allow control
of receive hashing offload.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
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

Comments

Jeff Garzik March 30, 2010, 5:19 p.m. UTC | #1
On 03/29/2010 08:47 PM, Stephen Hemminger wrote:
> 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>


--
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
David Miller March 31, 2010, 6:52 a.m. UTC | #2
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 29 Mar 2010 17:47:27 -0700

> This adds ethtool and device feature flag to allow control
> of receive hashing offload.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> ---
> Supersedes earlier patch, decided to call it RXHASH not RSS since
> we don't care about other vendors acronyms

Ah, now I understand, ignore my other email.

Applied, thanks everyone.
--
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
diff mbox

Patch

--- 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;
 }