DPDK patches and discussions
 help / color / mirror / Atom feed
From: Liangxing Wang <liangxing.wang@arm.com>
To: Jakub Grajciar <jgrajcia@cisco.com>
Cc: dev@dpdk.org, nd@arm.com, Liangxing Wang <liangxing.wang@arm.com>,
	Ruifeng Wang <ruifeng.wang@arm.com>
Subject: [PATCH v1] net/memif: remove extra mbuf refcnt update in zero copy Tx
Date: Fri,  8 Dec 2023 02:38:01 +0000	[thread overview]
Message-ID: <20231208023801.3156065-1-liangxing.wang@arm.com> (raw)

The refcnt update of stored mbufs in memif driver is redundant since
those mbufs are only freed in eth_memif_tx_zc(). No other place
can free those stored mbufs quietly. So remove the redundant mbuf
refcnt update in dpdk memif driver to avoid extra heavy cost.
Performance of dpdk memif zero copy tx is improved with this change.

Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/memif/rte_eth_memif.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 7cc8c0da91..962d390b90 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -265,8 +265,6 @@ memif_free_stored_mbufs(struct pmd_process_private *proc_private, struct memif_q
 	cur_tail = __atomic_load_n(&ring->tail, __ATOMIC_ACQUIRE);
 	while (mq->last_tail != cur_tail) {
 		RTE_MBUF_PREFETCH_TO_FREE(mq->buffers[(mq->last_tail + 1) & mask]);
-		/* Decrement refcnt and free mbuf. (current segment) */
-		rte_mbuf_refcnt_update(mq->buffers[mq->last_tail & mask], -1);
 		rte_pktmbuf_free_seg(mq->buffers[mq->last_tail & mask]);
 		mq->last_tail++;
 	}
@@ -825,10 +823,6 @@ memif_tx_one_zc(struct pmd_process_private *proc_private, struct memif_queue *mq
 next_in_chain:
 	/* store pointer to mbuf to free it later */
 	mq->buffers[slot & mask] = mbuf;
-	/* Increment refcnt to make sure the buffer is not freed before server
-	 * receives it. (current segment)
-	 */
-	rte_mbuf_refcnt_update(mbuf, 1);
 	/* populate descriptor */
 	d0 = &ring->desc[slot & mask];
 	d0->length = rte_pktmbuf_data_len(mbuf);
-- 
2.25.1


             reply	other threads:[~2023-12-08  2:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  2:38 Liangxing Wang [this message]
2023-12-08 13:44 ` Ferruh Yigit
2024-02-08  1:06   ` Ferruh Yigit
2024-02-14  0:36 ` [PATCH V2] net/memif: fix " Wathsala Vithanage
2024-02-14 11:09   ` Ferruh Yigit

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=20231208023801.3156065-1-liangxing.wang@arm.com \
    --to=liangxing.wang@arm.com \
    --cc=dev@dpdk.org \
    --cc=jgrajcia@cisco.com \
    --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).