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 D058AA0C4C for ; Mon, 12 Jul 2021 15:15:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C25064119C; Mon, 12 Jul 2021 15:15:33 +0200 (CEST) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mails.dpdk.org (Postfix) with ESMTP id CA3EA4119D for ; Mon, 12 Jul 2021 15:15:32 +0200 (CEST) Received: by mail-wr1-f52.google.com with SMTP id f9so19900853wrq.11 for ; Mon, 12 Jul 2021 06:15:32 -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=KJ3wBkQdrlGeN9Hk7H86Ex/GrZtmS251Id/fV/yWmu8=; b=iy3+HSOOiAVpknQe36VicgfmJaD7r8fKJurBhwf05Ns4X/UaIXYy9AwgGvCyJAWTmZ yzTWuKpbc/UBMjo9mlIREomk2LwyDxNmn03ZCD3oSnEGvI1EHYKDvxJn61va54+roH/r c3PpS0Vsmeu5T2ERwtJ+IpSfLytll8CSO6nqaYRlt+HEky5TD1t0AD8QUnQWdodIgoJo 2BK24oQCIXMn3UtE2/OWsQBT235bGhAnVtRvE6gExzLOQy+fRTRCiG3fiwhZROF+eDM4 fNHxzApg6avhvROqzD/w9dtkNhP+kIEXArS9k87HwNZ12sNTEa0P+/Y38uq7eG4qQIni MqPg== 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=KJ3wBkQdrlGeN9Hk7H86Ex/GrZtmS251Id/fV/yWmu8=; b=olQut67CFHkyuWv8LgULj8044WKetN/tCp87bOF05DF2X+1olUp+dE/vP4y4Uri5ml 6kW20dpxFgowTkoJRN63chPTXdE4fU+J1MqHz7OCaCs1kEAf4FnaVkQfq8aYF57VcV92 k1IYT5hl1YSdVqS8dyStOgWHJ20Y1yVf1IGNbidHd41krf3R4VUX6NlsoO/OdkVlx+Zp bbhe5OGdPNPedOjqinNCRY7wFaXy9F0bGSA27kc93SntjyXMU9Q4vNjq8+LUnY96ONQt V2jiLcYNsJb7CvC8OwWQCdeSjnZZagOaiMORhi/byiffme/WwbN3V3XCci9ybpCapJMX ChsQ== X-Gm-Message-State: AOAM531dbp/xqInoGDbhIUhFHEKcqEimx34Aj5/lWAQGiMci1tmW4ISh 5qIWP/LAiCN2hRrgDcWmRBo= X-Google-Smtp-Source: ABdhPJz214R5k98vy9Q+MsTtX3+M4p9GliAkUv0bfwDH0emeSqP72ORZRH9prZpG8+60RI2y0QDnWA== X-Received: by 2002:a05:6000:178a:: with SMTP id e10mr6193207wrg.141.1626095732573; Mon, 12 Jul 2021 06:15:32 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id f130sm10225501wmf.23.2021.07.12.06.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:15:32 -0700 (PDT) From: luca.boccassi@gmail.com To: David Marchand Cc: Haiyue Wang , dpdk stable Date: Mon, 12 Jul 2021 14:05:39 +0100 Message-Id: <20210712130551.2462159-104-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice: fix memzone leak when firmware is missing' 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/14/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/6dd0f78f2c43f5fc5d1ddc58cc00be04c04121da Thanks. Luca Boccassi --- >From 6dd0f78f2c43f5fc5d1ddc58cc00be04c04121da Mon Sep 17 00:00:00 2001 From: David Marchand Date: Tue, 6 Jul 2021 16:12:37 +0200 Subject: [PATCH] net/ice: fix memzone leak when firmware is missing [ upstream commit 850989f9381902e36d44c2c4c7409ad703ef99cb ] Caught by our QE. When the firmware is missing, memzones were not released. $ dpdk-testpmd -c 0x1f -a 0:0:0.0 -- -i ... testpmd> dump_memzone ... Zone 6: name:, len:0x15040, virt:0x1661b24c0, socket_id:0, flags:0 physical segments used: addr: 0x140000000 iova: 0x140000000 len: 0x40000000 pagesz: 0x40000000 testpmd> port attach 0000:5e:00.0 Attaching a new port... EAL: Using IOMMU type 1 (Type 1) EAL: Probe PCI driver: net_ice (8086:159b) device: 0000:5e:00.0 (socket 0) ice_load_pkg(): failed to open file: /lib/firmware/intel/ice/ddp/ice.pkg ice_dev_init(): Failed to load the DDP package,Use safe-mode-support=1 to enter Safe Mode EAL: Releasing PCI mapped resource for 0000:5e:00.0 EAL: Calling pci_unmap_resource for 0000:5e:00.0 at 0x2200000000 EAL: Calling pci_unmap_resource for 0000:5e:00.0 at 0x2202000000 EAL: Driver cannot attach the device (0000:5e:00.0) EAL: Failed to attach device on primary process testpmd: Failed to attach port 0000:5e:00.0 testpmd> dump_memzone ... Zone 139: name:, len:0x1000, virt:0x1660ed800, socket_id:0, flags:0 physical segments used: addr: 0x140000000 iova: 0x140000000 len: 0x40000000 pagesz: 0x40000000 With 20 tries attaching a net/ice port, we would end up with: EAL: Probe PCI driver: net_ice (8086:159b) device: 0000:5e:00.0 (socket 0) EAL: memzone_reserve_aligned_thread_unsafe(): Number of requested memzone segments exceeds RTE_MAX_MEMZONE ice_dev_init(): Failed to initialize HW Fixes: a4c8c48fe3f4 ("net/ice: load OS default package") Signed-off-by: David Marchand Acked-by: Haiyue Wang --- drivers/net/ice/ice_ethdev.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 4234353455..c153c7ca78 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2186,7 +2186,7 @@ ice_dev_init(struct rte_eth_dev *dev) if (ad->devargs.safe_mode_support == 0) { PMD_INIT_LOG(ERR, "Failed to load the DDP package," "Use safe-mode-support=1 to enter Safe Mode"); - return ret; + goto err_init_fw; } PMD_INIT_LOG(WARNING, "Failed to load the DDP package," @@ -2278,10 +2278,11 @@ err_msix_pool_init: rte_free(dev->data->mac_addrs); dev->data->mac_addrs = NULL; err_init_mac: - ice_sched_cleanup_all(hw); - rte_free(hw->port_info); - ice_shutdown_all_ctrlq(hw); rte_free(pf->proto_xtr); +#ifndef RTE_EXEC_ENV_WINDOWS +err_init_fw: +#endif + ice_deinit_hw(hw); return ret; } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:42.008174293 +0100 +++ 0104-net-ice-fix-memzone-leak-when-firmware-is-missing.patch 2021-07-12 13:41:36.902131193 +0100 @@ -1 +1 @@ -From 850989f9381902e36d44c2c4c7409ad703ef99cb Mon Sep 17 00:00:00 2001 +From 6dd0f78f2c43f5fc5d1ddc58cc00be04c04121da Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 850989f9381902e36d44c2c4c7409ad703ef99cb ] + @@ -48 +49,0 @@ -Cc: stable@dpdk.org @@ -57 +58 @@ -index aec19b6521..a4cd39c954 100644 +index 4234353455..c153c7ca78 100644 @@ -60 +61 @@ -@@ -2069,7 +2069,7 @@ ice_dev_init(struct rte_eth_dev *dev) +@@ -2186,7 +2186,7 @@ ice_dev_init(struct rte_eth_dev *dev) @@ -69 +70 @@ -@@ -2159,10 +2159,11 @@ err_msix_pool_init: +@@ -2278,10 +2278,11 @@ err_msix_pool_init: