From: Herbert Xu <herbert.xu@redhat.com> Date: Thu, 11 Sep 2008 11:04:15 +1000 Subject: [net] enable TSO if supported by at least one device Message-id: 20080911010415.GA17094@gondor.apana.org.au O-Subject: [RHEL5.3 PATCH] net: Enable TSO if supported by at least one device Bugzilla: 461866 RH-Acked-by: Mark McLoughlin <markmc@redhat.com> RH-Acked-by: David Miller <davem@redhat.com> Hi: RHEL5.3 BZ 461866 This patch is needed to allow virtio to push TSO traffic from a RHEL-5 host to its guests even when the physical NIC does not support TSO. Accepted by davem for 2.6.28 upstraem. 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 <herbert@gondor.apana.org.au> diff --git a/net/core/dev.c b/net/core/dev.c index 489d044..7cb219c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3576,6 +3576,12 @@ int netdev_compute_features(unsigned long all, unsigned long one) one |= NETIF_F_GSO_SOFTWARE; 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 (one & NETIF_F_GSO_ROBUST) all |= NETIF_F_GSO_ROBUST;