aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-09-17 14:56:18 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-17 14:56:18 -0400
commit67c9660831f6b6b76866a0838466c83765ffbbd3 (patch)
treedd3052a219d46b5f565efd30e6e54437340847ba
parent457e9d2233bdde5bb5577df3e2d4d48f84c67b66 (diff)
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 <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/ethtool.c7
1 files changed, 5 insertions, 2 deletions
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)
1181 return -EFAULT; 1181 return -EFAULT;
1182 1182
1183 if (edata.data) { 1183 if (edata.data) {
1184 if (!dev->ethtool_ops->get_rx_csum || 1184 u32 rxcsum = dev->ethtool_ops->get_rx_csum ?
1185 !dev->ethtool_ops->get_rx_csum(dev)) 1185 dev->ethtool_ops->get_rx_csum(dev) :
1186 ethtool_op_get_rx_csum(dev);
1187
1188 if (!rxcsum)
1186 return -EINVAL; 1189 return -EINVAL;
1187 dev->features |= NETIF_F_GRO; 1190 dev->features |= NETIF_F_GRO;
1188 } else 1191 } else