patch 'net/memif: fix extra mbuf refcnt update in zero copy Tx' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Tue Mar 5 10:47:29 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=edaeda9ef7ec00ecce31b4e5d16158e60fb1e15f

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From edaeda9ef7ec00ecce31b4e5d16158e60fb1e15f Mon Sep 17 00:00:00 2001
From: Wathsala Vithanage <wathsala.vithanage at arm.com>
Date: Wed, 14 Feb 2024 00:36:16 +0000
Subject: [PATCH] net/memif: fix extra mbuf refcnt update in zero copy Tx
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit aa3e97fcb55d7b68fef864aa76078bdae375ad3d ]

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. By removing this redundant update
single core dpdk memif performance can be improved by 7.5%.

testpmd stats on Arm Neoverse N1 (Ampere Altra)
+-----------------------------+-----------------------+
|        | With refcnt update | Without refcnt update |
+--------+--------------------+-----------------------+
| Rx-pps |      2748851       |         2955487       |
+--------+--------------------+-----------------------+
| Tx-pps |      2748812       |         2955436       |
+--------+--------------------+-----------------------+

Fixes: 43b815d88188 ("net/memif: support zero-copy slave")

Signed-off-by: Liangxing Wang <liangxing.wang at arm.com>
Signed-off-by: Wathsala Vithanage <wathsala.vithanage at arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
Acked-by: Ferruh Yigit <ferruh.yigit at amd.com>
---
 .mailmap                          | 1 +
 drivers/net/memif/rte_eth_memif.c | 6 ------
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/.mailmap b/.mailmap
index 65c0e8e0ac..55901a26c0 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1511,6 +1511,7 @@ Walter Heymans <walter.heymans at corigine.com>
 Wang Sheng-Hui <shhuiw at gmail.com>
 Wangyu (Eric) <seven.wangyu at huawei.com>
 Waterman Cao <waterman.cao at intel.com>
+Wathsala Vithanage <wathsala.vithanage at arm.com>
 Weichun Chen <weichunx.chen at intel.com>
 Wei Dai <wei.dai at intel.com>
 Weifeng Li <liweifeng96 at 126.com>
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 6f45a00172..18377d9caf 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.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.230372508 +0800
+++ 0108-net-memif-fix-extra-mbuf-refcnt-update-in-zero-copy-.patch	2024-03-05 17:39:30.893566497 +0800
@@ -1 +1 @@
-From aa3e97fcb55d7b68fef864aa76078bdae375ad3d Mon Sep 17 00:00:00 2001
+From edaeda9ef7ec00ecce31b4e5d16158e60fb1e15f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit aa3e97fcb55d7b68fef864aa76078bdae375ad3d ]
@@ -21 +23,0 @@
-Cc: stable at dpdk.org
@@ -33 +35 @@
-index e040e2219b..b2d0fc0729 100644
+index 65c0e8e0ac..55901a26c0 100644
@@ -36 +38 @@
-@@ -1518,6 +1518,7 @@ Walter Heymans <walter.heymans at corigine.com>
+@@ -1511,6 +1511,7 @@ Walter Heymans <walter.heymans at corigine.com>


More information about the stable mailing list