Date: Tue, 15 Aug 2017 12:54:19 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322538 - stable/10/sys/dev/mlx5/mlx5_en Message-ID: <201708151254.v7FCsJns047461@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708151254.v7FCsJns047461>