summaryrefslogtreecommitdiffstats
path: root/sys/dev/cxgbe
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2013-02-20 23:15:40 +0000
committernp <np@FreeBSD.org>2013-02-20 23:15:40 +0000
commit3c760430882730431f5870f23294cb580e98ea3f (patch)
tree19e934cd5055bac0d62637622b72e18f7f72df8a /sys/dev/cxgbe
parent2d6cf6d680c106847777143883746610829201ae (diff)
downloadFreeBSD-src-3c760430882730431f5870f23294cb580e98ea3f.zip
FreeBSD-src-3c760430882730431f5870f23294cb580e98ea3f.tar.gz
cxgbe(4): Assume that CSUM_TSO in the transmit path implies CSUM_IP and
CSUM_TCP too. They are all set explicitly by the kernel usually. While here, fix an unrelated bug where hardware L4 checksum calculation was accidentally disabled for some IPv6 packets. Reported by: alfred@ MFC after: 3 days
Diffstat (limited to 'sys/dev/cxgbe')
-rw-r--r--sys/dev/cxgbe/t4_sge.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 62ceec4..94dca53 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -2950,13 +2950,13 @@ write_txpkt_wr(struct port_info *pi, struct sge_txq *txq, struct mbuf *m,
/* Checksum offload */
ctrl1 = 0;
- if (!(m->m_pkthdr.csum_flags & CSUM_IP))
+ if (!(m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)))
ctrl1 |= F_TXPKT_IPCSUM_DIS;
if (!(m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 |
- CSUM_TCP_IPV6)))
+ CSUM_TCP_IPV6 | CSUM_TSO)))
ctrl1 |= F_TXPKT_L4CSUM_DIS;
if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP |
- CSUM_UDP_IPV6 | CSUM_TCP_IPV6))
+ CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO))
txq->txcsum++; /* some hardware assistance provided */
/* VLAN tag insertion */
@@ -3152,11 +3152,13 @@ write_ulp_cpl_sgl(struct port_info *pi, struct sge_txq *txq,
/* Checksum offload */
ctrl = 0;
- if (!(m->m_pkthdr.csum_flags & CSUM_IP))
+ if (!(m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)))
ctrl |= F_TXPKT_IPCSUM_DIS;
- if (!(m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)))
+ if (!(m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 |
+ CSUM_TCP_IPV6 | CSUM_TSO)))
ctrl |= F_TXPKT_L4CSUM_DIS;
- if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP))
+ if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP |
+ CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO))
txq->txcsum++; /* some hardware assistance provided */
/* VLAN tag insertion */
OpenPOWER on IntegriCloud