summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarybchik <arybchik@FreeBSD.org>2015-05-21 09:06:41 +0000
committerarybchik <arybchik@FreeBSD.org>2015-05-21 09:06:41 +0000
commit8074c227f294340aa2a677bf4b910d57577884ea (patch)
tree7b5c51f22dc3a00356f96169fc2f30f04e35d14d
parent037a819653dd8bb6c13f74af78dad6b6a61701dc (diff)
downloadFreeBSD-src-8074c227f294340aa2a677bf4b910d57577884ea.zip
FreeBSD-src-8074c227f294340aa2a677bf4b910d57577884ea.tar.gz
MFC: r282941
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. Sponsored by: Solarflare Communications, Inc.
-rw-r--r--sys/dev/sfxge/sfxge.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/sfxge/sfxge.c b/sys/dev/sfxge/sfxge.c
index a917942..ac128f2 100644
--- a/sys/dev/sfxge/sfxge.c
+++ b/sys/dev/sfxge/sfxge.c
@@ -281,10 +281,14 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
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;
OpenPOWER on IntegriCloud