svn commit: r275274 - stable/10/sys/dev/virtio/network

Bryan Venteicher bryanv at FreeBSD.org
Sat Nov 29 23:05:02 UTC 2014


Author: bryanv
Date: Sat Nov 29 23:05:01 2014
New Revision: 275274
URL: https://svnweb.freebsd.org/changeset/base/275274

Log:
  MFC r274325:
  
    Enable LRO by default when available on vtnet interfaces
  
    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.

Modified:
  stable/10/sys/dev/virtio/network/if_vtnet.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- stable/10/sys/dev/virtio/network/if_vtnet.c	Sat Nov 29 22:48:40 2014	(r275273)
+++ stable/10/sys/dev/virtio/network/if_vtnet.c	Sat Nov 29 23:05:01 2014	(r275274)
@@ -967,9 +967,14 @@ vtnet_setup_interface(struct vtnet_softc
 			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
 	 * 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;
 


More information about the svn-src-all mailing list