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 EA405A0C47 for ; Mon, 26 Jul 2021 15:54:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E48AC410EF; Mon, 26 Jul 2021 15:54:56 +0200 (CEST) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mails.dpdk.org (Postfix) with ESMTP id 1CEA7410EA for ; Mon, 26 Jul 2021 15:54:55 +0200 (CEST) Received: by mail-wr1-f53.google.com with SMTP id r2so11242186wrl.1 for ; Mon, 26 Jul 2021 06:54:55 -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=wDqPvFu6WqGmXdbi+SOU2xI1A8wRTIX48IFP25/xOIc=; b=gpSs8t1p9KSzLJaJtXGcA0bFX1L/hOeAaUTqfTW0utOYmggfVZA64V8mx05yNVMbVX b+9bo+XFYlLasuINnYBZlkkljKxwI1JH2jml5SG3rY3xyrgXZW0VfxGMcwhS8E31ftfU S3nYV6q7xUZVoVGm3Nrk5nwyNoIvQLsHUQA9IiA3XopLnNI8kFvF/pl8eoda92f2PlLH t/1bzOsuERcr8YSqlqvHFwpLDi5ABIcpAO7yBiAr4CwFI9g9WC80crxm/g8ixB3WaJGW wikqtgsYMRT+N94trevHV5Forya11dkLPL9qFY5C8xssf4fB6TDwabxt/yk/xohucBwc 8JGw== 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=wDqPvFu6WqGmXdbi+SOU2xI1A8wRTIX48IFP25/xOIc=; b=tz8awti5j9L5TeST5Nf9WQQT+oQQN7ji1HTHN5WbvZsOcfGxetSK4eQKkHkyT1lPSz drwMf/jius2TNj6knh5XpAaYUO1jW2mqHwHDNB8MG8FQa63O6ifEkd2jsjUDNnmPOBit RYWrna3tFmh7B5p3gxPAPsbuEFPxYLXRB8LaY2IRvj+8RRYNAVb36NR4FuumN9txQf1I M0OpqrQdJ5NMC6t61waYm3WeS5NFh6dukPPQeoIZ1BUEoEUnXgHIPMLQE01QcamBQ5Wx I8zBXfCrBsVwtDql9k2Ox9K6fpLYw556gwzeRPkgS7Jv6qzega8Fvf0UoExxh76Pnmw+ DDwA== X-Gm-Message-State: AOAM530EZtAJ8J/hXRyy5TJC0i4Y6aUViNOQWFz9w25LZUYDPg/iXC4a b+fah4wJ3qFf8Y9zDcK2A0c= X-Google-Smtp-Source: ABdhPJyIBz1uJSYFH5CDDKrH1E6WM33FgRTU/otoeJO04vngEHnCrzT//BiwGIX1qr2BIR5zPIL5Jw== X-Received: by 2002:adf:ecc9:: with SMTP id s9mr13281316wro.306.1627307694848; Mon, 26 Jul 2021 06:54:54 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id s14sm25119778wmc.25.2021.07.26.06.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:54:54 -0700 (PDT) From: luca.boccassi@gmail.com To: Dmitry Kozlyuk Cc: Matan Azrad , dpdk stable Date: Mon, 26 Jul 2021 14:52:53 +0100 Message-Id: <20210726135322.149850-30-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726135322.149850-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> <20210726135322.149850-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix Rx/Tx queue checks' has been queued to stable release 20.11.3 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 20.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 07/28/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/a20d4d2506d1b91c2e1ed5c10261a77d2ab115e0 Thanks. Luca Boccassi --- >From a20d4d2506d1b91c2e1ed5c10261a77d2ab115e0 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlyuk Date: Tue, 20 Jul 2021 10:53:35 +0300 Subject: [PATCH] net/mlx5: fix Rx/Tx queue checks [ upstream commit 94e257ec8ca82a98e38ffb9e7c117a8aac554489 ] When device configuration was interrupted by a signal, mlx5_rxq/txq_release() could access yet unitinialized array and crash the application. Add checks whether queue array is initialized. Fixes: a1366b1a2be3 ("net/mlx5: add reference counter on DPDK Rx queues") Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues") Signed-off-by: Dmitry Kozlyuk Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 6207dae8b5..edf91254b1 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1782,7 +1782,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx) struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_rxq_ctrl *rxq_ctrl; - if (!(*priv->rxqs)[idx]) + if (priv->rxqs == NULL || (*priv->rxqs)[idx] == NULL) return 0; rxq_ctrl = container_of((*priv->rxqs)[idx], struct mlx5_rxq_ctrl, rxq); if (__atomic_sub_fetch(&rxq_ctrl->refcnt, 1, __ATOMIC_RELAXED) > 1) diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index c53af10d58..9ec7b57f1c 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -1238,7 +1238,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx) struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_txq_ctrl *txq_ctrl; - if (!(*priv->txqs)[idx]) + if (priv->txqs == NULL || (*priv->txqs)[idx] == NULL) return 0; txq_ctrl = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq); if (__atomic_sub_fetch(&txq_ctrl->refcnt, 1, __ATOMIC_RELAXED) > 1) -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-26 13:53:17.388961006 +0100 +++ 0030-net-mlx5-fix-Rx-Tx-queue-checks.patch 2021-07-26 13:53:15.861292875 +0100 @@ -1 +1 @@ -From 94e257ec8ca82a98e38ffb9e7c117a8aac554489 Mon Sep 17 00:00:00 2001 +From a20d4d2506d1b91c2e1ed5c10261a77d2ab115e0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 94e257ec8ca82a98e38ffb9e7c117a8aac554489 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index dacffc9251..4a8b67e731 100644 +index 6207dae8b5..edf91254b1 100644 @@ -26 +27 @@ -@@ -1712,7 +1712,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx) +@@ -1782,7 +1782,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx) @@ -36 +37 @@ -index f68c0c61a9..eb4d34ca55 100644 +index c53af10d58..9ec7b57f1c 100644 @@ -39 +40 @@ -@@ -1246,7 +1246,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx) +@@ -1238,7 +1238,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)