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

Ferruh Yigit ferruh.yigit at intel.com
Thu Jun 29 14:55:28 CEST 2017


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?

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



More information about the dev mailing list