svn commit: r285928 - stable/10/sys/dev/hyperv/netvsc

Wei Hu whu at FreeBSD.org
Tue Jul 28 05:46:39 UTC 2015


Author: whu
Date: Tue Jul 28 05:46:37 2015
New Revision: 285928
URL: https://svnweb.freebsd.org/changeset/base/285928

Log:
  MFC r285785 Do not enable UDP checksum offloading when running on the
  Hyper-V on Windows Server 2012 and earlier hosts.
  
  Submitted by: whu
  Reviewed by: royger
  Approved by: royger
  Relnotes: No
  Sponsored by: Microsoft OSTC
  Differential Revision:  https://reviews.freebsd.org/D3217

Modified:
  stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Tue Jul 28 04:54:05 2015	(r285927)
+++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Tue Jul 28 05:46:37 2015	(r285928)
@@ -343,7 +343,15 @@ netvsc_attach(device_t dev)
 	    IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO;
 	ifp->if_capenable |=
 	    IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO;
-	ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO;
+	/*
+	 * Only enable UDP checksum offloading when it is on 2012R2 or
+	 * later. UDP checksum offloading doesn't work on earlier
+	 * Windows releases.
+	 */
+	if (hv_vmbus_protocal_version >= HV_VMBUS_VERSION_WIN8_1)
+		ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO;
+	else
+		ifp->if_hwassist = CSUM_TCP | CSUM_TSO;
 
 	ret = hv_rf_on_device_add(device_ctx, &device_info);
 	if (ret != 0) {
@@ -1110,7 +1118,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 				ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP);
 			} else {
 				ifp->if_capenable |= IFCAP_TXCSUM;
-				ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP);
+				/*
+				 * Only enable UDP checksum offloading on
+				 * Windows Server 2012R2 or later releases.
+				 */
+				if (hv_vmbus_protocal_version >=
+				    HV_VMBUS_VERSION_WIN8_1) {
+					ifp->if_hwassist |=
+					    (CSUM_TCP | CSUM_UDP);
+				} else {
+					ifp->if_hwassist |= CSUM_TCP;
+				}
 			}
 		}
 


More information about the svn-src-all mailing list