From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id C91B210B7 for ; Tue, 24 Apr 2018 00:41:43 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id q3-v6so35450673wrj.6 for ; Mon, 23 Apr 2018 15:41:43 -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=iidNb71aq7wqB3Xq8hEjZf1YiKAYSgAwlGo00csvfRg=; b=rcg8R/uUiOvmtrrnGlf4JQle/XpuwJae1yjZmykmtmeDC2B8nDpI8X9s9xs+j9/nB0 FcFULZFJsQ2ZLJu/id15r8EKUZWu8WN7I/fDbf72IrEwekjqwDbX4W+9ka5Fyer/E6BB 06/awZc38pFJ2b1KngdfmyOIElU0VZTVWYilqH67ve6pATd0NVbykesTJFRzCdwGI6GT DzLFxCvm1jq/4NfhPC5v1VgdY3pwgKbI2OImx/kksaNiu8GcRRcLmGBl6C1lZGY3j0NL kO4zZ841+tIs27SDJ0gYx8dPpF3yB9Y8CjBGex4eLiXV15AMZv20NpSRVerCcPY9reqC A8sQ== 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=iidNb71aq7wqB3Xq8hEjZf1YiKAYSgAwlGo00csvfRg=; b=Pi9xMjkTq/wsCcHuisYGYKdA15AH+JDEa7PdvBbOEAx6XvQbxVZkiCX6lcXwxMm8Nu 1Xu/RafD4X0p7w1kDsKmZuZXj2KcKp4LKpZ9Db2v/oqGPYimxui/sr7fxz6gk1sDLkSz uo2KBxEz6BTkjMOw0vfOMAMYxkt6JlNnG3KlO3hxcKUCx3DEuJudF0ZN4c5Rxp1LHZIx hjcOS3vx/MO+HI8JgMCRrBv9AzYtkUiABDII/3jCFxioWW66ixyMAXvEzlQYyMEf/oJP vIqurUAEeoL23I+ai2icD5Y4MCPVCo6meqwkaXzf+cNa0ytJ8IuLlZ80Ggi77bl0SM+L 0Z9g== X-Gm-Message-State: ALQs6tAUkb99ZZMJJP7msI3aH7CTfm27KXXcO6E7Z3P3/E5HT3+KGjHp tceiVJUvQSfm0Xz4H0ZCc4mLrQRZ X-Google-Smtp-Source: AIpwx4+8zBx9BLWWOoNu2mm4U8D0jcq9Io/sFojT2M8HLR6Wfyt+iySi9XavQmzPaCU1myiKRMEFUw== X-Received: by 10.28.147.8 with SMTP id v8mr11490387wmd.13.1524523303176; Mon, 23 Apr 2018 15:41:43 -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 x189sm1590705wmg.0.2018.04.23.15.41.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 15:41:42 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 24 Apr 2018 00:41:07 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 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: Mon, 23 Apr 2018 22:41:44 -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 74c779068..4054fc111 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