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 3AD8DA0093 for ; Fri, 22 May 2020 11:41:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3291F1D96A; Fri, 22 May 2020 11:41:19 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 88B001D96A for ; Fri, 22 May 2020 11:41:18 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id l11so9560185wru.0 for ; Fri, 22 May 2020 02:41:18 -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=fYdGfqUgRBvN9quI9EmVFZYLzoR02LOqxaI6VD4q2Ko=; b=TJwPeIZWMqpiKRqF0Ji2r9F3ds2DtDdAaJuCt11Vpx3Q2Jp10mIuSD7mIGXuXEoEWw TxLzpCfLz8phAX9agZafluBssbc5QdK/AVSxdmj8GZFqYvQLLgf4vMOY+jhgkaVmadg/ TaOPdXqdJVxVlZ+H0bgN/qaF6gyWLugVMRHE/6LZ0H/hlTNEJlg4JOIgR7xrdiNqojRn pl8bUFGHap6oUvzJhTGpLJbKbsffno4fjy5CrYb00sc1gBi5ySUf1BYRBChYaHC27YAm 5CkQvqXBnFgGybdxMtEvVSGmVOwv4DWcbuFZcgOGgTknOe5Mwm+wYGBy5uJDfEjne7Lk Og2A== 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=fYdGfqUgRBvN9quI9EmVFZYLzoR02LOqxaI6VD4q2Ko=; b=Wxqb+4FoyYRihpYuWimZbPS0lHhiD+E1KHEt5cr+w409V/dqy8PV1u1YXUGC5KI/Fe OgcliHfU0Cf58kPBI/7RrTnDWKQyyaFUn0JxW085Z/2poW18uxLqW0rgSj7CkDtE0j3c +yO6Hu6lfVjvt9m+Ha8jYxfj8s7QGdzrm5tn4X5SoB8Zg1OPdfKrSfUGozr9MfpVm9lx tQtir8S1yYAOXqgCtzwOegQsixr2i9m/NIfGWcA7HDNp41b5Tz7w1hKtJ1BS0jzZb+uZ tcOK530VAR0d1hU158vFP9Jmuu8s7Goe6lA7H1aQV7pLZ0LBrn9vufuH4XnLViqLD539 nszQ== X-Gm-Message-State: AOAM531obatcFKiK4/r4Wscj2YEIC1BPNFEMLXO7wh5UIIZYqnEjIOjt Kt8u3HUCu3vNmrQ8ENXnv+kAcmjP9Cg= X-Google-Smtp-Source: ABdhPJxye8HDmmyjpr1V50zVngB0KS/UxHQvf6D8rL7eWctOz6ydDTofxuDHTLnTaHOQWFHJ8sfS+w== X-Received: by 2002:adf:f0c3:: with SMTP id x3mr2618364wro.35.1590140478316; Fri, 22 May 2020 02:41:18 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id o15sm8774267wrw.65.2020.05.22.02.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 02:41:17 -0700 (PDT) From: luca.boccassi@gmail.com To: Xiaoyun Wang Cc: dpdk stable Date: Fri, 22 May 2020 10:39:56 +0100 Message-Id: <20200522094022.1025696-17-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200522094022.1025696-1-luca.boccassi@gmail.com> References: <20200519130549.112823-214-luca.boccassi@gmail.com> <20200522094022.1025696-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hinic: fix queues resource free' 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/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 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 --- 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 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@dpdk.org Signed-off-by: Xiaoyun Wang --- @@ -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++) {