[dpdk-stable] patch 'net/hinic: fix queues resource free' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri May 22 11:39:56 CEST 2020


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/24/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 b191e329751d9256389187bbdde8a8435ad69fd5 Mon Sep 17 00:00:00 2001
From: Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>
Date: Thu, 14 May 2020 17:29:16 +0800
Subject: [PATCH] net/hinic: fix queues resource free

[ upstream commit a2177d2e84c32fafb23f5863ef16ef1bf082d18f ]

Adds tx_queues and rx_queues non-null judgment before free tx or
rx resources, because some app may set tx_queues or rx_queues to
be null before call free resource interfaces, which may cause
a segfault.

Fixes: 64727024d2fd ("net/hinic: add device initialization")

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>
---
 drivers/net/hinic/hinic_pmd_rx.c | 3 ++-
 drivers/net/hinic/hinic_pmd_tx.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hinic/hinic_pmd_rx.c b/drivers/net/hinic/hinic_pmd_rx.c
index 224337ddd9..8572780c62 100644
--- a/drivers/net/hinic/hinic_pmd_rx.c
+++ b/drivers/net/hinic/hinic_pmd_rx.c
@@ -413,7 +413,8 @@ void hinic_free_all_rx_resources(struct rte_eth_dev *eth_dev)
 				HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
 
 	for (q_id = 0; q_id < nic_dev->num_rq; q_id++) {
-		eth_dev->data->rx_queues[q_id] = NULL;
+		if (eth_dev->data->rx_queues != NULL)
+			eth_dev->data->rx_queues[q_id] = NULL;
 
 		if (nic_dev->rxqs[q_id] == NULL)
 			continue;
diff --git a/drivers/net/hinic/hinic_pmd_tx.c b/drivers/net/hinic/hinic_pmd_tx.c
index 64ec2c1198..a919417277 100644
--- a/drivers/net/hinic/hinic_pmd_tx.c
+++ b/drivers/net/hinic/hinic_pmd_tx.c
@@ -1185,7 +1185,8 @@ void hinic_free_all_tx_resources(struct rte_eth_dev *eth_dev)
 				HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
 
 	for (q_id = 0; q_id < nic_dev->num_sq; q_id++) {
-		eth_dev->data->tx_queues[q_id] = NULL;
+		if (eth_dev->data->tx_queues != NULL)
+			eth_dev->data->tx_queues[q_id] = NULL;
 
 		if (nic_dev->txqs[q_id] == NULL)
 			continue;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-22 10:37:39.881800978 +0100
+++ 0017-net-hinic-fix-queues-resource-free.patch	2020-05-22 10:37:39.104412284 +0100
@@ -1,15 +1,16 @@
-From a2177d2e84c32fafb23f5863ef16ef1bf082d18f Mon Sep 17 00:00:00 2001
+From b191e329751d9256389187bbdde8a8435ad69fd5 Mon Sep 17 00:00:00 2001
 From: Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>
 Date: Thu, 14 May 2020 17:29:16 +0800
 Subject: [PATCH] net/hinic: fix queues resource free
 
+[ upstream commit a2177d2e84c32fafb23f5863ef16ef1bf082d18f ]
+
 Adds tx_queues and rx_queues non-null judgment before free tx or
 rx resources, because some app may set tx_queues or rx_queues to
 be null before call free resource interfaces, which may cause
 a segfault.
 
 Fixes: 64727024d2fd ("net/hinic: add device initialization")
-Cc: stable at dpdk.org
 
 Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>
 ---
@@ -18,7 +19,7 @@
  2 files changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/net/hinic/hinic_pmd_rx.c b/drivers/net/hinic/hinic_pmd_rx.c
-index 4ca74f0fb2..a49769a863 100644
+index 224337ddd9..8572780c62 100644
 --- a/drivers/net/hinic/hinic_pmd_rx.c
 +++ b/drivers/net/hinic/hinic_pmd_rx.c
 @@ -413,7 +413,8 @@ void hinic_free_all_rx_resources(struct rte_eth_dev *eth_dev)
@@ -32,10 +33,10 @@
  		if (nic_dev->rxqs[q_id] == NULL)
  			continue;
 diff --git a/drivers/net/hinic/hinic_pmd_tx.c b/drivers/net/hinic/hinic_pmd_tx.c
-index 258f2c1c4a..996e0b26ff 100644
+index 64ec2c1198..a919417277 100644
 --- a/drivers/net/hinic/hinic_pmd_tx.c
 +++ b/drivers/net/hinic/hinic_pmd_tx.c
-@@ -1217,7 +1217,8 @@ void hinic_free_all_tx_resources(struct rte_eth_dev *eth_dev)
+@@ -1185,7 +1185,8 @@ void hinic_free_all_tx_resources(struct rte_eth_dev *eth_dev)
  				HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);
  
  	for (q_id = 0; q_id < nic_dev->num_sq; q_id++) {


More information about the stable mailing list