summaryrefslogtreecommitdiff
path: root/drivers/net/bnxt/bnxt_rxr.c
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2018-01-03 11:32:25 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-01-16 18:47:49 +0100
commit35906acbf34daa32469fa63d759846057f36e6fb (patch)
tree88f11d8b726785361f7f0312a61428b28e5238c9 /drivers/net/bnxt/bnxt_rxr.c
parent42b883535804d69ca8b21b39087fc1d14a1ee3f3 (diff)
downloaddpdk-next-eventdev-35906acbf34daa32469fa63d759846057f36e6fb.zip
dpdk-next-eventdev-35906acbf34daa32469fa63d759846057f36e6fb.tar.gz
dpdk-next-eventdev-35906acbf34daa32469fa63d759846057f36e6fb.tar.xz
net/bnxt: fix headroom initialization
When allocating a new mbuf for Rx, the value of m->data_off should not be reset to its default value (RTE_PKTMBUF_HEADROOM), instead of reusing the previous undefined value, which could cause the packet to have a too small or too high headroom. Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") Cc: stable@dpdk.org Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Diffstat (limited to 'drivers/net/bnxt/bnxt_rxr.c')
-rw-r--r--drivers/net/bnxt/bnxt_rxr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 89114cc..82c93d6 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -75,7 +75,7 @@ static inline int bnxt_alloc_rx_data(struct bnxt_rx_queue *rxq,
rx_buf->mbuf = mbuf;
- rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(mbuf));
+ rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
return 0;
}
@@ -102,7 +102,7 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq,
rx_buf->mbuf = mbuf;
- rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(mbuf));
+ rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
return 0;
}
@@ -123,7 +123,7 @@ static inline void bnxt_reuse_rx_mbuf(struct bnxt_rx_ring_info *rxr,
prod_bd = &rxr->rx_desc_ring[prod];
- prod_bd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(mbuf));
+ prod_bd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
rxr->rx_prod = prod;
}
@@ -442,6 +442,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
rte_prefetch0(mbuf);
+ mbuf->data_off = RTE_PKTMBUF_HEADROOM;
mbuf->nb_segs = 1;
mbuf->next = NULL;
mbuf->pkt_len = rxcmp->len;