From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 1894A7D5E for ; Fri, 25 Aug 2017 18:08:30 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id y71so1769553wmd.0 for ; Fri, 25 Aug 2017 09:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=lZkrYlyg7TVr16owf+RGWTOwVuOsffhGjejZhzY/EQ4=; b=1fgQNkY8BJaqQ4+TLVdaJMw5fgO68i0h12d3V9Jhr+iufX9rQarXMEifuxkdB3sJRm cK54vxrrK3w8jbiijwCVNR0CM/oBBzJOounXt3lv6kMGa2oxhTrQhqaDO0YL9Yh7oZBf qDu5zr3KDx8jLkWuVy4FoQyE2Df/16nUqKTvGLtToeEAwglWcio+NyfQaqT2JqvmqY6J k/w0Q+ZVAmheWxQ8uFT0mSM2SpWgtLW49x0IDWJ8bj7guG/OIZZBYdT7/iAuj5hftUXD wMbRguS4Bz/Nw33Cug4WBN++pXJj95SG6vVtwIPAMKMliN7Q+feqpdkJAaLjoga5LbiQ sm3Q== 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:in-reply-to:references; bh=lZkrYlyg7TVr16owf+RGWTOwVuOsffhGjejZhzY/EQ4=; b=GJqDESVzTQLPeZA02KZJSIf8rw5DXvG60Kf3105uQz+ZEJh50meeRZm7ug2Fd+5rBJ Dy+fZQc3yZqlZiaHMBTMw2ytUZ+uFEYyiZcXdJ6uYTTHyLr9hYnvA1CsUHskxLK/wAeC KM/fLLsCm46rlAfXco+tM3ytaZekt8DWuOwXyTC14eSWlW8oVPa60xp9C2TiLQipD6DC vrzP6n3r9GuSyJBuEryFgRWnB4A2jNwcrMUD6XwMhZ+KBCvtOsvI0xX0Gt724CKakWcq g75b52q/5xXNVzaK5CCt7F0plQMtA/Q4708xtQwO/E95w9rlKzn5k4EsZv88P1ZZiafU RpBQ== X-Gm-Message-State: AHYfb5iBXHWfshbLkJ4hunHRc0vYbJGgBV7WbQAeg/guz7NGqb22Uxek y1oEoqd/9xnHOMeML+I= X-Received: by 10.28.46.9 with SMTP id u9mr1605055wmu.131.1503677309494; Fri, 25 Aug 2017 09:08:29 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id h190sm1351661wmd.4.2017.08.25.09.08.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Aug 2017 09:08:28 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 25 Aug 2017 18:07:26 +0200 Message-Id: <76fe16eae3fb6f57f2272722a1d9af5a38221801.1503676587.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 6/6] devargs: make devargs_list private X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Aug 2017 16:08:30 -0000 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 --- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 - lib/librte_eal/common/eal_common_devargs.c | 3 +++ lib/librte_eal/common/include/rte_devargs.h | 6 ------ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 1 - 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 610db67..91621b1 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/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; diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index e0e47e8..2b20ce0 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -45,6 +45,9 @@ #include #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 5ca5a32..d07810f 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -86,12 +86,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/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index c1bc704..6595b64 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/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; -- 2.1.4