Date: Tue, 8 Aug 2017 11:49:37 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322251 - head/sys/dev/mlx5/mlx5_en Message-ID: <201708081149.v78BnbGw056189@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Tue Aug 8 11:49:36 2017 New Revision: 322251 URL: https://svnweb.freebsd.org/changeset/base/322251 Log: Make sure the received IP header gets 32-bit aligned for short packets in the mlx5en(4) driver. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Aug 8 11:36:57 2017 (r322250) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Aug 8 11:49:36 2017 (r322251) @@ -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 {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708081149.v78BnbGw056189>