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 B8CD4A0524 for ; Fri, 5 Feb 2021 12:39:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF2CF4067B; Fri, 5 Feb 2021 12:39:16 +0100 (CET) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id BA81D4067B for ; Fri, 5 Feb 2021 12:39:15 +0100 (CET) Received: by mail-wr1-f46.google.com with SMTP id v15so7340953wrx.4 for ; Fri, 05 Feb 2021 03:39:15 -0800 (PST) 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=ioO+LJPeOjmUlynPTFxl7Cj4ispyBfPkhKIcEpj163A=; b=eYwrCWfaT9oLS6rs9GmsMZodbe60SiSLqH0aeWeqlxfbhyj5jq8dmrzRf3Desp+uq2 rbD/WBnexSGNfGHtdfieHpV7wXucMj271dj2gNLVa2NyPgE2wze3eRQFfxmpxma7u76Z nUIjwvgfFK5WHIWm5E20DC2YEjUSqY1hr9ZOwYFMUKNxx6x+j9nRT0YyDjWcgQakH68c pUjj5xGHPyPPVUWfYyRtdPGcNXc+Vbj+WxE4/NRweFSpwoGZHmO+e5XuoZm3l7OEWnQK 3hAUSei6jAPb+qQBHNhbUhMbAk4hWzp6jCH8CBWq8bjy9dE/LUdHucRX3u252hWUkSBg 12NQ== 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=ioO+LJPeOjmUlynPTFxl7Cj4ispyBfPkhKIcEpj163A=; b=nhm930QCtP5yrlNkV8qe16+vu/asP7wzvWHB5fDkEKEQOZtY55gqOU0jK5G6SNTTIs +8G8673T+yWFXsleDTcGf+dJIYu9W2/Ruy6cHgKg0H3/39cwC2iHKNPMLS+/yPkrgIwQ f7KNh/wmfiqOfPI8RD0M2WquWTZyhmtKSbU5IksZMLdYeNqW80X33kuWNYtgEp51gym2 ohlHPOSJoBS6GIQCIqS25KCOBdVfNasy8K+xl49WMmljLw8g6b0rqSqh7MBJLK27ftQM Qd7nHYKCiSGmdsgMb4vmjiNuLzOHsibo2K7rU3JLjPQGmL9CRhGB1/pWs7pNZF6fGDxj j0aQ== X-Gm-Message-State: AOAM5337n6hDhkhNb6wAdG9B6Y5pnmWbbdxBeFZrmlgsipbG+13jR0b0 OHZ7K7M4dc9iJmR9BzJht9P7aIk1I/I1x5un X-Google-Smtp-Source: ABdhPJzlMxq21H1/91gQQa5q/fKCBiNvyDLucEVXdrl+qI/AmzhTLcuPt0yDBphiiO+bTMwy5anyqA== X-Received: by 2002:a5d:68c1:: with SMTP id p1mr4547825wrw.325.1612525155495; Fri, 05 Feb 2021 03:39:15 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id z185sm9364908wmb.0.2021.02.05.03.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:39:14 -0800 (PST) From: luca.boccassi@gmail.com To: Lijun Ou Cc: dpdk stable Date: Fri, 5 Feb 2021 11:19:07 +0000 Message-Id: <20210205111920.1272063-261-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix memory leak on secondary process exit' has been queued to stable release 20.11.1 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/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/89796f0f761f83447edd0c26f1b93f79a7059b16 Thanks. Luca Boccassi --- >From 89796f0f761f83447edd0c26f1b93f79a7059b16 Mon Sep 17 00:00:00 2001 From: Lijun Ou Date: Fri, 22 Jan 2021 18:18:46 +0800 Subject: [PATCH] net/hns3: fix memory leak on secondary process exit [ upstream commit 4101114586e42e3dfb0dee2e5b054dee3074e63f ] The secondary process is applied a memory for the process_private during initialization. Therefore, the memory needs to be released when exiting. Fixes: c203571b3602 ("net/hns3: register and add log interface") Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_ethdev.c | 7 +++++-- drivers/net/hns3/hns3_ethdev_vf.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 03d6df716d..ac1c1c0c64 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -6226,8 +6226,11 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); - if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return -EPERM; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + rte_free(eth_dev->process_private); + eth_dev->process_private = NULL; + return 0; + } if (hw->adapter_state < HNS3_NIC_CLOSING) hns3_dev_close(eth_dev); diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 32e35dc463..291166c461 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1977,8 +1977,11 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) struct hns3_hw *hw = &hns->hw; int ret = 0; - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + rte_free(eth_dev->process_private); + eth_dev->process_private = NULL; return 0; + } if (hw->adapter_state == HNS3_NIC_STARTED) ret = hns3vf_dev_stop(eth_dev); @@ -2848,8 +2851,11 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(); - if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return -EPERM; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + rte_free(eth_dev->process_private); + eth_dev->process_private = NULL; + return 0; + } if (hw->adapter_state < HNS3_NIC_CLOSING) hns3vf_dev_close(eth_dev); -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:40.679668434 +0000 +++ 0261-net-hns3-fix-memory-leak-on-secondary-process-exit.patch 2021-02-05 11:18:29.302700555 +0000 @@ -1 +1 @@ -From 4101114586e42e3dfb0dee2e5b054dee3074e63f Mon Sep 17 00:00:00 2001 +From 89796f0f761f83447edd0c26f1b93f79a7059b16 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 4101114586e42e3dfb0dee2e5b054dee3074e63f ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index c5dccec5ae..b89bc48714 100644 +index 03d6df716d..ac1c1c0c64 100644 @@ -23 +24 @@ -@@ -6263,8 +6263,11 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev) +@@ -6226,8 +6226,11 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev) @@ -38 +39 @@ -index 063f2f5c2f..5bf8c2e8fd 100644 +index 32e35dc463..291166c461 100644 @@ -41 +42 @@ -@@ -1971,8 +1971,11 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) +@@ -1977,8 +1977,11 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) @@ -54 +55 @@ -@@ -2839,8 +2842,11 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev) +@@ -2848,8 +2851,11 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)