Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jul 2013 16:34:34 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253653 - head/sys/ofed/drivers/net/mlx4
Message-ID:  <201307251634.r6PGYYJE097083@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Jul 25 16:34:34 2013
New Revision: 253653
URL: http://svnweb.freebsd.org/changeset/base/253653

Log:
  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

Modified:
  head/sys/ofed/drivers/net/mlx4/en_tx.c

Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/en_tx.c	Thu Jul 25 16:04:55 2013	(r253652)
+++ head/sys/ofed/drivers/net/mlx4/en_tx.c	Thu Jul 25 16:34:34 2013	(r253653)
@@ -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++;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307251634.r6PGYYJE097083>