From: Eric Dumazet Date: Fri, 17 Sep 2010 18:56:18 +0000 (-0700) Subject: ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=67c9660831f6b6b76866a0838466c83765ffbbd3;p=linux-beck.git ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum 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 Signed-off-by: David S. Miller --- diff --git a/net/core/ethtool.c b/net/core/ethtool.c index fcd62757704d..248c25c3e820 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -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