From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70FD14326F for ; Thu, 2 Nov 2023 14:14:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B11942DCE; Thu, 2 Nov 2023 14:14:11 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B6F6942DE1 for ; Thu, 2 Nov 2023 14:14:09 +0100 (CET) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-386-wuSYGFhHPmiMk-9m7zEELA-1; Thu, 02 Nov 2023 09:14:06 -0400 X-MC-Unique: wuSYGFhHPmiMk-9m7zEELA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CCB883816D97; Thu, 2 Nov 2023 13:14:05 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2941E492BFA; Thu, 2 Nov 2023 13:14:04 +0000 (UTC) From: Kevin Traynor To: Harry van Haaren Cc: Bruce Richardson , dpdk stable Subject: patch 'event/sw: fix ordering corruption with op release' has been queued to stable release 21.11.6 Date: Thu, 2 Nov 2023 13:11:46 +0000 Message-ID: <20231102131254.315947-40-ktraynor@redhat.com> In-Reply-To: <20231102131254.315947-1-ktraynor@redhat.com> References: <20231102131254.315947-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.6 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/08/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://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/77810d067de53ea224104a76e7a04bce12b0ecf8 Thanks. Kevin --- >From 77810d067de53ea224104a76e7a04bce12b0ecf8 Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Mon, 2 Oct 2023 11:58:35 +0100 Subject: [PATCH] event/sw: fix ordering corruption with op release [ 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 Signed-off-by: Harry van Haaren Acked-by: Bruce Richardson --- 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 95caebb418..2ee5d1b2d8 100644 --- a/drivers/event/sw/sw_evdev_scheduler.c +++ b/drivers/event/sw/sw_evdev_scheduler.c @@ -91,6 +91,8 @@ sw_schedule_atomic_to_cq(struct sw_evdev *sw, struct sw_qid * const qid, 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++; @@ -163,6 +165,8 @@ sw_schedule_parallel_to_cq(struct sw_evdev *sw, struct sw_qid * const qid, 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) @@ -414,5 +418,4 @@ __pull_port_lb(struct sw_evdev *sw, uint32_t port_id, int allow_reorder) hist_entry->rob_entry; - hist_entry->rob_entry = NULL; /* Although fragmentation not currently * supported by eventdev API, we support it -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-02 13:09:41.831012810 +0000 +++ 0040-event-sw-fix-ordering-corruption-with-op-release.patch 2023-11-02 13:09:40.840163422 +0000 @@ -1 +1 @@ -From 5078a8f37d82f3b54cf373389b6754e2bafd584f Mon Sep 17 00:00:00 2001 +From 77810d067de53ea224104a76e7a04bce12b0ecf8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 5078a8f37d82f3b54cf373389b6754e2bafd584f ] + @@ -21 +22,0 @@ -Cc: stable@dpdk.org @@ -31 +32 @@ -index 17953fde0e..a5fdcf301b 100644 +index 95caebb418..2ee5d1b2d8 100644