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 57D9CA0A02 for ; Mon, 17 May 2021 18:14:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 535784014E; Mon, 17 May 2021 18:14:40 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 8DB1440041 for ; Mon, 17 May 2021 18:14:38 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lift8-000853-Bt; Mon, 17 May 2021 16:14:38 +0000 From: Christian Ehrhardt To: Harman Kalra Cc: dpdk stable Date: Mon, 17 May 2021 18:08:50 +0200 Message-Id: <20210517161039.3132619-101-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> References: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'event/octeontx2: fix device reconfigure for single slot' has been queued to stable release 19.11.9 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/19/21. 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/13a95a034256e857808733c49222450991819585 Thanks. Christian Ehrhardt --- >From 13a95a034256e857808733c49222450991819585 Mon Sep 17 00:00:00 2001 From: Harman Kalra Date: Mon, 5 Apr 2021 21:54:15 +0530 Subject: [PATCH] event/octeontx2: fix device reconfigure for single slot [ upstream commit 340d22cdd14802de3f80859a940dfa178b0de7ca ] When device is re-configured, memory allocated for work slot is freed and new memory is allocated. Due to this we may loose some important configurations/mappings done with initial work slot memory. For example, whenever rte_event_eth_tx_adapter_queue_add is called some important meta i.e. txq handle is stored in work slot structure. If device gets reconfigured after this tx adaptor add, txq to work slot mapping will be lost resulting in seg fault during packet processing, as txq handle could not be retrieved from work slot. Fixes: 67b5f4686459 ("event/octeontx2: add port config functions") Signed-off-by: Harman Kalra --- drivers/event/octeontx2/otx2_evdev.c | 34 +++++++++++++--------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c index 5bdf23c362..6a0149b942 100644 --- a/drivers/event/octeontx2/otx2_evdev.c +++ b/drivers/event/octeontx2/otx2_evdev.c @@ -842,29 +842,27 @@ sso_configure_ports(const struct rte_eventdev *event_dev) struct otx2_ssogws *ws; uintptr_t base; - /* Free memory prior to re-allocation if needed */ if (event_dev->data->ports[i] != NULL) { ws = event_dev->data->ports[i]; - rte_free(ssogws_get_cookie(ws)); - ws = NULL; - } + } else { + /* Allocate event port memory */ + ws = rte_zmalloc_socket("otx2_sso_ws", + sizeof(struct otx2_ssogws) + + RTE_CACHE_LINE_SIZE, + RTE_CACHE_LINE_SIZE, + event_dev->data->socket_id); + if (ws == NULL) { + otx2_err("Failed to alloc memory for port=%d", + i); + rc = -ENOMEM; + break; + } - /* Allocate event port memory */ - ws = rte_zmalloc_socket("otx2_sso_ws", - sizeof(struct otx2_ssogws) + - RTE_CACHE_LINE_SIZE, - RTE_CACHE_LINE_SIZE, - event_dev->data->socket_id); - if (ws == NULL) { - otx2_err("Failed to alloc memory for port=%d", i); - rc = -ENOMEM; - break; + /* First cache line is reserved for cookie */ + ws = (struct otx2_ssogws *) + ((uint8_t *)ws + RTE_CACHE_LINE_SIZE); } - /* First cache line is reserved for cookie */ - ws = (struct otx2_ssogws *) - ((uint8_t *)ws + RTE_CACHE_LINE_SIZE); - ws->port = i; base = dev->bar2 + (RVU_BLOCK_ADDR_SSOW << 20 | i << 12); sso_set_port_ops(ws, base); -- 2.31.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-17 17:40:33.423445299 +0200 +++ 0101-event-octeontx2-fix-device-reconfigure-for-single-sl.patch 2021-05-17 17:40:29.307810548 +0200 @@ -1 +1 @@ -From 340d22cdd14802de3f80859a940dfa178b0de7ca Mon Sep 17 00:00:00 2001 +From 13a95a034256e857808733c49222450991819585 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 340d22cdd14802de3f80859a940dfa178b0de7ca ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index 770a801c4e..cdadbb2b21 100644 +index 5bdf23c362..6a0149b942 100644 @@ -28 +29 @@ -@@ -885,29 +885,27 @@ sso_configure_ports(const struct rte_eventdev *event_dev) +@@ -842,29 +842,27 @@ sso_configure_ports(const struct rte_eventdev *event_dev)