提交 67c96608 编写于 作者: E Eric Dumazet 提交者: David S. Miller

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: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 457e9d22
...@@ -1181,8 +1181,11 @@ static int ethtool_set_gro(struct net_device *dev, char __user *useraddr) ...@@ -1181,8 +1181,11 @@ static int ethtool_set_gro(struct net_device *dev, char __user *useraddr)
return -EFAULT; return -EFAULT;
if (edata.data) { if (edata.data) {
if (!dev->ethtool_ops->get_rx_csum || u32 rxcsum = dev->ethtool_ops->get_rx_csum ?
!dev->ethtool_ops->get_rx_csum(dev)) dev->ethtool_ops->get_rx_csum(dev) :
ethtool_op_get_rx_csum(dev);
if (!rxcsum)
return -EINVAL; return -EINVAL;
dev->features |= NETIF_F_GRO; dev->features |= NETIF_F_GRO;
} else } else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册