Avoid trashing IP fragments:

- Only enable UDP/TCP hardware checksums if CSUM_UDP or CSUM_TCP is set.
- Only enable IP hardware checksums if CSUM_IP is set.

PR:		kern/180430
Submitted by:	Meny Yossefi <menyy@mellanox.com>
MFC after:	1 week
This commit is contained in:
John Baldwin 2013-07-25 16:34:34 +00:00
parent 0b54fe540c
commit ba90c51af3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253653

View file

@ -780,8 +780,12 @@ static int mlx4_en_xmit(struct net_device *dev, int tx_ind, struct mbuf **mbp)
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++;
}