> -----Original Message-----
> From: Feifei Wang <feifei.wa...@arm.com>
> Sent: Tuesday, June 22, 2021 6:08 PM
> To: Xing, Beilei <beilei.x...@intel.com>
> Cc: dev@dpdk.org; nd <n...@arm.com>; Ruifeng Wang
> <ruifeng.w...@arm.com>; nd <n...@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?

Reply via email to