[dpdk-dev,v3,07/10] devargs: make devargs list private

Message ID 0cba341b51ad8533a4c8accf87e1171fac8595fd.1521587199.git.gaetan.rivet@6wind.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Gaëtan Rivet March 20, 2018, 11:20 p.m. UTC
  Initially, rte_devargs was meant to be populated once and sometimes
accessed, then never emptied.

With the new hotplug functionality having better standing, new usage
appeared with repeated addition of devices and their subsequent removal.

Exposing devargs_list pushed bus drivers and libraries to be careless
and inconsistent in their memory management. Making it private will
allow to rationalize this part of the EAL and ensure that fewer memory
leaks occur during operations.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/common/eal_common_devargs.c  | 3 +++
 lib/librte_eal/common/include/rte_devargs.h | 6 ------
 lib/librte_eal/rte_eal_version.map          | 1 -
 3 files changed, 3 insertions(+), 7 deletions(-)
  

Comments

Thomas Monjalon April 22, 2018, 9:46 p.m. UTC | #1
21/03/2018 00:20, Gaetan Rivet:
> Initially, rte_devargs was meant to be populated once and sometimes
> accessed, then never emptied.
> 
> With the new hotplug functionality having better standing, new usage
> appeared with repeated addition of devices and their subsequent removal.
> 
> Exposing devargs_list pushed bus drivers and libraries to be careless
> and inconsistent in their memory management. Making it private will
> allow to rationalize this part of the EAL and ensure that fewer memory
> leaks occur during operations.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> ---
>  lib/librte_eal/common/eal_common_devargs.c  | 3 +++
>  lib/librte_eal/common/include/rte_devargs.h | 6 ------
>  lib/librte_eal/rte_eal_version.map          | 1 -
>  3 files changed, 3 insertions(+), 7 deletions(-)

You must remove the related line in deprecation notice.
  

Patch

diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c
index c6c5eabcf..a7f374cfa 100644
--- a/lib/librte_eal/common/eal_common_devargs.c
+++ b/lib/librte_eal/common/eal_common_devargs.c
@@ -18,6 +18,9 @@ 
 #include <rte_tailq.h>
 #include "eal_private.h"
 
+/** user device double-linked queue type definition */
+TAILQ_HEAD(rte_devargs_list, rte_devargs);
+
 /** Global list of user devices */
 struct rte_devargs_list devargs_list =
 	TAILQ_HEAD_INITIALIZER(devargs_list);
diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h
index aba31481b..e48cc3cf2 100644
--- a/lib/librte_eal/common/include/rte_devargs.h
+++ b/lib/librte_eal/common/include/rte_devargs.h
@@ -59,12 +59,6 @@  struct rte_devargs {
 	char *args;
 };
 
-/** user device double-linked queue type definition */
-TAILQ_HEAD(rte_devargs_list, rte_devargs);
-
-/** Global list of user devices */
-extern struct rte_devargs_list devargs_list;
-
 /**
  * Parse a devargs string.
  *
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 02a040a8b..8dab46ba6 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -2,7 +2,6 @@  DPDK_2.0 {
 	global:
 
 	__rte_panic;
-	devargs_list;
 	eal_parse_sysfs_value;
 	eal_timer_source;
 	lcore_config;