Date: Wed, 22 Jul 2015 05:05:02 +0000 (UTC) From: Wei Hu <whu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285785 - head/sys/dev/hyperv/netvsc Message-ID: <201507220505.t6M552aR050318@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: whu Date: Wed Jul 22 05:05:01 2015 New Revision: 285785 URL: https://svnweb.freebsd.org/changeset/base/285785 Log: 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 MFC after: 3 days Relnotes: No Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D3086 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jul 22 04:18:33 2015 (r285784) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jul 22 05:05:01 2015 (r285785) @@ -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) { @@ -1108,7 +1116,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; + } } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507220505.t6M552aR050318>