Skip to content

Commit e2a6b85

Browse files
herbertxdavem330
authored andcommitted
net: Enable TSO if supported by at least one device
As it stands users of netdev_compute_features (e.g., bridges/bonding) will only enable TSO if all consituent devices support it. This is unnecessarily pessimistic since even on devices that do not support hardware TSO and SG, emulated TSO still performs to a par with TSO off. This patch enables TSO if at least on constituent device supports it in hardware. The direct beneficiaries will be virtualisation that uses bridging since this means that TSO will always be enabled for communication from the host to the guests. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a505f4f commit e2a6b85

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/core/dev.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4663,6 +4663,12 @@ int netdev_compute_features(unsigned long all, unsigned long one)
46634663
one |= NETIF_F_GSO_SOFTWARE;
46644664
one |= NETIF_F_GSO;
46654665

4666+
/*
4667+
* If even one device supports a GSO protocol with software fallback,
4668+
* enable it for all.
4669+
*/
4670+
all |= one & NETIF_F_GSO_SOFTWARE;
4671+
46664672
/* If even one device supports robust GSO, enable it for all. */
46674673
if (one & NETIF_F_GSO_ROBUST)
46684674
all |= NETIF_F_GSO_ROBUST;

0 commit comments

Comments
 (0)