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 635D9431A0 for ; Thu, 19 Oct 2023 02:00:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D0F740EE7; Thu, 19 Oct 2023 02:00:59 +0200 (CEST) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mails.dpdk.org (Postfix) with ESMTP id 8C5D540EE7 for ; Thu, 19 Oct 2023 02:00:58 +0200 (CEST) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40806e4106dso1149385e9.1 for ; Wed, 18 Oct 2023 17:00:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697673658; x=1698278458; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4pWwkXEtqblix+5twX4OvwtPF+hep3m807gRS8h7Cw8=; b=kF4SgEmMsoXk+X9lXJQX41BZwhNaRIvVjKRolU9F04LCIBOS57MaUpl2ZrZNhLmGwb 20fowczQ9gqh3NVlX+HGCUxUYmtVN23/M4ymfknaeG5/y6NrUEfZ/CznGGv3zlSwEZiR yiCgwaBZoseNa1aa3xtaSyuhwI7pikNVI9B1W0BwaQlq1etNxLRWrKvGdRkhn66SmmeP 6ALn5oJhuapp2n/829j6yqv0LHg9BAZDrzHp84XvjhyxF2iaidHla7doZx08lTk7JxTP 0vcjVdT4uDOeNovH3hDLi+i/856Lby9RkjuHRm5f/Kkmc+eYuOfcT/SeDGkQbcmqfc0X G5WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697673658; x=1698278458; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4pWwkXEtqblix+5twX4OvwtPF+hep3m807gRS8h7Cw8=; b=YUD4TrtwMw5EqkfHjS3Osm701qgh4F5GhRyS7QAHUM66LXiaggF9qg3KIqpYMw67DA 27x3419SJTe2ZJI9mgbOGa4jcvAaWC3JUqE/HNmrtSJx0mIG3h6Ka0UVgMn4oOtDkFpf pAmeOFvAC0u1Jkb1oRSEsYtq9ArWTcU7FxAmx00jYcm6PLC/Bz1mVdBIwR8Q5FEAhvsn TuMOG+J7vMAuSQ9mHr+adsuL5RIAtIwW1hMWspu1Bcoi/dvrgVIXqJKleCvnkLlD/eWz 0iv8/d4Z2wt/TKnWdjIcZlgBMV2IybFtGHuHtuosCFPHETiWy3OEPDY6NvKt2OI/b6RL 5MlA== X-Gm-Message-State: AOJu0YxD3t0rGcatGThI43E57nbmKDgRT53sxLm43/0DbhF1/JgelFbG 5Og3WRq/t77lAc6Ey+/wsdY= X-Google-Smtp-Source: AGHT+IHUdK961pwN014l31PKcIBZX+xFcPLJBgYtbkujUqJw4h9KsBTAM6PFNbzlhlkdln1jClqKQg== X-Received: by 2002:a05:600c:5254:b0:405:409e:1fcb with SMTP id fc20-20020a05600c525400b00405409e1fcbmr279686wmb.5.1697673658217; Wed, 18 Oct 2023 17:00:58 -0700 (PDT) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id 1-20020a05600c028100b004077219aed5sm2872573wmk.6.2023.10.18.17.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 17:00:57 -0700 (PDT) From: luca.boccassi@gmail.com 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 20.11.10 Date: Thu, 19 Oct 2023 00:59:16 +0100 Message-Id: <20231018235930.3144-27-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018235930.3144-1-luca.boccassi@gmail.com> References: <20231018235930.3144-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 20.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/21/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/8e05122a9fa49b59af93ffdae1a0c82e24d808d9 Thanks. Luca Boccassi --- >From 8e05122a9fa49b59af93ffdae1a0c82e24d808d9 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 8d8cd04943..250c60fe6a 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.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-10-19 00:28:57.600093648 +0100 +++ 0027-event-sw-fix-ordering-corruption-with-op-release.patch 2023-10-19 00:28:56.265805790 +0100 @@ -1 +1 @@ -From 5078a8f37d82f3b54cf373389b6754e2bafd584f Mon Sep 17 00:00:00 2001 +From 8e05122a9fa49b59af93ffdae1a0c82e24d808d9 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 8d8cd04943..250c60fe6a 100644