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 E9EA5A051C for ; Tue, 11 Feb 2020 12:42:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E26A01C025; Tue, 11 Feb 2020 12:42:13 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 237201C025 for ; Tue, 11 Feb 2020 12:42:12 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id g3so10868971wrs.12 for ; Tue, 11 Feb 2020 03:42:12 -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=graWVF2exFuEnVqJ3R/W3OtsVMntQnJk5rSRnvBEVRU=; b=vhabaI0tLjVbbGKJ82E/xfWtXdP+4ZecSb0O/63cHWwEmQXTwMw/Zb67lPo15Madr4 TMC4ltBKGK7cJRZIG0v3ZkLvpOC3xLZhSDuExqazuXG1SkuA11RlsGJY/kTJ+fwU+Uwk uY+cd1zjopQa2vHn/w+vz7kIiu6zbhKJfjp1ENSJ8CREvnDqWya9TvubDUxhXC3w2/VN lOvxiAHLp01FcKu5/t/iUXgjJcCH0ZQ3PpFTAsdIKZzekI2exi2i6dYdoeV+Z8rDRWcU fVRZie5VNjClerj0IkU0iaNpEO3ZFbMqFMqGa9AAnDl7DPzGrCMfRFVRb7JAavTIMhxJ 7CJA== 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=graWVF2exFuEnVqJ3R/W3OtsVMntQnJk5rSRnvBEVRU=; b=Xh/l/WbXYiwJEu4lmbNSttugKTSUJ8DYSq6tI+dDpI8WHAIOCZqsH1lhIPDNQUsQau KFPiMLDebStM7ru5xX2wgYcQlcL9AO6gydhkXPT8MtGe0Ta+ZB2Xo1YPLGjCbuLkYvHS 0UKewN3s5PhDTSkfjA07iwS9vCTKv673yX1YeCBJLMjqaLQXv9NHMuWV6mlhpMSWLscZ Zg40pwwA5Ef5f2P3BArjCuM/P4pnpB5kkpFtcwFD35Lww2eblZwJWH67rTlXUND0I23A IoVvqn8i9lHBRKKlL4ydZBGHItbLl73esD4yN38KInXJr+ZCSbseFGhlNjX06SEnKkXd tQzA== X-Gm-Message-State: APjAAAVHeEjLcQjuoc9CgB7O3zTw1nM6uHDgA6sW5eixxkNgpQ8sgCI4 Qvdl4U+xTB5ImbpjNPswpCBEcEzOx98= X-Google-Smtp-Source: APXvYqx1wPcZa/s8bRNVizCuRCIw2aKpIso6IGbc+sReZlh7lQ1e4KputzPIUnJMRCq/NpNOCglmHw== X-Received: by 2002:adf:806c:: with SMTP id 99mr7839082wrk.328.1581421331800; Tue, 11 Feb 2020 03:42:11 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id a13sm5044681wrp.93.2020.02.11.03.42.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:42:11 -0800 (PST) From: luca.boccassi@gmail.com To: Sunil Kumar Kori Cc: Harman Kalra , dpdk stable Date: Tue, 11 Feb 2020 11:21:56 +0000 Message-Id: <20200211112216.3929-170-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/octeontx: fix memory leak of MAC address table' has been queued to stable release 19.11.1 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.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/13/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 67b605bdbf61cfccdd4710b5ca2f34100af59e0e Mon Sep 17 00:00:00 2001 From: Sunil Kumar Kori Date: Wed, 29 Jan 2020 14:47:04 +0530 Subject: [PATCH] net/octeontx: fix memory leak of MAC address table [ upstream commit 9e399b88ce2f103165512d4005611a1f709deb1d ] MAC address table is allocated during octeontx device create and same is used to maintain list of MAC address associated to port. This table is not getting freed niether in case of error nor during graceful shutdown of port. Patch fixes memory required memory for both the cases as mentioned. Fixes: f18b146c498d ("net/octeontx: create ethdev ports") Signed-off-by: Sunil Kumar Kori Acked-by: Harman Kalra --- drivers/net/octeontx/octeontx_ethdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 679803dd4c..1d022e79a0 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -351,6 +351,10 @@ octeontx_dev_close(struct rte_eth_dev *dev) rte_free(txq); } + /* Free MAC address table */ + rte_free(dev->data->mac_addrs); + dev->data->mac_addrs = NULL; + dev->tx_pkt_burst = NULL; dev->rx_pkt_burst = NULL; } @@ -1099,7 +1103,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, octeontx_log_err("eth_dev->port_id (%d) is diff to orig (%d)", data->port_id, nic->port_id); res = -EINVAL; - goto err; + goto free_mac_addrs; } /* Update port_id mac to eth_dev */ @@ -1118,6 +1122,8 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, rte_eth_dev_probing_finish(eth_dev); return data->port_id; +free_mac_addrs: + rte_free(data->mac_addrs); err: if (nic) octeontx_port_close(nic); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:44.500458007 +0000 +++ 0170-net-octeontx-fix-memory-leak-of-MAC-address-table.patch 2020-02-11 11:17:38.804008901 +0000 @@ -1,8 +1,10 @@ -From 9e399b88ce2f103165512d4005611a1f709deb1d Mon Sep 17 00:00:00 2001 +From 67b605bdbf61cfccdd4710b5ca2f34100af59e0e Mon Sep 17 00:00:00 2001 From: Sunil Kumar Kori Date: Wed, 29 Jan 2020 14:47:04 +0530 Subject: [PATCH] net/octeontx: fix memory leak of MAC address table +[ upstream commit 9e399b88ce2f103165512d4005611a1f709deb1d ] + MAC address table is allocated during octeontx device create and same is used to maintain list of MAC address associated to port. This table is not getting freed niether in case of error nor during @@ -11,7 +13,6 @@ Patch fixes memory required memory for both the cases as mentioned. Fixes: f18b146c498d ("net/octeontx: create ethdev ports") -Cc: stable@dpdk.org Signed-off-by: Sunil Kumar Kori Acked-by: Harman Kalra @@ -20,7 +21,7 @@ 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c -index e23162d8a6..40d9d67dab 100644 +index 679803dd4c..1d022e79a0 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -351,6 +351,10 @@ octeontx_dev_close(struct rte_eth_dev *dev) @@ -34,7 +35,7 @@ dev->tx_pkt_burst = NULL; dev->rx_pkt_burst = NULL; } -@@ -1143,7 +1147,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, +@@ -1099,7 +1103,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, octeontx_log_err("eth_dev->port_id (%d) is diff to orig (%d)", data->port_id, nic->port_id); res = -EINVAL; @@ -43,7 +44,7 @@ } /* Update port_id mac to eth_dev */ -@@ -1162,6 +1166,8 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, +@@ -1118,6 +1122,8 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, rte_eth_dev_probing_finish(eth_dev); return data->port_id;