Author: tuexen
Date: Thu Feb  4 18:08:50 2016
New Revision: 295273
URL: https://svnweb.freebsd.org/changeset/base/295273

Log:
  In FreeBSD 10 and higher the driver announces SCTP checksum offloading support
  also for 82598, which doesn't support it.
  The legacy code has a check for it, which was missed when the code for 
dealing with
  CSUM_IP6_* was added. Add the same check for FreeBSD 10 and higher.
  
  Differential Revision:        https://reviews.freebsd.org/D5192

Modified:
  head/sys/dev/ixgbe/if_ix.c

Modified: head/sys/dev/ixgbe/if_ix.c
==============================================================================
--- head/sys/dev/ixgbe/if_ix.c  Thu Feb  4 18:03:06 2016        (r295272)
+++ head/sys/dev/ixgbe/if_ix.c  Thu Feb  4 18:08:50 2016        (r295273)
@@ -1017,6 +1017,7 @@ static void
 ixgbe_set_if_hwassist(struct adapter *adapter)
 {
        struct ifnet *ifp = adapter->ifp;
+       struct ixgbe_hw *hw = &adapter->hw;
 
        ifp->if_hwassist = 0;
 #if __FreeBSD_version >= 1000000
@@ -1024,18 +1025,21 @@ ixgbe_set_if_hwassist(struct adapter *ad
                ifp->if_hwassist |= CSUM_IP_TSO;
        if (ifp->if_capenable & IFCAP_TSO6)
                ifp->if_hwassist |= CSUM_IP6_TSO;
-       if (ifp->if_capenable & IFCAP_TXCSUM)
-               ifp->if_hwassist |= (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP |
-                   CSUM_IP_SCTP);
-       if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
-               ifp->if_hwassist |= (CSUM_IP6_UDP | CSUM_IP6_TCP |
-                   CSUM_IP6_SCTP);
+       if (ifp->if_capenable & IFCAP_TXCSUM) {
+               ifp->if_hwassist |= (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP);
+               if (hw->mac.type != ixgbe_mac_82598EB)
+                       ifp->if_hwassist |= CSUM_IP_SCTP;
+       }
+       if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) {
+               ifp->if_hwassist |= (CSUM_IP6_UDP | CSUM_IP6_TCP);
+               if (hw->mac.type != ixgbe_mac_82598EB)
+                       ifp->if_hwassist |= CSUM_IP6_SCTP;
+       }
 #else
        if (ifp->if_capenable & IFCAP_TSO)
                ifp->if_hwassist |= CSUM_TSO;
        if (ifp->if_capenable & IFCAP_TXCSUM) {
                ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP);
-               struct ixgbe_hw *hw = &adapter->hw;
                if (hw->mac.type != ixgbe_mac_82598EB)
                        ifp->if_hwassist |= CSUM_SCTP;
        }
_______________________________________________
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