Date: Thu, 11 Jul 2013 13:30:06 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-net@freebsd.org Subject: Re: kern/180430: [ofed] [patch] Bad UDP checksum calc for fragmented packets Message-ID: <201307111330.06608.jhb@freebsd.org> In-Reply-To: <201307101059.r6AAxgjI073347@freefall.freebsd.org> References: <201307101059.r6AAxgjI073347@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, July 10, 2013 6:59:42 am linimon@freebsd.org wrote: > Old Synopsis: Bad UDP checksum calc for fragmented packets > New Synopsis: [ofed] [patch] Bad UDP checksum calc for fragmented packets > > Responsible-Changed-From-To: freebsd-bugs->freebsd-net > Responsible-Changed-By: linimon > Responsible-Changed-When: Wed Jul 10 10:59:03 UTC 2013 > Responsible-Changed-Why: > Over to maintainer(s). > > http://www.freebsd.org/cgi/query-pr.cgi?pr=180430 Is the problem that the hardware checksum overwrites arbitrary data in the packet (at the location where the UDP header would be)? Also, I've looked at other drivers, and they all look at the CSUM_* flags to determine the right settings. IP fragments will not have CSUM_UDP or CSUM_TCP set, so I think the more correct fix is this: Index: en_tx.c =================================================================== --- en_tx.c (revision 253202) +++ en_tx.c (working copy) @@ -780,8 +780,12 @@ retry: tx_desc->ctrl.srcrb_flags = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE | MLX4_WQE_CTRL_SOLICITED); if (mb->m_pkthdr.csum_flags & (CSUM_IP|CSUM_TCP|CSUM_UDP)) { - tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM | - MLX4_WQE_CTRL_TCP_UDP_CSUM); + if (mb->m_pkthdr.csum_flags & CSUM_IP) + tx_desc->ctrl.srcrb_flags |= + cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM); + if (mb->m_pkthdr.csum_flags & (CSUM_TCP|CSUM_UDP)) { + tx_desc->ctrl.srcrb_flags |= + cpu_to_be32(MLX4_WQE_CTRL_TCP_UDP_CSUM); priv->port_stats.tx_chksum_offload++; } -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307111330.06608.jhb>