[dpdk-dev] [PATCH 8/9] net/qede: use newer packet mbuf allocate API

Mody, Rasesh Rasesh.Mody at cavium.com
Sat Jul 1 21:34:46 CEST 2017


Hi Ferruh,

> From: Ferruh Yigit [mailto:ferruh.yigit at intel.com]
> Sent: Thursday, June 29, 2017 5:55 AM
> 
> On 6/29/2017 10:51 AM, Rasesh Mody wrote:
> > Use rte_pktmbuf_alloc() API instead of rte_mbuf_raw_alloc().
> >
> > Signed-off-by: Rasesh Mody <rasesh.mody at cavium.com>
> > ---
> >  drivers/net/qede/qede_rxtx.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/qede/qede_rxtx.c
> > b/drivers/net/qede/qede_rxtx.c index 8063233..6b047a3 100644
> > --- a/drivers/net/qede/qede_rxtx.c
> > +++ b/drivers/net/qede/qede_rxtx.c
> > @@ -16,7 +16,7 @@ static inline int qede_alloc_rx_buffer(struct
> qede_rx_queue *rxq)
> >  	dma_addr_t mapping;
> >  	uint16_t idx = rxq->sw_rx_prod & NUM_RX_BDS(rxq);
> >
> > -	new_mb = rte_mbuf_raw_alloc(rxq->mb_pool);
> > +	new_mb = rte_pktmbuf_alloc(rxq->mb_pool);
> 
> rte_pktmbuf_alloc() is more expensive call, because of
> rte_pktmbuf_reset() it has.
> 
> Are you sure you want to switch, what is the motivation?

Yes, the intent was to initialize a new mbuf. But thinking over it again, we think it's better to skip this patch as we are updating most of the mbuf flags in receive routine anyway (except next and tx_offload fields). We've sent v2 series without this patch.

Thanks!
-Rasesh

> 
> >  	if (unlikely(!new_mb)) {
> >  		PMD_RX_LOG(ERR, rxq,
> >  			   "Failed to allocate rx buffer "
> >



More information about the dev mailing list