From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id F204F1B512 for ; Fri, 30 Nov 2018 00:15:40 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:21:32 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW8n032075; Fri, 30 Nov 2018 01:15:37 +0200 From: Yongseok Koh To: Timothy Redaelli Cc: Rasesh Mody , dpdk stable Date: Thu, 29 Nov 2018 15:11:43 -0800 Message-Id: <20181129231202.30436-109-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'net/qede: fix crash when configure fails' has been queued to LTS release 17.11.5 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: , X-List-Received-Date: Thu, 29 Nov 2018 23:15:41 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/01/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From aebc3d7f39255c7dfc2f458baa8c63570c1bc5f0 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Fri, 9 Nov 2018 16:45:40 +0100 Subject: [PATCH] net/qede: fix crash when configure fails [ upstream commit 69d3e963e446be9c8d98638223589e8cdf44dd9e ] Currently, if configuration fails (for example if a 100G card is used with an odd number of RX/TX queues) QEDE crashes due to a null pointer dereference. This commit fixes it by checking that the pointer is not NULL before using it. Fixes: 7105b24f4bb8 ("net/qede: fix memory alloc for multiple port reconfig") Signed-off-by: Timothy Redaelli Acked-by: Rasesh Mody --- drivers/net/qede/qede_rxtx.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index ffe196a68..c88182be4 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -192,12 +192,13 @@ static void qede_rx_queue_release_mbufs(struct qede_rx_queue *rxq) void qede_rx_queue_release(void *rx_queue) { struct qede_rx_queue *rxq = rx_queue; - struct qede_dev *qdev = rxq->qdev; - struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); - - PMD_INIT_FUNC_TRACE(edev); + struct qede_dev *qdev; + struct ecore_dev *edev; if (rxq) { + qdev = rxq->qdev; + edev = QEDE_INIT_EDEV(qdev); + PMD_INIT_FUNC_TRACE(edev); qede_rx_queue_release_mbufs(rxq); qdev->ops->common->chain_free(edev, &rxq->rx_bd_ring); qdev->ops->common->chain_free(edev, &rxq->rx_comp_ring); @@ -356,12 +357,13 @@ static void qede_tx_queue_release_mbufs(struct qede_tx_queue *txq) void qede_tx_queue_release(void *tx_queue) { struct qede_tx_queue *txq = tx_queue; - struct qede_dev *qdev = txq->qdev; - struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); - - PMD_INIT_FUNC_TRACE(edev); + struct qede_dev *qdev; + struct ecore_dev *edev; if (txq) { + qdev = txq->qdev; + edev = QEDE_INIT_EDEV(qdev); + PMD_INIT_FUNC_TRACE(edev); qede_tx_queue_release_mbufs(txq); qdev->ops->common->chain_free(edev, &txq->tx_pbl); rte_free(txq->sw_tx_ring); -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 15:01:49.959471031 -0800 +++ 0109-net-qede-fix-crash-when-configure-fails.patch 2018-11-29 15:01:45.285958000 -0800 @@ -1,8 +1,10 @@ -From 69d3e963e446be9c8d98638223589e8cdf44dd9e Mon Sep 17 00:00:00 2001 +From aebc3d7f39255c7dfc2f458baa8c63570c1bc5f0 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Fri, 9 Nov 2018 16:45:40 +0100 Subject: [PATCH] net/qede: fix crash when configure fails +[ upstream commit 69d3e963e446be9c8d98638223589e8cdf44dd9e ] + Currently, if configuration fails (for example if a 100G card is used with an odd number of RX/TX queues) QEDE crashes due to a null pointer dereference. @@ -11,7 +13,6 @@ using it. Fixes: 7105b24f4bb8 ("net/qede: fix memory alloc for multiple port reconfig") -Cc: stable@dpdk.org Signed-off-by: Timothy Redaelli Acked-by: Rasesh Mody @@ -20,10 +21,10 @@ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c -index 8a4772f46..296189107 100644 +index ffe196a68..c88182be4 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c -@@ -235,12 +235,13 @@ static void qede_rx_queue_release_mbufs(struct qede_rx_queue *rxq) +@@ -192,12 +192,13 @@ static void qede_rx_queue_release_mbufs(struct qede_rx_queue *rxq) void qede_rx_queue_release(void *rx_queue) { struct qede_rx_queue *rxq = rx_queue; @@ -41,7 +42,7 @@ qede_rx_queue_release_mbufs(rxq); qdev->ops->common->chain_free(edev, &rxq->rx_bd_ring); qdev->ops->common->chain_free(edev, &rxq->rx_comp_ring); -@@ -399,12 +400,13 @@ static void qede_tx_queue_release_mbufs(struct qede_tx_queue *txq) +@@ -356,12 +357,13 @@ static void qede_tx_queue_release_mbufs(struct qede_tx_queue *txq) void qede_tx_queue_release(void *tx_queue) { struct qede_tx_queue *txq = tx_queue;