Author: arybchik
Date: Fri May 15 06:49:43 2015
New Revision: 282941
URL: https://svnweb.freebsd.org/changeset/base/282941

Log:
  sfxge: do not change CSUM_TSO when IFCAP_TSOx is changed
  
  It is simply not required since the kernel checks corresponding
  IFCAP_TSOx capability and CSUM_TSO in hw-assisted offloads.
  Note that CSUM_TSO is two bits (CSUM_IP_TSO|CSUM_IP6_TSO) and both bits
  are set in IPv4 and IPv6 mbufs.
  
  Reviewed by:    gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:      2 days
  Differential Revision: https://reviews.freebsd.org/D2546

Modified:
  head/sys/dev/sfxge/sfxge.c

Modified: head/sys/dev/sfxge/sfxge.c
==============================================================================
--- head/sys/dev/sfxge/sfxge.c  Fri May 15 06:48:36 2015        (r282940)
+++ head/sys/dev/sfxge/sfxge.c  Fri May 15 06:49:43 2015        (r282941)
@@ -282,10 +282,14 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign
                        ifp->if_hwassist |= (CSUM_TCP_IPV6 | CSUM_UDP_IPV6);
                else
                        ifp->if_hwassist &= ~(CSUM_TCP_IPV6 | CSUM_UDP_IPV6);
-               if (ifp->if_capenable & IFCAP_TSO)
-                       ifp->if_hwassist |= CSUM_TSO;
-               else
-                       ifp->if_hwassist &= ~CSUM_TSO;
+
+               /*
+                * The kernel takes both IFCAP_TSOx and CSUM_TSO into
+                * account before using TSO. So, we do not touch
+                * checksum flags when IFCAP_TSOx is modified.
+                * Note that CSUM_TSO is (CSUM_IP_TSO|CSUM_IP6_TSO),
+                * but both bits are set in IPv4 and IPv6 mbufs.
+                */
 
                SFXGE_ADAPTER_UNLOCK(sc);
                break;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to