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 68FDFA0C47 for ; Tue, 10 Aug 2021 17:43:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6018E4014F; Tue, 10 Aug 2021 17:43:26 +0200 (CEST) Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) by mails.dpdk.org (Postfix) with ESMTP id A2D374014F for ; Tue, 10 Aug 2021 17:43:25 +0200 (CEST) Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPS id 8A6443F338 for ; Tue, 10 Aug 2021 15:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628610205; bh=FtcwHlxu5mG+RWOA50tVq6R1ITiSFngVFP/5jywLVaA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=imWeawN29aJJUQZhoLPhvEuHqfWf6uh2O4Gjr9zc6Dy8vaL4YdinSs9HhiDnF7lyB HezWDwl09UUPqVhM61xl3S7spfTeHVbQdpskjmzW7uyewUNqQAYEgb0sMJFmZxJvBa p11l422HfVbPT33yzplZUPokOBHL51mTblqdh85FFXza52WHY4OSF22TQ2AfZ7+fdT P1QZUo1ouKe3mFfkIcjwKOS3y/XR1Vm4C1DIXaqLCUgfiGRZzhg84vZDt++dWLKx9E wE/GDmjiM8qc/37hf24s6wyqTT3JFIYdKftyTPcpcjz6ahVmpS/afs6idHR6UnSItQ EKqWiYoY5Hv6Q== Received: by mail-ej1-f72.google.com with SMTP id q19-20020a1709064cd3b02904c5f93c0124so5735050ejt.14 for ; Tue, 10 Aug 2021 08:43:25 -0700 (PDT) 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=FtcwHlxu5mG+RWOA50tVq6R1ITiSFngVFP/5jywLVaA=; b=dKVRRmJqe5s7+GvQrLyqrmrGUCMKFS210pfc+esVwyWlLdpWgEIqOmk/UZbReDNZLo i9VkpWMaMqO5Bwj5W3g1z/p4ED39UNGnyF8IG7IFLNiqQs8rk9DBhB1WP9fv8C38s4He hE/3002UPc+/XO0iledsku5ink1mc5SzNiQEAKdJ3wWkceh59PrW6GYkrP8jnRlgxJI6 0yMWglC6jv9N/xRCDT4+cxi3H2clE3RKRAZZr56Uuuyp1Xbzf45e2ihtAU0wYb7Ca0DC 76QOstvtobvkGwnhMxdbIx1fEgjM7tE8flgJ7NGqU8J5WqId4ckka9nLB/wyyLv7zWi0 iK8w== X-Gm-Message-State: AOAM532Aha2aSBGM96ZbKf7fbtXYbryY2GzQoKzM718Swz5EmNh10N4L hPHXFtC9hr4yvFU5jeZDT0wOZWJBcn1HMPZHI6BX7LdhgJXDn/kIODZiQg6G6RFN2DrnzGdB+WR 8Eq+g0017szXZ7It0oCVK3951 X-Received: by 2002:aa7:de98:: with SMTP id j24mr5719889edv.139.1628610205070; Tue, 10 Aug 2021 08:43:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6hUJRVP8li+FL2Zq4xi8/OqpO3KidrlMJH9yzyxe6y0Dx08F8Sw+rSzpWZ42DqBGvrdhgBQ== X-Received: by 2002:aa7:de98:: with SMTP id j24mr5719864edv.139.1628610204914; Tue, 10 Aug 2021 08:43:24 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id v13sm6996976ejh.62.2021.08.10.08.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 08:43:24 -0700 (PDT) From: christian.ehrhardt@canonical.com To: David Marchand Cc: Haiyue Wang , dpdk stable Date: Tue, 10 Aug 2021 17:39:36 +0200 Message-Id: <20210810154022.749358-56-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810154022.749358-1-christian.ehrhardt@canonical.com> References: <20210810154022.749358-1-christian.ehrhardt@canonical.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 19.11.10 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 19.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/7d6ae8ccc63ae4030bf2eeaf11c1628c7cd9e2f6 Thanks. Christian Ehrhardt --- >From 7d6ae8ccc63ae4030bf2eeaf11c1628c7cd9e2f6 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 4e15ed54bf..4bd2bd39b1 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2195,7 +2195,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," @@ -2287,10 +2287,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.32.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-10 15:11:15.221385957 +0200 +++ 0056-net-ice-fix-memzone-leak-when-firmware-is-missing.patch 2021-08-10 15:11:13.050638331 +0200 @@ -1 +1 @@ -From 850989f9381902e36d44c2c4c7409ad703ef99cb Mon Sep 17 00:00:00 2001 +From 7d6ae8ccc63ae4030bf2eeaf11c1628c7cd9e2f6 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 4e15ed54bf..4bd2bd39b1 100644 @@ -60 +61 @@ -@@ -2069,7 +2069,7 @@ ice_dev_init(struct rte_eth_dev *dev) +@@ -2195,7 +2195,7 @@ ice_dev_init(struct rte_eth_dev *dev) @@ -69 +70 @@ -@@ -2159,10 +2159,11 @@ err_msix_pool_init: +@@ -2287,10 +2287,11 @@ err_msix_pool_init: