From: Feifei Wang <feifei.wang2@arm.com>
To: Beilei Xing <beilei.xing@intel.com>
Cc: dev@dpdk.org, nd@arm.com, Feifei Wang <feifei.wang2@arm.com>,
Ruifeng Wang <ruifeng.wang@arm.com>
Subject: [dpdk-dev] [PATCH v1 2/2] net/i40e: improve performance for vector Tx
Date: Thu, 27 May 2021 16:17:14 +0800 [thread overview]
Message-ID: <20210527081714.1367611-3-feifei.wang2@arm.com> (raw)
In-Reply-To: <20210527081714.1367611-1-feifei.wang2@arm.com>
For i40e vector Tx path, if tx_offload is set as FAST_FREE_MBUF mode,
no mbuf fast free operations are executed. To fix this, add mbuf fast
free mode for vector Tx path.
Furthermore, for i40e vector Tx path, if implement FAST_FREE_MBUF mode,
it means per-queue all mbufs come from the same mempool and have
refcnt = 1. Thus we can use bulk free of the buffers when mbuf fast free
mode is enabled.
For vector path in arm platform:
In n1sdp, performance is improved by 18.4%;
In thunderx2, performance is improved by 23%.
For vector path in x86 platform:
No performance changes.
Suggested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
---
drivers/net/i40e/i40e_rxtx_vec_common.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index 16fcf0aec6..f52ed98d62 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -99,6 +99,16 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
* tx_next_dd - (tx_rs_thresh-1)
*/
txep = &txq->sw_ring[txq->tx_next_dd - (n - 1)];
+
+ if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) {
+ for (i = 0; i < n; i++) {
+ free[i] = txep[i].mbuf;
+ txep[i].mbuf = NULL;
+ }
+ rte_mempool_put_bulk(free[0]->pool, (void **)free, n);
+ goto done;
+ }
+
m = rte_pktmbuf_prefree_seg(txep[0].mbuf);
if (likely(m != NULL)) {
free[0] = m;
@@ -126,6 +136,7 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
}
}
+done:
/* buffers were freed, update counters */
txq->nb_tx_free = (uint16_t)(txq->nb_tx_free + txq->tx_rs_thresh);
txq->tx_next_dd = (uint16_t)(txq->tx_next_dd + txq->tx_rs_thresh);
--
2.25.1
next prev parent reply other threads:[~2021-05-27 8:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-27 8:17 [dpdk-dev] [PATCH v1 0/2] net/i40e: improve free mbuf Feifei Wang
2021-05-27 8:17 ` [dpdk-dev] [PATCH v1 1/2] net/i40e: improve performance for scalar Tx Feifei Wang
2021-06-22 6:07 ` Xing, Beilei
2021-06-22 9:58 ` [dpdk-dev] 回复: " Feifei Wang
2021-06-22 10:08 ` Feifei Wang
2021-06-23 7:02 ` [dpdk-dev] " Xing, Beilei
2021-06-25 9:40 ` [dpdk-dev] 回复: " Feifei Wang
2021-06-28 2:27 ` [dpdk-dev] " Xing, Beilei
2021-06-28 2:28 ` [dpdk-dev] 回复: " Feifei Wang
2021-05-27 8:17 ` Feifei Wang [this message]
2021-06-22 1:52 ` [dpdk-dev] 回复: [PATCH v1 0/2] net/i40e: improve free mbuf Feifei Wang
2021-06-30 6:40 ` [dpdk-dev] [PATCH v3 0/2] net/i40e: improve free mbuf for Tx Feifei Wang
2021-06-30 6:40 ` [dpdk-dev] [PATCH v3 1/2] net/i40e: improve performance for scalar Tx Feifei Wang
2021-06-30 6:59 ` Xing, Beilei
2021-06-30 6:40 ` [dpdk-dev] [PATCH v3 2/2] net/i40e: improve performance for vector Tx Feifei Wang
2021-07-01 12:34 ` [dpdk-dev] [PATCH v3 0/2] net/i40e: improve free mbuf for Tx Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210527081714.1367611-3-feifei.wang2@arm.com \
--to=feifei.wang2@arm.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=nd@arm.com \
--cc=ruifeng.wang@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).