Skip to content

Commit

Permalink
ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum
Browse files Browse the repository at this point in the history
To be able to switch on GRO on a device, ethtool_set_gro() checks this
device provides a get_rx_csum() method.

Some devices dont provide this method, while they do support RX
checksumming.

This patch allows bonding to support GRO :

ethtool -K bond0 gro on

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 17, 2010
1 parent 457e9d2 commit 67c9660
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/core/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,11 @@ static int ethtool_set_gro(struct net_device *dev, char __user *useraddr)
return -EFAULT;

if (edata.data) {
if (!dev->ethtool_ops->get_rx_csum ||
!dev->ethtool_ops->get_rx_csum(dev))
u32 rxcsum = dev->ethtool_ops->get_rx_csum ?
dev->ethtool_ops->get_rx_csum(dev) :
ethtool_op_get_rx_csum(dev);

if (!rxcsum)
return -EINVAL;
dev->features |= NETIF_F_GRO;
} else
Expand Down

0 comments on commit 67c9660

Please sign in to comment.