提交 e5a4a72d 编写于 作者: L Lennert Buytenhek 提交者: David S. Miller

net: use software GSO for SG+CSUM capable netdevices

If a netdevice does not support hardware GSO, allowing the stack to
use GSO anyway and then splitting the GSO skb into MSS-sized pieces
as it is handed to the netdevice for transmitting is likely still
a win as far as throughput and/or CPU usage are concerned, since it
reduces the number of trips through the output path.

This patch enables the use of GSO on any netdevice that supports SG.
If a GSO skb is then sent to a netdevice that supports SG but does not
support hardware GSO, net/core/dev.c:dev_hard_start_xmit() will take
care of doing the necessary GSO segmentation in software.
Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 745e2031
...@@ -3988,6 +3988,10 @@ int register_netdevice(struct net_device *dev) ...@@ -3988,6 +3988,10 @@ int register_netdevice(struct net_device *dev)
} }
} }
/* Enable software GSO if SG is supported. */
if (dev->features & NETIF_F_SG)
dev->features |= NETIF_F_GSO;
netdev_initialize_kobject(dev); netdev_initialize_kobject(dev);
ret = netdev_register_kobject(dev); ret = netdev_register_kobject(dev);
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册