From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id AE024726F for ; Wed, 21 Mar 2018 00:20:42 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id 80so2323606wrb.2 for ; Tue, 20 Mar 2018 16:20:42 -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=uC1LtuU+NTix1WwFY2D1k0OKOlBANzIeBZjRjW3JQSw=; b=MhucOxZ+nAGzG8OSi0uKBWpDxq0ji+TVDb4irU2u57en+u2BqHjtaZmW32PzTvAyVH RHzrnKl8+wZ1Ssk9y/6AOk9ybXTbR/0MVSF8OWH7xr8KfsZYLd6Z3+gQJno1Fr9wBs6C 1XL++7NH9pa+4/yJ4osRiVUR7vE0ozOVA0qaeINITHzeuRCEX9qouKBlBwibWbhBqMep iinMoxxK5IetrJROKxg5kWWuFTV/fyLz+6wNraNYZ7lYAwlWwpExwqetESZk/WAl5cRZ 9HEYa5l5bpelYuQNK8oDU6Hc92kq5ufoyQeZ+MFns9iHtdpTPLmqf74DGjLbvuG/T7dY m7fg== 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=uC1LtuU+NTix1WwFY2D1k0OKOlBANzIeBZjRjW3JQSw=; b=oPYrBW49Mf1nuhYZQVDS9mwfQYvHOYZV2Xx2+ZTDLU1KtS8yH5ulKVBHgUwBsORZFM JFDZbGCML4UYzYCZaip9BUXnrBIoFf46XI8+O+LX+eSviC2ltnrGeBiij5X9c33Bj/Ap 3S6MYoAjRJGZJlEMB5SFA2x0oORncJ5AGiCPhwIhIbAA6YgVQBleySV8T++9z8VFpfHY rEaTW2o00ZBBrwW+8zY+SsuXEIYMgO1CnlC8ElbqRx7QXJxgd4ohvttnl7VwN/jFR1Gm 6L2N8j2iJ0r4AE4FCtBZ1RFDNtU01ba40Ps/TbeCtEinyhvDfSsWb8Sl7OGnkM4eDjv+ tC4A== X-Gm-Message-State: AElRT7Hv/aGCPEvJz+1M6qRJNIRf4eshGuT/vBmyj/C4U7QMvXUg+KfF yC0bos/L3kMb2QBslmD7gMzQHmc8 X-Google-Smtp-Source: AG47ELtiu7FAom9UmFeGmvszAIWJ5kyhqulUlYMqWTLe0cBjdB9hn/8VaF3AwZQnr4Sr5KgPXjUsMg== X-Received: by 10.223.173.197 with SMTP id w63mr15532094wrc.83.1521588041993; Tue, 20 Mar 2018 16:20:41 -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 m135sm3983479wma.2.2018.03.20.16.20.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 16:20:40 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 21 Mar 2018 00:20:08 +0100 Message-Id: <0cba341b51ad8533a4c8accf87e1171fac8595fd.1521587199.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 07/10] 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: Tue, 20 Mar 2018 23:20:42 -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/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(-) 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 #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; -- 2.11.0