From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zyc-PC.local (unknown [119.61.11.228]) by dpdk.org (Postfix) with SMTP id D41D81B650 for ; Tue, 6 Feb 2018 12:20:46 +0100 (CET) Date: Tue, 6 Feb 2018 19:20:33 +0800 From: zhouyangchao CC: harish.patil@cavium.com; rasesh.mody@cavium.comharish.patil@cavium.com; rasesh.mody@cavium.com Sender: zhouyangchao To: dev@dpdk.org; Message-ID: <8a3affcd-4491-4abe-ac31-b5fe3f38d775@zyc-PC.local> X-Mailer: TortoiseGit MIME-Version: 1.0 Content-Type: text/plain; Subject: [dpdk-dev] [PATCH] net/bnx2x: reserve enough headroom for mbuf prepend X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2018 11:20:47 -0000 Signed-off-by: Yangchao Zhou --- drivers/net/bnx2x/bnx2x_rxtx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c index a0d4ac9..d8a3225 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.c +++ b/drivers/net/bnx2x/bnx2x_rxtx.c @@ -140,7 +140,8 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev, return -ENOMEM; } rxq->sw_ring[idx] = mbuf; - rxq->rx_ring[idx] = mbuf->buf_iova; + rxq->rx_ring[idx] = + rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf)); } rxq->pkt_first_seg = NULL; rxq->pkt_last_seg = NULL; @@ -400,7 +401,8 @@ bnx2x_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rx_mb = rxq->sw_ring[bd_cons]; rxq->sw_ring[bd_cons] = new_mb; - rxq->rx_ring[bd_prod] = new_mb->buf_iova; + rxq->rx_ring[bd_prod] = + rte_cpu_to_le_64(rte_mbuf_data_iova_default(new_mb)); rx_pref = NEXT_RX_BD(bd_cons) & MAX_RX_BD(rxq); rte_prefetch0(rxq->sw_ring[rx_pref]); @@ -409,7 +411,7 @@ bnx2x_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rte_prefetch0(&rxq->sw_ring[rx_pref]); } - rx_mb->data_off = pad; + rx_mb->data_off = pad + RTE_PKTMBUF_HEADROOM; rx_mb->nb_segs = 1; rx_mb->next = NULL; rx_mb->pkt_len = rx_mb->data_len = len; -- 2.9.0.windows.1