diff mbox

[-next] sfc: set/clear NETIF_F_RXHASH bit directly

Message ID 20100629163520.642590bf@dhcp-lab-109.englab.brq.redhat.com
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Stanislaw Gruszka June 29, 2010, 2:35 p.m. UTC
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/sfc/ethtool.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

Comments

Ben Hutchings June 29, 2010, 2:43 p.m. UTC | #1
On Tue, 2010-06-29 at 16:35 +0200, Stanislaw Gruszka wrote:
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
[...]

I don't think this is a positive change.

Please change ethtool_op_set_flags; then in efx_ethtool_set_flags() you
can do:

-	if (data & ~supported)
- 		return -EOPNOTSUPP;
- 
-	return ethtool_op_set_flags(net_dev, data);
+	return ethtool_op_set_flags(net_dev, data, supported);

Ben.
diff mbox

Patch

diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 7693cfb..fd55123 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -554,7 +554,12 @@  static int efx_ethtool_set_flags(struct net_device *net_dev, u32 data)
 	if (data & ~supported)
 		return -EOPNOTSUPP;
 
-	return ethtool_op_set_flags(net_dev, data);
+	if (data & ETH_FLAG_RXHASH)
+		net_dev->features |= NETIF_F_RXHASH;
+	else
+		net_dev->features &= ~NETIF_F_RXHASH;
+
+	return 0;
 }
 
 static void efx_ethtool_self_test(struct net_device *net_dev,