From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 66811A0518 for ; Fri, 24 Jul 2020 14:05:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F9E21C0CC; Fri, 24 Jul 2020 14:05:47 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id DAFBE1C0D4 for ; Fri, 24 Jul 2020 14:05:45 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id f2so8073664wrp.7 for ; Fri, 24 Jul 2020 05:05:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yoQH/GPK6a5nPOj99ALwxFORr5/Fer9QtuNzxLLjL80=; b=ObDy3bCKe8kv5XNxpy4sKAXvkcgZ5g7e3wUTIsvTywhizYt7UDa8PLSgdBSOgNXmaW vk9BWTL8ZYHF8Qnz3EBxmb1hxeq0aaf3Wvj5fkNP/ROsCbaWNHldKhypxTznFc7zcn0e mzsmvjT5MqVbBv02ocHyMPrc/TyAwVuo2cS8zeHCDuOBBYtOA+WELw55LksmUM/+XRgC KTRjAYn83XLjyoOSRfpr6wauobBdfmtTlq5IyRONNyDEAJ6ec7Pjl5LzMn51eKDdqsVK NXy1jKzKgRxI47JnJhi5I2taPzJ0giSPP2S0aLB+pAUdc9532WmHklVodrNhXNOLQXOa uN6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yoQH/GPK6a5nPOj99ALwxFORr5/Fer9QtuNzxLLjL80=; b=asIEp1DRSz0APVZyZZRYl5t9ykIYOvabu7dRRdUcVqCDu1egdaQZf8yGE9LyHvD/3A C9TjzYt4vSGmqk/iaoKI1SJJEYtCaYPqkB0GjjxYob6w7zj1Wcto6S2KNMHwr7RpFvQB 4BL9cN1mkMrMUHVixE3bMaFk6flM3EMEzNzpVrJPgvBi2930/M9Ms3kAwJtWdPjiZd0Y 1pwTF4lDhm0NR3OM0Lsqywc/E+D8kfbCY2zQnaOr/bMyYaiVcHliyI68VfiUo6zioBXT 7Gd9AajhoxntUDojGWq8C3H80PsabMz1hV6iCXyyTJPXMaY0tjtTBsDA5m+jIo+y83IF HL2w== X-Gm-Message-State: AOAM533I1ocav7eHr13dKjDxONSTINstLfkeV5lr/uVS3QjUR0NlOi35 +qrG4OwzQkQ4T5ndeI3Nek0= X-Google-Smtp-Source: ABdhPJxtnGlC7pqOZu9VpqZHLM+7RsQG1D6rHs7Vx2mDRQdcVcPwjhQAlr7q2zvxUzJqrWd86Njzcg== X-Received: by 2002:adf:c552:: with SMTP id s18mr2211932wrf.209.1595592345628; Fri, 24 Jul 2020 05:05:45 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id w7sm7249829wmc.32.2020.07.24.05.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:05:44 -0700 (PDT) From: luca.boccassi@gmail.com To: Pavan Nikhilesh Cc: dpdk stable Date: Fri, 24 Jul 2020 12:58:33 +0100 Message-Id: <20200724120030.1863487-75-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'event/octeontx2: fix device reconfigure' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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.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 07/26/20. 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. Thanks. Luca Boccassi --- >From c3b33b6d91e2e795d16cd90ddb2f5d316ecc052d Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Mon, 29 Jun 2020 07:03:26 +0530 Subject: [PATCH] event/octeontx2: fix device reconfigure [ upstream commit 8b787cba705323ba79e35e0f19bfba51ab6d953a ] When event device is re-configured maintain the event queue to event port links and event port status instead of resetting them. Fixes: cd24e70258bd ("event/octeontx2: add device configure function") Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx2/otx2_evdev.c | 60 +++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c index 2daeba42c..f7766812b 100644 --- a/drivers/event/octeontx2/otx2_evdev.c +++ b/drivers/event/octeontx2/otx2_evdev.c @@ -685,6 +685,46 @@ sso_clr_links(const struct rte_eventdev *event_dev) } } +static void +sso_restore_links(const struct rte_eventdev *event_dev) +{ + struct otx2_sso_evdev *dev = sso_pmd_priv(event_dev); + uint16_t *links_map; + int i, j; + + for (i = 0; i < dev->nb_event_ports; i++) { + links_map = event_dev->data->links_map; + /* Point links_map to this port specific area */ + links_map += (i * RTE_EVENT_MAX_QUEUES_PER_DEV); + if (dev->dual_ws) { + struct otx2_ssogws_dual *ws; + + ws = event_dev->data->ports[i]; + for (j = 0; j < dev->nb_event_queues; j++) { + if (links_map[j] == 0xdead) + continue; + sso_port_link_modify((struct otx2_ssogws *) + &ws->ws_state[0], j, true); + sso_port_link_modify((struct otx2_ssogws *) + &ws->ws_state[1], j, true); + sso_func_trace("Restoring port %d queue %d " + "link", i, j); + } + } else { + struct otx2_ssogws *ws; + + ws = event_dev->data->ports[i]; + for (j = 0; j < dev->nb_event_queues; j++) { + if (links_map[j] == 0xdead) + continue; + sso_port_link_modify(ws, j, true); + sso_func_trace("Restoring port %d queue %d " + "link", i, j); + } + } + } +} + static void sso_set_port_ops(struct otx2_ssogws *ws, uintptr_t base) { @@ -725,18 +765,15 @@ sso_configure_dual_ports(const struct rte_eventdev *event_dev) struct otx2_ssogws_dual *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(ws); - ws = NULL; - } - - /* Allocate event port memory */ - ws = rte_zmalloc_socket("otx2_sso_ws", + } else { + /* Allocate event port memory */ + ws = rte_zmalloc_socket("otx2_sso_ws", sizeof(struct otx2_ssogws_dual), RTE_CACHE_LINE_SIZE, event_dev->data->socket_id); + } if (ws == NULL) { otx2_err("Failed to alloc memory for port=%d", i); rc = -ENOMEM; @@ -1021,8 +1058,11 @@ otx2_sso_configure(const struct rte_eventdev *event_dev) return -EINVAL; } - if (dev->configured) + if (dev->configured) { sso_unregister_irqs(event_dev); + /* Clear any prior port-queue mapping. */ + sso_clr_links(event_dev); + } if (dev->nb_event_queues) { /* Finit any previous queues. */ @@ -1057,8 +1097,8 @@ otx2_sso_configure(const struct rte_eventdev *event_dev) goto teardown_hwggrp; } - /* Clear any prior port-queue mapping. */ - sso_clr_links(event_dev); + /* Restore any prior port-queue mapping. */ + sso_restore_links(event_dev); rc = sso_ggrp_alloc_xaq(dev); if (rc < 0) { otx2_err("Failed to alloc xaq to ggrp %d", rc); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:51.465454456 +0100 +++ 0075-event-octeontx2-fix-device-reconfigure.patch 2020-07-24 12:53:48.299006683 +0100 @@ -1,13 +1,14 @@ -From 8b787cba705323ba79e35e0f19bfba51ab6d953a Mon Sep 17 00:00:00 2001 +From c3b33b6d91e2e795d16cd90ddb2f5d316ecc052d Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Mon, 29 Jun 2020 07:03:26 +0530 Subject: [PATCH] event/octeontx2: fix device reconfigure +[ upstream commit 8b787cba705323ba79e35e0f19bfba51ab6d953a ] + When event device is re-configured maintain the event queue to event port links and event port status instead of resetting them. Fixes: cd24e70258bd ("event/octeontx2: add device configure function") -Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh --- @@ -15,10 +16,10 @@ 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c -index 630073de5..b8b57c388 100644 +index 2daeba42c..f7766812b 100644 --- a/drivers/event/octeontx2/otx2_evdev.c +++ b/drivers/event/octeontx2/otx2_evdev.c -@@ -725,6 +725,46 @@ sso_clr_links(const struct rte_eventdev *event_dev) +@@ -685,6 +685,46 @@ sso_clr_links(const struct rte_eventdev *event_dev) } } @@ -65,7 +66,7 @@ static void sso_set_port_ops(struct otx2_ssogws *ws, uintptr_t base) { -@@ -765,18 +805,15 @@ sso_configure_dual_ports(const struct rte_eventdev *event_dev) +@@ -725,18 +765,15 @@ sso_configure_dual_ports(const struct rte_eventdev *event_dev) struct otx2_ssogws_dual *ws; uintptr_t base; @@ -88,7 +89,7 @@ if (ws == NULL) { otx2_err("Failed to alloc memory for port=%d", i); rc = -ENOMEM; -@@ -1061,8 +1098,11 @@ otx2_sso_configure(const struct rte_eventdev *event_dev) +@@ -1021,8 +1058,11 @@ otx2_sso_configure(const struct rte_eventdev *event_dev) return -EINVAL; } @@ -101,7 +102,7 @@ if (dev->nb_event_queues) { /* Finit any previous queues. */ -@@ -1097,8 +1137,8 @@ otx2_sso_configure(const struct rte_eventdev *event_dev) +@@ -1057,8 +1097,8 @@ otx2_sso_configure(const struct rte_eventdev *event_dev) goto teardown_hwggrp; }