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 55DE0A0093 for ; Tue, 19 May 2020 15:07:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4C4791D678; Tue, 19 May 2020 15:07:53 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id C1BEC1D672 for ; Tue, 19 May 2020 15:07:51 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id e1so15849004wrt.5 for ; Tue, 19 May 2020 06:07:51 -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=Bi/HouSAsGfhoClOT02dwDbl1uMrlZI/roOtqMR1FdU=; b=eHEZad6EcXVek9CUBaU6EAsT3peorOV2XWraOXzzBn+205t0gv4c2nZtLfOUNxWks6 ZSpROJa4nWiAnyYQ8sPU7SLgvkQAaj0j5kJ6KJMy9A099LyP0J0/ihLu/ZSp1cmcw4z3 I7DC+iBKvYZYdKKgHs/RtcGf66/6OTRQpy8gxS+cyW06ubCyTtPNxkjYg3aIMxLp+d7K R8L5fviPybezF+KsXQfNQvQYSALBhczVW67ln6bXYX/0V59slDe25HIZuEOaSDZe6441 BrU2J1vWEaMuznUUoGRCzwQJBPs+vcPkBFviM8vsOBPblmym6vIX2HblLZIWGJtfItMD o31Q== 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=Bi/HouSAsGfhoClOT02dwDbl1uMrlZI/roOtqMR1FdU=; b=ZyYAw4bX1ek/PvyJUEeh77MHh446GoA4gPIvCapVeduMDr5J8svd5B7j8NWKpFjJoD V1P+ANiiez3yK8I85EbDWb+WyJRZ5nIT718Op/9/AO0mnJ5kfzKuLqjN2jSYhXzwK/TF Yt5P3TmouJt2kKH/OM9Dxk5WZ2bFWd6aWWkmmeLkWYPOcvVp4IhzQDqPCc5CA3UYPhjC OfNpVY0rcoqTRkFQDp+qUMOmYbpqCvAtuVDdEL2gnZGXMm0WzkPalaevvSinqTPe5CFw B+Thww7BuzTFUTQXkNaJPU9sUpqNSRhHDhqQDTtyUhLlmqD3RK2Cuh4ncpTANe9W5jZU oZUg== X-Gm-Message-State: AOAM530K9km1J1hK6KlD5QMVXcwSzV41ZEJT8YRvxWIqYRSLlN8WZaFd T4nHuwmK3939hDeZQQINUggXWGGTu3uMpfM2 X-Google-Smtp-Source: ABdhPJw62G4sX2Xp9kPr/AZ2ytn6VKxZoNXLRnDX3sGTA6fKhf6SaaUd9bngs7xZW/dn2an0y3jK5g== X-Received: by 2002:a5d:650f:: with SMTP id x15mr25809829wru.100.1589893671508; Tue, 19 May 2020 06:07:51 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id m13sm3747757wmi.42.2020.05.19.06.07.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:07:50 -0700 (PDT) From: luca.boccassi@gmail.com To: Pavan Nikhilesh Cc: Jerin Jacob , dpdk stable Date: Tue, 19 May 2020 14:02:53 +0100 Message-Id: <20200519130549.112823-38-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/octeontx2: fix device configuration sequence' has been queued to stable release 19.11.3 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.3 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/21/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 8e8fdd68f75c227e51551ad9d1398b5e18e206c3 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Sat, 4 Apr 2020 20:49:50 +0530 Subject: [PATCH] net/octeontx2: fix device configuration sequence [ upstream commit b372fff7d490ba6f127de310bf52b3eb838267c8 ] When an application invokes rte_eth_dev_configure consecutively without setting up Rx/Tx queues, it will incorrectly return error while trying to restore Rx/Tx queue configuration. Fix configuration sequence by checking if any Rx/Tx queues are previously configured before trying to restore them. Fixes: 548b5839a32b ("net/octeontx2: add device configure operation") Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- drivers/net/octeontx2/otx2_ethdev.c | 16 ++++++++++++---- drivers/net/octeontx2/otx2_ethdev.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index c86165b5ec..e450a5ae01 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -1115,10 +1115,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev) txq = (struct otx2_eth_txq **)eth_dev->data->tx_queues; for (i = 0; i < nb_txq; i++) { if (txq[i] == NULL) { - otx2_err("txq[%d] is already released", i); - goto fail; + tx_qconf[i].valid = false; + otx2_info("txq[%d] is already released", i); + continue; } memcpy(&tx_qconf[i], &txq[i]->qconf, sizeof(*tx_qconf)); + tx_qconf[i].valid = true; otx2_nix_tx_queue_release(txq[i]); eth_dev->data->tx_queues[i] = NULL; } @@ -1126,10 +1128,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev) rxq = (struct otx2_eth_rxq **)eth_dev->data->rx_queues; for (i = 0; i < nb_rxq; i++) { if (rxq[i] == NULL) { - otx2_err("rxq[%d] is already released", i); - goto fail; + rx_qconf[i].valid = false; + otx2_info("rxq[%d] is already released", i); + continue; } memcpy(&rx_qconf[i], &rxq[i]->qconf, sizeof(*rx_qconf)); + rx_qconf[i].valid = true; otx2_nix_rx_queue_release(rxq[i]); eth_dev->data->rx_queues[i] = NULL; } @@ -1184,6 +1188,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev) * queues are already setup in port_configure(). */ for (i = 0; i < nb_txq; i++) { + if (!tx_qconf[i].valid) + continue; rc = otx2_nix_tx_queue_setup(eth_dev, i, tx_qconf[i].nb_desc, tx_qconf[i].socket_id, &tx_qconf[i].conf.tx); @@ -1199,6 +1205,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev) free(tx_qconf); tx_qconf = NULL; for (i = 0; i < nb_rxq; i++) { + if (!rx_qconf[i].valid) + continue; rc = otx2_nix_rx_queue_setup(eth_dev, i, rx_qconf[i].nb_desc, rx_qconf[i].socket_id, &rx_qconf[i].conf.rx, diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 483535ab12..fdc79633e4 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -192,6 +192,7 @@ struct otx2_eth_qconf { void *mempool; uint32_t socket_id; uint16_t nb_desc; + uint8_t valid; }; struct otx2_fc_info { -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:46.123128754 +0100 +++ 0038-net-octeontx2-fix-device-configuration-sequence.patch 2020-05-19 14:04:44.176647647 +0100 @@ -1,8 +1,10 @@ -From b372fff7d490ba6f127de310bf52b3eb838267c8 Mon Sep 17 00:00:00 2001 +From 8e8fdd68f75c227e51551ad9d1398b5e18e206c3 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Sat, 4 Apr 2020 20:49:50 +0530 Subject: [PATCH] net/octeontx2: fix device configuration sequence +[ upstream commit b372fff7d490ba6f127de310bf52b3eb838267c8 ] + When an application invokes rte_eth_dev_configure consecutively without setting up Rx/Tx queues, it will incorrectly return error while trying to restore Rx/Tx queue configuration. @@ -11,7 +13,6 @@ previously configured before trying to restore them. Fixes: 548b5839a32b ("net/octeontx2: add device configure operation") -Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob @@ -21,10 +22,10 @@ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c -index 19d32ba502..e10033ec57 100644 +index c86165b5ec..e450a5ae01 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c -@@ -1139,10 +1139,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev) +@@ -1115,10 +1115,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev) txq = (struct otx2_eth_txq **)eth_dev->data->tx_queues; for (i = 0; i < nb_txq; i++) { if (txq[i] == NULL) { @@ -39,7 +40,7 @@ otx2_nix_tx_queue_release(txq[i]); eth_dev->data->tx_queues[i] = NULL; } -@@ -1150,10 +1152,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev) +@@ -1126,10 +1128,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev) rxq = (struct otx2_eth_rxq **)eth_dev->data->rx_queues; for (i = 0; i < nb_rxq; i++) { if (rxq[i] == NULL) { @@ -54,7 +55,7 @@ otx2_nix_rx_queue_release(rxq[i]); eth_dev->data->rx_queues[i] = NULL; } -@@ -1208,6 +1212,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev) +@@ -1184,6 +1188,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev) * queues are already setup in port_configure(). */ for (i = 0; i < nb_txq; i++) { @@ -63,7 +64,7 @@ rc = otx2_nix_tx_queue_setup(eth_dev, i, tx_qconf[i].nb_desc, tx_qconf[i].socket_id, &tx_qconf[i].conf.tx); -@@ -1223,6 +1229,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev) +@@ -1199,6 +1205,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev) free(tx_qconf); tx_qconf = NULL; for (i = 0; i < nb_rxq; i++) { @@ -73,10 +74,10 @@ rx_qconf[i].socket_id, &rx_qconf[i].conf.rx, diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h -index 1bfcda2fca..0fbf68b8e0 100644 +index 483535ab12..fdc79633e4 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h -@@ -196,6 +196,7 @@ struct otx2_eth_qconf { +@@ -192,6 +192,7 @@ struct otx2_eth_qconf { void *mempool; uint32_t socket_id; uint16_t nb_desc;