From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 4C2F31B1A1 for ; Thu, 12 Oct 2017 10:21:51 +0200 (CEST) Received: by mail-wm0-f45.google.com with SMTP id i124so10778304wmf.3 for ; Thu, 12 Oct 2017 01:21:51 -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=RAneUNsXWnIWBgbnAQkHi4svgSjuA8z/WyM6gdrGw6Y=; b=l736UEwlm8nJjJOC9UWzWCFFZXOfkB5/v1+bCNKz0bbIN9fQLLhePBS51uqSSfsP/d P/o/KI0pZwbAW6lp1B/WHQi55B3EEzwdvdE+UaisjwFnIygqMugQyPieEalLejWKpczV SDzB3A7xX+IdAn93/ePiE39pZI+25VtGdWzM7aW4yEgmn8OR5GXLE/MrllvP1hagoCzo SqWIspZU/OaWQN/AOqvs4lhpGbWk6L8Q5sbGIQeb9t3/VjwGLQ5G8u0KiXF7IKYIPABm Quf55aeNNwRGx5inzzu9HYfWWX0CsjH4kes/DLaKTz3kRGf8e3wQ9GLKSXtBVCdi39XD 4LrQ== 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=RAneUNsXWnIWBgbnAQkHi4svgSjuA8z/WyM6gdrGw6Y=; b=RqAP8yZcMZbEnwSlrH1Kr9DAp2EwzFGdeg3pUpAqHbRsrYh4S2ypfyfd2FJKJjZ7Qg o4tUoswWShRK9p8she5HYwnViXfJQKEmlmo8rtOpN+MFc+0ZzNenztefB4sfn0YwzpwT lg8u8NOTLnM21+bJB7qp9XMP0wmXM1E0Jl+k4o4x58n2qp2qAdXZtL+anDL+N54KE63P po1tbiAUHcR3USq9T3k+yJSdMEIzXuJdBntZ+rvnbyfOPLcwpKuhnfmOrXF284Lm8SUJ aE4cdRZ+S14o7zLzanwPbEbwd+nbI7G0kT4NeYAd48w5uPxxEvkAC/AZH49WoQKElNeO 0iVA== X-Gm-Message-State: AMCzsaVcBsQujYdmP7xr44XlusjkT3idelbW3zfs6x4/JYmbDmvrllW5 MpG2vRjp8lJdAP6GXufuH7lZhNbz X-Google-Smtp-Source: AOwi7QAXfSdvpvfik5RDnCH9+O2jL7wKYAB/ebznExMlHQ4HgefQs/n2BM4bgCFQBII/w/YmkCOckw== X-Received: by 10.223.132.163 with SMTP id 32mr1226701wrg.218.1507796510591; Thu, 12 Oct 2017 01:21:50 -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 200sm19424728wmu.44.2017.10.12.01.21.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 01:21:49 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 12 Oct 2017 10:21:15 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 08/18] 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: Thu, 12 Oct 2017 08:21:51 -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 01ae0c7..0d693c8 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 614f1c5..0f81f22 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 6222677..5f4ad33 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -73,12 +73,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 576de56..9c0251e 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