From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D1E505F2D for ; Mon, 5 Mar 2018 16:28:55 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 07:28:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,427,1515484800"; d="scan'208";a="180018248" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.62]) ([10.237.221.62]) by orsmga004.jf.intel.com with ESMTP; 05 Mar 2018 07:28:52 -0800 To: zhouyangchao , dev@dpdk.org Cc: harish.patil@cavium.com, rasesh.mody@cavium.com References: <6fd6d52e-a756-45ad-9666-60fa7ca676cd@zyc-PC.local> From: Ferruh Yigit Message-ID: <4a1a34a8-87a9-5776-dfeb-1be4fe59eb12@intel.com> Date: Mon, 5 Mar 2018 15:28:51 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <6fd6d52e-a756-45ad-9666-60fa7ca676cd@zyc-PC.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [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: Mon, 05 Mar 2018 15:28:56 -0000 On 2/6/2018 11:21 AM, zhouyangchao wrote: Can you please provide more information why this patch is needed? > 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; >