net/bnxt: fix mbuf data offset initialization
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 20 Apr 2018 14:22:02 +0000 (07:22 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 14:54:56 +0000 (15:54 +0100)
Initialize mbuf->data_off to RTE_PKTMBUF_HEADROOM after allocation.
Without this, it might be possible that the DMA address provided
to the HW may not be in sync to what is indicated to the application
in bnxt_rx_pkt.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_rxr.c

index 4bc3204..7b956ac 100644 (file)
@@ -46,6 +46,7 @@ static inline int bnxt_alloc_rx_data(struct bnxt_rx_queue *rxq,
        }
 
        rx_buf->mbuf = mbuf;
+       mbuf->data_off = RTE_PKTMBUF_HEADROOM;
 
        rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
 
@@ -73,6 +74,7 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq,
 
 
        rx_buf->mbuf = mbuf;
+       mbuf->data_off = RTE_PKTMBUF_HEADROOM;
 
        rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));