From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id BA5F5A3 for ; Fri, 8 Mar 2019 18:49:32 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 8 Mar 2019 19:49:28 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x28HloBE002625; Fri, 8 Mar 2019 19:49:26 +0200 From: Yongseok Koh To: Hari Kumar Vemula Cc: Honnappa Nagarahalli , Reshma Pattan , Pablo de Lara , dpdk stable Date: Fri, 8 Mar 2019 09:47:36 -0800 Message-Id: <20190308174749.30771-58-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190308174749.30771-1-yskoh@mellanox.com> References: <20190308174749.30771-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'efd: fix tail queue leak' has been queued to LTS release 17.11.6 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: , X-List-Received-Date: Fri, 08 Mar 2019 17:49:33 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objection by 03/13/19. So please shout if anyone has objection. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From 89fde90c4b00da356301aedd80bf70ce27a8e40a Mon Sep 17 00:00:00 2001 From: Hari Kumar Vemula Date: Fri, 18 Jan 2019 07:40:42 +0000 Subject: [PATCH] efd: fix tail queue leak [ upstream commit c749c032252997cf50cbe3620a7edd30532423af ] In rte_efd_create() allocated memory for tail queue entry but not freed. Added freeing the tail queue entry. Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Signed-off-by: Hari Kumar Vemula Reviewed-by: Honnappa Nagarahalli Acked-by: Reshma Pattan Acked-by: Pablo de Lara --- lib/librte_efd/rte_efd.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index 6b611b555..34e092098 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -769,6 +769,8 @@ void rte_efd_free(struct rte_efd_table *table) { uint8_t socket_id; + struct rte_efd_list *efd_list; + struct rte_tailq_entry *te, *temp; if (table == NULL) return; @@ -776,6 +778,18 @@ rte_efd_free(struct rte_efd_table *table) for (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++) rte_free(table->chunks[socket_id]); + efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); + rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + + TAILQ_FOREACH_SAFE(te, efd_list, next, temp) { + if (te->data == (void *) table) { + TAILQ_REMOVE(efd_list, te, next); + rte_free(te); + break; + } + } + + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); rte_ring_free(table->free_slots); rte_free(table->offline_chunks); rte_free(table->keys); -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-03-08 09:46:43.062100406 -0800 +++ 0058-efd-fix-tail-queue-leak.patch 2019-03-08 09:46:40.303403000 -0800 @@ -1,14 +1,15 @@ -From c749c032252997cf50cbe3620a7edd30532423af Mon Sep 17 00:00:00 2001 +From 89fde90c4b00da356301aedd80bf70ce27a8e40a Mon Sep 17 00:00:00 2001 From: Hari Kumar Vemula Date: Fri, 18 Jan 2019 07:40:42 +0000 Subject: [PATCH] efd: fix tail queue leak +[ upstream commit c749c032252997cf50cbe3620a7edd30532423af ] + In rte_efd_create() allocated memory for tail queue entry but not freed. Added freeing the tail queue entry. Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") -Cc: stable@dpdk.org Signed-off-by: Hari Kumar Vemula Reviewed-by: Honnappa Nagarahalli @@ -19,10 +20,10 @@ 1 file changed, 14 insertions(+) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c -index e6e5cfda2..1a97ece05 100644 +index 6b611b555..34e092098 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c -@@ -740,6 +740,8 @@ void +@@ -769,6 +769,8 @@ void rte_efd_free(struct rte_efd_table *table) { uint8_t socket_id; @@ -31,7 +32,7 @@ if (table == NULL) return; -@@ -747,6 +749,18 @@ rte_efd_free(struct rte_efd_table *table) +@@ -776,6 +778,18 @@ rte_efd_free(struct rte_efd_table *table) for (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++) rte_free(table->chunks[socket_id]);