[dpdk-dev] [PATCH v1 1/2] net/i40e: improve performance for scalar Tx

Xing, Beilei beilei.xing at intel.com
Wed Jun 23 09:02:01 CEST 2021



> -----Original Message-----
> From: Feifei Wang <Feifei.Wang2 at arm.com>
> Sent: Tuesday, June 22, 2021 6:08 PM
> To: Xing, Beilei <beilei.xing at intel.com>
> Cc: dev at dpdk.org; nd <nd at arm.com>; Ruifeng Wang
> <Ruifeng.Wang at arm.com>; nd <nd at arm.com>
> Subject: 回复: [PATCH v1 1/2] net/i40e: improve performance for scalar Tx
> 
> Sorry for a mistake for the code, it should be:
> ------------------------------------------------------------------------------------------------
> int n = txq->tx_rs_thresh;
>  int32_t i = 0, j = 0;
> const int32_t k = RTE_ALIGN_FLOOR(n, RTE_I40E_TX_MAX_FREE_BUF_SZ);
> const int32_t m = n % RTE_I40E_TX_MAX_FREE_BUF_SZ; struct rte_mbuf
> *free[RTE_I40E_TX_MAX_FREE_BUF_SZ];
> 
> For FAST_FREE_MODE:
> 
> if (k) {
>  	for (j = 0; j != k - RTE_I40E_TX_MAX_FREE_BUF_SZ;
>  			j += RTE_I40E_TX_MAX_FREE_BUF_SZ) {
> 		for (i = 0; i <RTE_I40E_TX_MAX_FREE_BUF_SZ; ++i, ++txep) {
> 			free[i] = txep->mbuf;
> 			txep->mbuf = NULL;
> 		}
>  		rte_mempool_put_bulk(free[0]->pool, (void **)free,
>  					RTE_I40E_TX_MAX_FREE_BUF_SZ);
>  	}
>  }
> 
> if (m) {
>  	for (i = 0; i < m; ++i, ++txep) {
> 		free[i] = txep->mbuf;
>  		txep->mbuf = NULL;
> 	}
>  }
>  rte_mempool_put_bulk(free[0]->pool, (void **)free, m); }
> ------------------------------------------------------------------------------------------------

Seems no logical problem, but the code looks heavy due to for loops.
Did you run performance with this change when tx_rs_thresh > RTE_I40E_TX_MAX_FREE_BUF_SZ?


More information about the dev mailing list