svn commit: r322538 - stable/10/sys/dev/mlx5/mlx5_en
Hans Petter Selasky
hselasky at FreeBSD.org
Tue Aug 15 12:54:20 UTC 2017
Author: hselasky
Date: Tue Aug 15 12:54:19 2017
New Revision: 322538
URL: https://svnweb.freebsd.org/changeset/base/322538
Log:
MFC r322251:
Make sure the received IP header gets 32-bit aligned for short packets
in the mlx5en(4) driver.
Approved by: re (kib)
Sponsored by: Mellanox Technologies
Modified:
stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
==============================================================================
--- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Aug 15 12:30:11 2017 (r322537)
+++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Aug 15 12:54:19 2017 (r322538)
@@ -358,9 +358,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-stable
mailing list