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 2FC00A0C41 for ; Tue, 30 Nov 2021 17:40:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 289EC410F7; Tue, 30 Nov 2021 17:40:56 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id C812B410F7 for ; Tue, 30 Nov 2021 17:40:54 +0100 (CET) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (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 smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 969B43F1B1 for ; Tue, 30 Nov 2021 16:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290454; bh=FfNu9aPMtK4Ti4NoVpiid6eUvZ6OW9F1/eMaYwKkc9s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rD9cikaY03juVmVTI5KkF1CRHjCLjakSM1C/VbBooJEmQfN6pyTy8GYsRe+rPPNc0 +30o1u432Z94hk9GeLi4sI6fKN/m+U6UqADANSRbjFK8ZGHS8rQ+Jxpyu+IKUHOV8o FUWrzrSzy+ILWvFrUTGlisfw3hCkLk04gyYsDKwZ/s92vUADHxbnEwnwkzD7DTst8Z Sh46TaMNILLdddgNzt/kZRR2noDpzhTcpZ/GedUjupds/073Af7tKp5NEFkiNugqXj 2F8IldGODyC4pXMVL5yUYrSOgWIksrvFfy5FUXg43Vid+r75NXHxbf7C8OBfZj3Vcb +lCFHYRed6jhg== Received: by mail-ed1-f70.google.com with SMTP id w5-20020a05640234c500b003f1b9ab06d2so5325061edc.13 for ; Tue, 30 Nov 2021 08:40:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FfNu9aPMtK4Ti4NoVpiid6eUvZ6OW9F1/eMaYwKkc9s=; b=ILC0osTLgD3WJ4VYi4S25H5sg/GNVaMyDdu08p/RJ2EDnZPCfW/S+leM3eb5Aqh/y8 8VrQLoCoL/OwjPWBlTXEgArYYyPNV38Icthmz54eMm0iSZkvhz5YRmHb0RKt6PYB1oua XsjPgRbkVG0OXZvQOpsI/9PzGzkIA/KJVEHtr3VLRwk8XOpGfL/s0nUYLbNL/kpi97we VU2weyPmhcGzH6FmqTXeGLPHppviMnn7l5y96r1jLTIG0UaPkWIgW2IKGyHm2lpPR/GN tYFGN9Xyv6dF5lGvVJYXLDqGK5+EcM0MrBEBkdBf4Eyof3zan9fV3ORDQiPxZ143C9cX xjyA== X-Gm-Message-State: AOAM532meXh4cH54r/qfn5SGrEvoTBN4uIJ7WqKCXbw8YlYLxuN9mlBC O4ZAj+h82OwRraK6df+3vIRP1IIEWtOaCz5dTvpx2TxjzhhdriV1D83GQXcN77d8030Vx1F5gee ipr5ylyeW4Omo2rM0+9ZXGt2h X-Received: by 2002:aa7:d695:: with SMTP id d21mr90791edr.378.1638290454049; Tue, 30 Nov 2021 08:40:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLg8bmeMDxNZAfkcm80vjFMyW7o29bWEzwcWb63aW4BEuI9Qjl/zgutSpujcEzFMhaxVtn1Q== X-Received: by 2002:aa7:d695:: with SMTP id d21mr90773edr.378.1638290453913; Tue, 30 Nov 2021 08:40:53 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id gz26sm9213928ejc.100.2021.11.30.08.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:40:53 -0800 (PST) From: christian.ehrhardt@canonical.com To: Naga Harish K S V Cc: Jay Jayatheerthan , dpdk stable Subject: patch 'eventdev/eth_rx: fix WRR buffer overrun' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:34:55 +0100 Message-Id: <20211130163605.2460997-91-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.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 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/6ed91bcc60d1ce5b2779d3506a4806a22ab6e255 Thanks. Christian Ehrhardt --- >From 6ed91bcc60d1ce5b2779d3506a4806a22ab6e255 Mon Sep 17 00:00:00 2001 From: Naga Harish K S V Date: Mon, 18 Oct 2021 03:25:41 -0500 Subject: [PATCH] eventdev/eth_rx: fix WRR buffer overrun [ upstream commit 81da8a5ff440eda60635c849c9e9b3d253838da9 ] When a poll queue is removed from a rx_adapter instance, the WRR poll array is recomputed. The wrr array length is reduced in this case. The next wrr position to poll is stored in wrr_pos variable of rx_adapter instance. This wrr_pos can become invalid in some cases after wrr is recomputed. Using this variable to get the next queue and device pair may leed to wrr buffer overruns. Resetting the wrr_pos to zero after recomputation of wrr array fixes the buffer overrun issue. Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation") Signed-off-by: Naga Harish K S V Acked-by: Jay Jayatheerthan --- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c index 6303318943..d59b3dee6a 100644 --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c @@ -2244,6 +2244,11 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, rx_adapter->eth_rx_poll = rx_poll; rx_adapter->wrr_sched = rx_wrr; rx_adapter->wrr_len = nb_wrr; + /* + * reset next poll start position (wrr_pos) to avoid buffer + * overrun when wrr_len is reduced in case of queue delete + */ + rx_adapter->wrr_pos = 0; rx_adapter->num_intr_vec += num_intr_vec; if (dev_info->nb_dev_queues == 0) { -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:11.224143448 +0100 +++ 0091-eventdev-eth_rx-fix-WRR-buffer-overrun.patch 2021-11-30 16:50:05.886874235 +0100 @@ -1 +1 @@ -From 81da8a5ff440eda60635c849c9e9b3d253838da9 Mon Sep 17 00:00:00 2001 +From 6ed91bcc60d1ce5b2779d3506a4806a22ab6e255 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 81da8a5ff440eda60635c849c9e9b3d253838da9 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ - lib/eventdev/rte_event_eth_rx_adapter.c | 5 +++++ + lib/librte_eventdev/rte_event_eth_rx_adapter.c | 5 +++++ @@ -25,5 +26,5 @@ -diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c -index e570f2f085..f07dd4d822 100644 ---- a/lib/eventdev/rte_event_eth_rx_adapter.c -+++ b/lib/eventdev/rte_event_eth_rx_adapter.c -@@ -2739,6 +2739,11 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, +diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c +index 6303318943..d59b3dee6a 100644 +--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c ++++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c +@@ -2244,6 +2244,11 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id,