Skip to content

Commit

Permalink
net: use software GSO for SG+CSUM capable netdevices
Browse files Browse the repository at this point in the history
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: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lennert Buytenhek authored and David S. Miller committed Aug 3, 2008
1 parent 745e203 commit e5a4a72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
ret = netdev_register_kobject(dev);
if (ret)
Expand Down

0 comments on commit e5a4a72

Please sign in to comment.