From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 146B1C672 for ; Fri, 29 Jan 2016 15:08:43 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id r129so70125815wmr.0 for ; Fri, 29 Jan 2016 06:08:43 -0800 (PST) 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; bh=o4uo32LLlzJG992UiamLHfvMi/2HI6Z4ycmQyV4BPrw=; b=tw+N6VwOLCRvx/hdBBGW776yqR7JdR7j4YsDXM+xmEOc1To76QVYxPvG4w6FwqSDMa 1enUWaOFe84LT0hWH9phDSoTs14ozSgtHT0u2rpdKnempOTYch0SBrt/81P6dW2ncEk3 bSV2wBsRvPKQZRU1CPjoI6BAPUnw55CcOiv+IHiPCGSk/NgWkN5d7oCAIh12A1nhvxTp MkE/mt8anykI3gR1zMJ+uWM+2iObyIkhkFIWkbiot/CpElkEK+94LMPB2QGGL4WD8b9W 4lpp7khQUlqiXqCFbZGKAvhf9I/J3yw2ELsRyf3fFseyxU5jBR8d1UZIZtWDFALyPm8C KGCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o4uo32LLlzJG992UiamLHfvMi/2HI6Z4ycmQyV4BPrw=; b=jXUsam4SyMen5rcOgOS+3w33Z1xpR8HrcNDDPDHl410ka5ubCK80bUrUN49+0GQAOz IjIYVPvkMNB6bcrk19ckuEeuZper0GntjuZKGG0QU+EuvOCHTIiLLtDVGXK+lK1OB90p FkP/agxTH2GFnBEvO2KEdRkdhccC+srVfJo7DsqRnGPaMO4knx4CYQzudhFatnBk5R5M haFWMCaN1dt0/UUe+f6ypHnuPtJs7pNe5LlGhyU11E3VZkRcwUoJPPzUqRnMPQquSr17 J4WIu/Q55BI+YkRzcGdRDHcJrLR1hXDOFzRqo4r3SaEWMoDwSTVzkZj2BI+YVc8FTjhd v0hQ== X-Gm-Message-State: AG10YOTFqmQ6RMZoyFbMT2HZ59ZchN1ExGf7TxBrDzLVg4gQU11UH0EwazAKMGCm+z51wsYX X-Received: by 10.28.49.4 with SMTP id x4mr9712678wmx.63.1454076522937; Fri, 29 Jan 2016 06:08:42 -0800 (PST) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id 67sm7669944wmp.20.2016.01.29.06.08.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 06:08:42 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Fri, 29 Jan 2016 15:08:28 +0100 Message-Id: <1454076516-21591-2-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> Cc: viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH 1/9] pci: no need for dynamic tailq init X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 14:08:43 -0000 These lists can be initialized once and for all at build time. With this, those lists are only manipulated in a common place (and we could even make them private). A nice side effect is that pci drivers can now register in constructors. Signed-off-by: David Marchand --- lib/librte_eal/bsdapp/eal/eal_pci.c | 3 --- lib/librte_eal/common/eal_common_pci.c | 6 ++++-- lib/librte_eal/linuxapp/eal/eal_pci.c | 3 --- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 6c21fbd..4584522 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -483,9 +483,6 @@ int rte_eal_pci_write_config(const struct rte_pci_device *dev, int rte_eal_pci_init(void) { - TAILQ_INIT(&pci_driver_list); - TAILQ_INIT(&pci_device_list); - /* for debug purposes, PCI can be disabled */ if (internal_config.no_pci) return 0; diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index dcfe947..1e12776 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -82,8 +82,10 @@ #include "eal_private.h" -struct pci_driver_list pci_driver_list; -struct pci_device_list pci_device_list; +struct pci_driver_list pci_driver_list = + TAILQ_HEAD_INITIALIZER(pci_driver_list); +struct pci_device_list pci_device_list = + TAILQ_HEAD_INITIALIZER(pci_device_list); static struct rte_devargs *pci_devargs_lookup(struct rte_pci_device *dev) { diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index bc5b5be..a354f76 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -625,9 +625,6 @@ int rte_eal_pci_write_config(const struct rte_pci_device *device, int rte_eal_pci_init(void) { - TAILQ_INIT(&pci_driver_list); - TAILQ_INIT(&pci_device_list); - /* for debug purposes, PCI can be disabled */ if (internal_config.no_pci) return 0; -- 1.9.1