patch 'event/sw: fix ordering corruption with op release' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Sun Oct 22 16:21:31 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.4

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/15/23. 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=22.11-staging

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 1b7fb134d97b1a890af0380d733c0e48e7ae61b4 Mon Sep 17 00:00:00 2001
From: Harry van Haaren <harry.van.haaren at intel.com>
Date: Mon, 2 Oct 2023 11:58:35 +0100
Subject: [PATCH] event/sw: fix ordering corruption with op release
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 5078a8f37d82f3b54cf373389b6754e2bafd584f ]

This commit changes the logic in the scheduler to always
reset reorder-buffer (and QID/FID) entries when writing
them. This avoids stale ROB/QID/FID data re-use, which
previously caused ordering issues.

Before this commit, release events left the history-list
in an inconsistent state, and future events with op type of
forward could be incorrectly reordered.

There was a partial fix previously committed which is now
being resolved for all cases in a more general way, hence
the two fixlines here.

Fixes: 2e516d18dc01 ("event/sw: fix events mis-identified as needing reorder")
Fixes: 617995dfc5b2 ("event/sw: add scheduling logic")

Suggested-by: Bruce Richardson <bruce.richardson at intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/event/sw/sw_evdev_scheduler.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c
index 7de1c39dc0..25f97c4ffb 100644
--- a/drivers/event/sw/sw_evdev_scheduler.c
+++ b/drivers/event/sw/sw_evdev_scheduler.c
@@ -90,8 +90,10 @@ sw_schedule_atomic_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
 		sw->cq_ring_space[cq]--;

 		int head = (p->hist_head++ & (SW_PORT_HIST_LIST-1));
-		p->hist_list[head].fid = flow_id;
-		p->hist_list[head].qid = qid_id;
+		p->hist_list[head] = (struct sw_hist_list_entry) {
+			.qid = qid_id,
+			.fid = flow_id,
+		};

 		p->stats.tx_pkts++;
 		qid->stats.tx_pkts++;
@@ -162,8 +164,10 @@ sw_schedule_parallel_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,
 		qid->stats.tx_pkts++;

 		const int head = (p->hist_head & (SW_PORT_HIST_LIST-1));
-		p->hist_list[head].fid = SW_HASH_FLOWID(qe->flow_id);
-		p->hist_list[head].qid = qid_id;
+		p->hist_list[head] = (struct sw_hist_list_entry) {
+			.qid = qid_id,
+			.fid = SW_HASH_FLOWID(qe->flow_id),
+		};

 		if (keep_order)
 			rob_ring_dequeue(qid->reorder_buffer_freelist,
@@ -413,7 +417,6 @@ __pull_port_lb(struct sw_evdev *sw, uint32_t port_id, int allow_reorder)
 				struct reorder_buffer_entry *rob_entry =
 						hist_entry->rob_entry;

-				hist_entry->rob_entry = NULL;
 				/* Although fragmentation not currently
 				 * supported by eventdev API, we support it
 				 * here. Open: How do we alert the user that
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-10-22 22:17:36.672379100 +0800
+++ 0062-event-sw-fix-ordering-corruption-with-op-release.patch	2023-10-22 22:17:34.286723700 +0800
@@ -1 +1 @@
-From 5078a8f37d82f3b54cf373389b6754e2bafd584f Mon Sep 17 00:00:00 2001
+From 1b7fb134d97b1a890af0380d733c0e48e7ae61b4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 5078a8f37d82f3b54cf373389b6754e2bafd584f ]
@@ -21 +23,0 @@
-Cc: stable at dpdk.org
@@ -31 +33 @@
-index 17953fde0e..a5fdcf301b 100644
+index 7de1c39dc0..25f97c4ffb 100644


More information about the stable mailing list