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 EA10DA034F for ; Wed, 10 Nov 2021 07:42:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDF7D4014D; Wed, 10 Nov 2021 07:42:44 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2060.outbound.protection.outlook.com [40.107.236.60]) by mails.dpdk.org (Postfix) with ESMTP id 2B0014014D for ; Wed, 10 Nov 2021 07:42:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ll5h129S7tshQW59I88B5Bw54LJxhVKRcxjI4ZAOcI3xck5BsYd8ixUsKzFXTCpctTz7RpMZ1bC/XNKcrU3JKcUarkR88vT0DFF9cji6XOQSopv+OzUDB66OrWKrOWagLDlN8UED0jtaS8sSQNY9SL0/jAfwo3XNgyATxznjRuJuSMLfl/Je8XH2Kb0NS9d9PJOND92Zn93uJvHmXdne4xSVzPEBuItVybZikBuz2dg7bc+03O9jVlc0PPgiPGHF2w3aHAapWxceuTxYbJ0CEA717TjCj1OPyLOodHwfMdY8n0QWhNe8a0xQP0FD50INAc3p4D4hCFXlhv7Xdrrs1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=h7d96ODczDEYaLQt1yIga3eMAZzRPVEXQVRTiuBlBI8=; b=PBsgOjNBtQNUkvGT6M//slPNfXfJs0yp1ij8dgTynxjq9tUsI5Skb5OYD54UxUlH6ay1ML8AbGUjSREHmADtyl3oO0jqxM61lB1NwejpBmbnqo8WlpjmS9zTSXleLXJqodmE4Z1iUKel4qHpnZgciYlXy3adf23YXchN3VDanQbW0Vwdv+hLNR4Li/f1WIk2qQrNwxeIxa7vvq//RoNxvKbTir0Qa3vWMumJHzwNmX95NYNgAbJy25fUTjSkk6QCkgeE/FYSBkdM37Z6KTV7T25WBKyJirJe9d02psEgVkolWjYF+3UmRz8wG0ZTj00wrj95z7FYY7JXLwDweZsHww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h7d96ODczDEYaLQt1yIga3eMAZzRPVEXQVRTiuBlBI8=; b=Rjlh9dYknyveuNn1ps7ZPXF5oThfsyMwmtx5PtgYVXg/ZU4LqDKqiZMlNyiqARVr3EnArx3wxPLzokI7HQ9VO/A/d7Yft9S72r7jbpYQhLfcJeS2S21sLAg9HWcWihzWUTlEewNz4gvxh29zyGG7cvb1TV99RQlbXTVm8pS5Kc7wes1oVArnTM6hhBY5Qd7NlkNMQzbFxAScYvXwxe6FrPTmJJGn/4vnbhliS9HQVZvSoI1iySjez5ukKnCElkcbYiVRaXiQhsGc7gHzqf+qD/Mq2dm8U5HSuVItbze89EsECp18eb2lP6KsCKkaMX9vvUXZ/fhDzYSZCfNOuALqEA== Received: from DM6PR06CA0073.namprd06.prod.outlook.com (2603:10b6:5:336::6) by DM5PR1201MB0041.namprd12.prod.outlook.com (2603:10b6:4:56::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Wed, 10 Nov 2021 06:42:42 +0000 Received: from DM6NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:5:336:cafe::82) by DM6PR06CA0073.outlook.office365.com (2603:10b6:5:336::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:42:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT004.mail.protection.outlook.com (10.13.172.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:42:41 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:42:36 +0000 From: Xueming Li To: Qiming Chen CC: Luca Boccassi , Qi Zhang , dpdk stable Date: Wed, 10 Nov 2021 14:29:38 +0800 Message-ID: <20211110063216.2744012-95-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c3e5a71-b451-4117-5dbc-08d9a4154b6e X-MS-TrafficTypeDiagnostic: DM5PR1201MB0041: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S9wWBXD3sNPurPR5/7Mx/3DI97At979to7dUxZDuLcptHwi1GcEVACzu+RAnJFh13UeT1PbHlamiPXxlo0OH2O0WapVRoyRpYNGx83Vyl2dyTxLi8l0X8m3Zq2+I+kGYkcsv/00lI4kadx0gIspANhStFm9LsjZnHGQ0Ss8PWhVUaqq04tSBUUwzL37ov5OGqV7iDvyNdEq33TpEQV2N9jFenJpd6TJPFmfemJ1HY8HsU3VDIhGEwud00wy+rDeT0Ho/C9cVPsQKM5/+6/Am0y6QgMqPQD9QhsljJqTePvdvcg7y3u92DdBVVJGaUvPHlVsyWR68agkJO2ApOB25fRF2xH4nPlPkArZhZXzExvRKI49bjV4DcdiUYAg3fw6JNcJvk2qRecTHcan4AH+zv/lODFWco8TOtlnLtNJ0nGXXtDXxZcLDXOK2PuCFT1rtpxEQ+JpH5QpDbBkEFRNs5jqIKCTSdBivoB5NKQwd0+ITsa0zd2nJIc4Cbtke7t9l6p8kB0hOSRGpgKkTUEOq9xNTdRa1q3SQhG4Xxk12oUspNTMv37Wu/rWpY9tQnsBobMJZjbmhH3Lm03/1eqeYxU/a0Z99zL8AWnvcl4vzk1S02KXAlUJR0VlKVtxHEAz20OPTZzqpRrMTCYbVtgVn9CSZYcjOc8v/3pgM/koMpnE9MahtxlXBffCMGhuTemH4TX1sCDYQ/BtuchbH+8v1QqX0VLNb5BrC5ndj47gSaYsob582bHbogSrIgTtDZBk08a54+MdAgxOEPQOZSTRJTGihhbeXFhGE2ErJsxZHzC+GTL5nbIlg8NNLUCkfgCPwSGp6BDhH7SichGKfXnbmRg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(336012)(2616005)(8676002)(5660300002)(4001150100001)(6286002)(53546011)(36860700001)(36756003)(6916009)(1076003)(316002)(2906002)(4326008)(86362001)(356005)(82310400003)(70586007)(508600001)(966005)(55016002)(54906003)(186003)(16526019)(8936002)(7696005)(26005)(70206006)(19627235002)(47076005)(83380400001)(7636003)(426003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:42:41.5339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c3e5a71-b451-4117-5dbc-08d9a4154b6e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0041 Subject: [dpdk-stable] patch 'net/iavf: fix Rx queue IRQ resource leak' has been queued to stable release 20.11.4 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.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/eca9795521b483007ed13c06affb580921cbab09 Thanks. Xueming Li --- >From eca9795521b483007ed13c06affb580921cbab09 Mon Sep 17 00:00:00 2001 From: Qiming Chen Date: Fri, 10 Sep 2021 14:54:57 +0800 Subject: [PATCH] net/iavf: fix Rx queue IRQ resource leak Cc: Xueming Li [ upstream commit ad5629de9a7ba367886c6619a1eeb56c36fd2748 ] In the iavf_config_rx_queues_irqs function, the memory pointed to by the intr_handle->intr_vec and qv_map addresses is not released in the subsequent hook branch, resulting in resource leakage. Fixes: f593944fc988 ("net/iavf: enable IRQ mapping configuration for large VF") Signed-off-by: Qiming Chen Acked-by: Qi Zhang --- drivers/net/iavf/iavf_ethdev.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 885b2a4bd0..6bc3108631 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -509,7 +509,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, if (!qv_map) { PMD_DRV_LOG(ERR, "Failed to allocate %d queue-vector map", dev->data->nb_rx_queues); - return -1; + goto qv_map_alloc_err; } if (!dev->data->dev_conf.intr_conf.rxq || @@ -594,7 +594,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, if (!vf->lv_enabled) { if (iavf_config_irq_map(adapter)) { PMD_DRV_LOG(ERR, "config interrupt mapping failed"); - return -1; + goto config_irq_map_err; } } else { uint16_t num_qv_maps = dev->data->nb_rx_queues; @@ -604,7 +604,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, if (iavf_config_irq_map_lv(adapter, IAVF_IRQ_MAP_NUM_PER_BUF, index)) { PMD_DRV_LOG(ERR, "config interrupt mapping for large VF failed"); - return -1; + goto config_irq_map_err; } num_qv_maps -= IAVF_IRQ_MAP_NUM_PER_BUF; index += IAVF_IRQ_MAP_NUM_PER_BUF; @@ -612,10 +612,20 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, if (iavf_config_irq_map_lv(adapter, num_qv_maps, index)) { PMD_DRV_LOG(ERR, "config interrupt mapping for large VF failed"); - return -1; + goto config_irq_map_err; } } return 0; + +config_irq_map_err: + rte_free(vf->qv_map); + vf->qv_map = NULL; + +qv_map_alloc_err: + rte_free(intr_handle->intr_vec); + intr_handle->intr_vec = NULL; + + return -1; } static int -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:06.199417331 +0800 +++ 0094-net-iavf-fix-Rx-queue-IRQ-resource-leak.patch 2021-11-10 14:17:01.850746254 +0800 @@ -1 +1 @@ -From ad5629de9a7ba367886c6619a1eeb56c36fd2748 Mon Sep 17 00:00:00 2001 +From eca9795521b483007ed13c06affb580921cbab09 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit ad5629de9a7ba367886c6619a1eeb56c36fd2748 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index c004e72486..5a5a7f59e1 100644 +index 885b2a4bd0..6bc3108631 100644 @@ -23 +25 @@ -@@ -676,7 +676,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, +@@ -509,7 +509,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, @@ -32 +34 @@ -@@ -761,7 +761,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, +@@ -594,7 +594,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, @@ -41 +43 @@ -@@ -771,7 +771,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, +@@ -604,7 +604,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, @@ -50 +52 @@ -@@ -779,10 +779,20 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, +@@ -612,10 +612,20 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,