net/cxgbe: fix alignment for data offset in mbuf
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Thu, 15 Jun 2017 02:13:54 +0000 (07:43 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 6 Jul 2017 13:00:56 +0000 (15:00 +0200)
Fixup alignment for data offset when refilling mbufs.

Fixes: edd04c619685 ("net/cxgbe: update Rx path for Chelsio T6")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
drivers/net/cxgbe/sge.c

index 22a168c..e281020 100644 (file)
@@ -415,7 +415,11 @@ static unsigned int refill_fl_usembufs(struct adapter *adap, struct sge_fl *q,
                }
 
                rte_mbuf_refcnt_set(mbuf, 1);
-               mbuf->data_off = RTE_PKTMBUF_HEADROOM;
+               mbuf->data_off =
+                       (uint16_t)(RTE_PTR_ALIGN((char *)mbuf->buf_addr +
+                                                RTE_PKTMBUF_HEADROOM,
+                                                adap->sge.fl_align) -
+                                  (char *)mbuf->buf_addr);
                mbuf->next = NULL;
                mbuf->nb_segs = 1;
                mbuf->port = rxq->rspq.port_id;