svn commit: r322537 - stable/11/sys/dev/mlx5/mlx5_en

Hans Petter Selasky hselasky at FreeBSD.org
Tue Aug 15 12:30:12 UTC 2017


Author: hselasky
Date: Tue Aug 15 12:30:11 2017
New Revision: 322537
URL: https://svnweb.freebsd.org/changeset/base/322537

Log:
  MFC r322251:
  Make sure the received IP header gets 32-bit aligned for short packets
  in the mlx5en(4) driver.
  
  Sponsored by:		Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c	Tue Aug 15 12:28:16 2017	(r322536)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c	Tue Aug 15 12:30:11 2017	(r322537)
@@ -355,9 +355,11 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget)
 			rq->stats.wqe_err++;
 			goto wq_ll_pop;
 		}
-
-		if (MHLEN >= byte_cnt &&
+		if ((MHLEN - MLX5E_NET_IP_ALIGN) >= byte_cnt &&
 		    (mb = m_gethdr(M_NOWAIT, MT_DATA)) != NULL) {
+			/* get IP header aligned */
+			mb->m_data += MLX5E_NET_IP_ALIGN;
+
 			bcopy(rq->mbuf[wqe_counter].data, mtod(mb, caddr_t),
 			    byte_cnt);
 		} else {


More information about the svn-src-all mailing list