patch 'net/memif: fix crash with different number of Rx/Tx queues' has been queued to stable release 20.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 3 10:27:28 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/05/22. 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://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/1ec58a78f5873eee1c4c10016db03ec685b2a112

Thanks.

Luca Boccassi

---
>From 1ec58a78f5873eee1c4c10016db03ec685b2a112 Mon Sep 17 00:00:00 2001
From: Huzaifa Rahman <huzaifa.rahman at emumba.com>
Date: Tue, 26 Jul 2022 15:16:28 +0500
Subject: [PATCH] net/memif: fix crash with different number of Rx/Tx queues

[ upstream commit 231435a5e6c7fa915697d8f84a91b44176bba4d1 ]

There's a bug in memif_stats_get() function due to confusion
between C2S (client->server) and S2C (server->client) rings,
causing a crash if there's a different number of Rx and Tx queues.

Fixit by selectiing the correct rings for Rx and Tx i.e for Rx, S2C
rings are selected and for Tx, C2S rings are selected.

Bugzilla ID: 734
Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")

Signed-off-by: Huzaifa Rahman <huzaifa.rahman at emumba.com>
Reviewed-by: Joyce Kong <joyce.kong at arm.com>
---
 drivers/net/memif/rte_eth_memif.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 642c44d4ac..ee5292cc2b 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1396,8 +1396,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	stats->opackets = 0;
 	stats->obytes = 0;
 
-	tmp = (pmd->role == MEMIF_ROLE_CLIENT) ? pmd->run.num_c2s_rings :
-	    pmd->run.num_s2c_rings;
+	tmp = (pmd->role == MEMIF_ROLE_CLIENT) ? pmd->run.num_s2c_rings :
+	    pmd->run.num_c2s_rings;
 	nq = (tmp < RTE_ETHDEV_QUEUE_STAT_CNTRS) ? tmp :
 	    RTE_ETHDEV_QUEUE_STAT_CNTRS;
 
@@ -1410,8 +1410,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		stats->ibytes += mq->n_bytes;
 	}
 
-	tmp = (pmd->role == MEMIF_ROLE_CLIENT) ? pmd->run.num_s2c_rings :
-	    pmd->run.num_c2s_rings;
+	tmp = (pmd->role == MEMIF_ROLE_CLIENT) ? pmd->run.num_c2s_rings :
+	    pmd->run.num_s2c_rings;
 	nq = (tmp < RTE_ETHDEV_QUEUE_STAT_CNTRS) ? tmp :
 	    RTE_ETHDEV_QUEUE_STAT_CNTRS;
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-11-03 09:27:29.596082470 +0000
+++ 0070-net-memif-fix-crash-with-different-number-of-Rx-Tx-q.patch	2022-11-03 09:27:25.493424764 +0000
@@ -1 +1 @@
-From 231435a5e6c7fa915697d8f84a91b44176bba4d1 Mon Sep 17 00:00:00 2001
+From 1ec58a78f5873eee1c4c10016db03ec685b2a112 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 231435a5e6c7fa915697d8f84a91b44176bba4d1 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index a574bce49e..5b5cae34ea 100644
+index 642c44d4ac..ee5292cc2b 100644
@@ -27 +28 @@
-@@ -1444,8 +1444,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
+@@ -1396,8 +1396,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
@@ -38 +39 @@
-@@ -1458,8 +1458,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
+@@ -1410,8 +1410,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)


More information about the stable mailing list