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 BF819A054C for ; Fri, 14 Feb 2020 18:05:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B7D90F72; Fri, 14 Feb 2020 18:05:26 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 67964F72 for ; Fri, 14 Feb 2020 18:05:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581699924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3jOwJLiE+JyO0OVBnxmLhLoOOlAKQPkbUzIIaVWXoO0=; b=SQL9vOA4zUnK1bn3/6dt1Skv9J2npfJKGjgqgqyCNlKJzN5GMw0veGcvUKTbkVqJlGdgY2 03t8mRLCuELEXzewst9j/QGE9pK8M4AxkV1QOWdyTeVyGOqbsbw63KE766CrfXO5+Q+UzY U+ep8c3IRDf35WLHdWbiHhD2K0iLW9o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-v_Fj0a1XMjOeeYa75mEVUA-1; Fri, 14 Feb 2020 12:05:21 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 22B54801E67; Fri, 14 Feb 2020 17:05:20 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEDAD89F3C; Fri, 14 Feb 2020 17:05:17 +0000 (UTC) From: Kevin Traynor To: Sunil Kumar Kori Cc: Harman Kalra , dpdk stable Date: Fri, 14 Feb 2020 17:03:20 +0000 Message-Id: <20200214170337.25093-26-ktraynor@redhat.com> In-Reply-To: <20200214170337.25093-1-ktraynor@redhat.com> References: <20200214170337.25093-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: v_Fj0a1XMjOeeYa75mEVUA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/octeontx: fix memory leak of MAC address table' has been queued to LTS release 18.11.7 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 LTS release 18.11.7 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/20/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 rebasi= ng (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/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/693ba0f9ed0df1e373= 1f11c19ba2452568edb64b Thanks. Kevin. --- >From 693ba0f9ed0df1e3731f11c19ba2452568edb64b 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 046e129865..ac193ace43 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -347,4 +347,8 @@ octeontx_dev_close(struct rte_eth_dev *dev) =09} =20 +=09/* Free MAC address table */ +=09rte_free(dev->data->mac_addrs); +=09dev->data->mac_addrs =3D NULL; + =09dev->tx_pkt_burst =3D NULL; =09dev->rx_pkt_burst =3D NULL; @@ -1082,5 +1086,5 @@ octeontx_create(struct rte_vdev_device *dev, int port= , uint8_t evdev, =09=09=09=09data->port_id, nic->port_id); =09=09res =3D -EINVAL; -=09=09goto err; +=09=09goto free_mac_addrs; =09} =20 @@ -1101,4 +1105,6 @@ octeontx_create(struct rte_vdev_device *dev, int port= , uint8_t evdev, =09return data->port_id; =20 +free_mac_addrs: +=09rte_free(data->mac_addrs); err: =09if (nic) --=20 2.21.1 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092020-02-14 17:02:38.487112707 +0000 +++ 0026-net-octeontx-fix-memory-leak-of-MAC-address-table.patch=092020-02-= 14 17:02:36.993407062 +0000 @@ -1 +1 @@ -From 9e399b88ce2f103165512d4005611a1f709deb1d Mon Sep 17 00:00:00 2001 +From 693ba0f9ed0df1e3731f11c19ba2452568edb64b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9e399b88ce2f103165512d4005611a1f709deb1d ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index e23162d8a6..40d9d67dab 100644 +index 046e129865..ac193ace43 100644 @@ -26 +27 @@ -@@ -352,4 +352,8 @@ octeontx_dev_close(struct rte_eth_dev *dev) +@@ -347,4 +347,8 @@ octeontx_dev_close(struct rte_eth_dev *dev) @@ -35 +36 @@ -@@ -1144,5 +1148,5 @@ octeontx_create(struct rte_vdev_device *dev, int por= t, uint8_t evdev, +@@ -1082,5 +1086,5 @@ octeontx_create(struct rte_vdev_device *dev, int por= t, uint8_t evdev, @@ -42 +43 @@ -@@ -1163,4 +1167,6 @@ octeontx_create(struct rte_vdev_device *dev, int por= t, uint8_t evdev, +@@ -1101,4 +1105,6 @@ octeontx_create(struct rte_vdev_device *dev, int por= t, uint8_t evdev,