]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Enable LRO by default when available on vtnet interfaces
authorbryanv <bryanv@FreeBSD.org>
Sun, 9 Nov 2014 20:04:12 +0000 (20:04 +0000)
committerbryanv <bryanv@FreeBSD.org>
Sun, 9 Nov 2014 20:04:12 +0000 (20:04 +0000)
The prior change to not enable LRO by default has confused several
people. The configurations where LRO is problematic is not the
typical use case for VirtIO, and due to other issues, this often
requires checksum offloading to be disabled anyways.

PR: 185864
MFC after: 2 weeks

sys/dev/virtio/network/if_vtnet.c

index 1310f30bc239f60f1b3db87e3432b24eaeff41a7..83cb2d79fe25c77220a1b8d9306734b2c94cc7c0 100644 (file)
@@ -967,9 +967,14 @@ vtnet_setup_interface(struct vtnet_softc *sc)
                        ifp->if_capabilities |= IFCAP_VLAN_HWTSO;
        }
 
-       if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_CSUM))
+       if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_CSUM)) {
                ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6;
 
+               if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_TSO4) ||
+                   virtio_with_feature(dev, VIRTIO_NET_F_GUEST_TSO6))
+                       ifp->if_capabilities |= IFCAP_LRO;
+       }
+
        if (ifp->if_capabilities & IFCAP_HWCSUM) {
                /*
                 * VirtIO does not support VLAN tagging, but we can fake
@@ -987,12 +992,6 @@ vtnet_setup_interface(struct vtnet_softc *sc)
         * Capabilities after here are not enabled by default.
         */
 
-       if (ifp->if_capabilities & IFCAP_RXCSUM) {
-               if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_TSO4) ||
-                   virtio_with_feature(dev, VIRTIO_NET_F_GUEST_TSO6))
-                       ifp->if_capabilities |= IFCAP_LRO;
-       }
-
        if (sc->vtnet_flags & VTNET_FLAG_VLAN_FILTER) {
                ifp->if_capabilities |= IFCAP_VLAN_HWFILTER;