Author: np Date: Wed Feb 20 23:15:40 2013 New Revision: 247062 URL: http://svnweb.freebsd.org/changeset/base/247062
Log: 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 Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Wed Feb 20 22:59:53 2013 (r247061) +++ head/sys/dev/cxgbe/t4_sge.c Wed Feb 20 23:15:40 2013 (r247062) @@ -2950,13 +2950,13 @@ write_txpkt_wr(struct port_info *pi, str /* 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, /* 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 */ _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"