Commit e2a6b852 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a505f4ff
...@@ -4663,6 +4663,12 @@ int netdev_compute_features(unsigned long all, unsigned long one) ...@@ -4663,6 +4663,12 @@ int netdev_compute_features(unsigned long all, unsigned long one)
one |= NETIF_F_GSO_SOFTWARE; one |= NETIF_F_GSO_SOFTWARE;
one |= NETIF_F_GSO; one |= NETIF_F_GSO;
/*
* If even one device supports a GSO protocol with software fallback,
* enable it for all.
*/
all |= one & NETIF_F_GSO_SOFTWARE;
/* If even one device supports robust GSO, enable it for all. */ /* If even one device supports robust GSO, enable it for all. */
if (one & NETIF_F_GSO_ROBUST) if (one & NETIF_F_GSO_ROBUST)
all |= NETIF_F_GSO_ROBUST; all |= NETIF_F_GSO_ROBUST;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment