diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-05-21 09:03:18 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-05-21 09:03:18 +0000 |
commit | 24b8928a5d1c3110812356011e497e18a22da428 (patch) | |
tree | 0536d4d2cf012ca7114bae7711aafbdeb3c917a2 | |
parent | 75239f9f5d9f6f656eea7d1e5970f535b7970911 (diff) | |
download | FreeBSD-src-24b8928a5d1c3110812356011e497e18a22da428.zip FreeBSD-src-24b8928a5d1c3110812356011e497e18a22da428.tar.gz |
MFC: r282903
sfxge: advertise IPv6 Rx and Tx checksum offload support
Tx checksum offload may be enabled/disabled.
Sponsored by: Solarflare Communications, Inc.
-rw-r--r-- | sys/dev/sfxge/sfxge.c | 9 | ||||
-rw-r--r-- | sys/dev/sfxge/sfxge_tx.c | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/sfxge/sfxge.c b/sys/dev/sfxge/sfxge.c index c6acddd..a917942 100644 --- a/sys/dev/sfxge/sfxge.c +++ b/sys/dev/sfxge/sfxge.c @@ -60,10 +60,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) #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) MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); @@ -275,6 +277,10 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data) 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 @@ -325,7 +331,8 @@ sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc) 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); diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index 6c7bb7a..256e6c7 100644 --- a/sys/dev/sfxge/sfxge_tx.c +++ b/sys/dev/sfxge/sfxge_tx.c @@ -699,7 +699,8 @@ sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m) ("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 */ |