Author: sephe
Date: Fri Feb  5 05:01:02 2016
New Revision: 295298
URL: https://svnweb.freebsd.org/changeset/base/295298

Log:
  hyperv/hn: Enable IP header checksum offloading
  
  So that:
  - TCP/IP stack will not do unnecessary IP header checksum for TSO
    packets.
  - Reduce guest load for non-TSO IP packets.
  
  Reviewed by:  adrian
  Approved by:  adrian (mentor)
  MFC after:    1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:        https://reviews.freebsd.org/D5099

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  Fri Feb  5 04:10:04 
2016        (r295297)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Feb  5 05:01:02 
2016        (r295298)
@@ -172,7 +172,7 @@ struct hn_txdesc {
  * Windows releases.
  */
 #define HN_CSUM_ASSIST_WIN8    (CSUM_TCP)
-#define HN_CSUM_ASSIST         (CSUM_UDP | CSUM_TCP)
+#define HN_CSUM_ASSIST         (CSUM_IP | CSUM_UDP | CSUM_TCP)
 
 /* XXX move to netinet/tcp_lro.h */
 #define HN_LRO_HIWAT_MAX                               65535
@@ -867,6 +867,9 @@ hn_start_locked(struct ifnet *ifp, int l
                            rppi->per_packet_info_offset);
 
                        csum_info->xmit.is_ipv4 = 1;
+                       if (m_head->m_pkthdr.csum_flags & CSUM_IP)
+                               csum_info->xmit.ip_header_csum = 1;
+
                        if (m_head->m_pkthdr.csum_flags & CSUM_TCP) {
                                csum_info->xmit.tcp_csum = 1;
                                csum_info->xmit.tcp_header_offset = 0;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to