Author: arybchik
Date: Thu May 14 14:16:09 2015
New Revision: 282903
URL: https://svnweb.freebsd.org/changeset/base/282903

Log:
  sfxge: advertise IPv6 Rx and Tx checksum offload support
  
  Tx checksum offload may be enabled/disabled.
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:      2 days
  Differential Revision: https://reviews.freebsd.org/D2543

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

Modified: head/sys/dev/sfxge/sfxge.c
==============================================================================
--- head/sys/dev/sfxge/sfxge.c  Thu May 14 14:07:44 2015        (r282902)
+++ head/sys/dev/sfxge/sfxge.c  Thu May 14 14:16:09 2015        (r282903)
@@ -61,10 +61,12 @@ __FBSDID("$FreeBSD$");
 
 #define        SFXGE_CAP (IFCAP_VLAN_MTU | IFCAP_VLAN_HWCSUM |                 
\
                   IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO |            \
+                  IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6 |              \
                   IFCAP_JUMBO_MTU | IFCAP_LRO |                        \
                   IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWSTATS)
 #define        SFXGE_CAP_ENABLE SFXGE_CAP
 #define        SFXGE_CAP_FIXED (IFCAP_VLAN_MTU | IFCAP_RXCSUM | 
IFCAP_VLAN_HWCSUM | \
+                        IFCAP_RXCSUM_IPV6 |                            \
                         IFCAP_JUMBO_MTU | IFCAP_LINKSTATE | IFCAP_HWSTATS)
 
 MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver");
@@ -276,6 +278,10 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign
                        ifp->if_hwassist |= (CSUM_IP | CSUM_TCP | CSUM_UDP);
                else
                        ifp->if_hwassist &= ~(CSUM_IP | CSUM_TCP | CSUM_UDP);
+               if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
+                       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
@@ -326,7 +332,8 @@ sfxge_ifnet_init(struct ifnet *ifp, stru
 
        ifp->if_capabilities = SFXGE_CAP;
        ifp->if_capenable = SFXGE_CAP_ENABLE;
-       ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO;
+       ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
+                          CSUM_TCP_IPV6 | CSUM_UDP_IPV6;
 
        ether_ifattach(ifp, encp->enc_mac_addr);
 

Modified: head/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_tx.c       Thu May 14 14:07:44 2015        
(r282902)
+++ head/sys/dev/sfxge/sfxge_tx.c       Thu May 14 14:16:09 2015        
(r282903)
@@ -699,7 +699,8 @@ sfxge_if_transmit(struct ifnet *ifp, str
                ("interface not up"));
 
        /* Pick the desired transmit queue. */
-       if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) {
+       if (m->m_pkthdr.csum_flags &
+           (CSUM_DELAY_DATA | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_TSO)) {
                int index = 0;
 
                /* check if flowid is set */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to