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 {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to