[dpdk-stable] patch 'efd: fix tail queue leak' has been queued to LTS release 17.11.6

Yongseok Koh yskoh at mellanox.com
Fri Mar 8 18:47:36 CET 2019


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 <hari.kumarx.vemula at intel.com>
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 <hari.kumarx.vemula at intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
Acked-by: Reshma Pattan <reshma.pattan at intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
---
 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 <hari.kumarx.vemula at intel.com>
 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 at dpdk.org
 
 Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula at intel.com>
 Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
@@ -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]);
  


More information about the stable mailing list