From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 49E702C4B for ; Wed, 20 Apr 2016 13:44:24 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id e201so47230879wme.0 for ; Wed, 20 Apr 2016 04:44:24 -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; bh=XlYikOYBFhNUzEkON+scz/0rlpF88vHlRM7yPCP6yM8=; b=nwV/TBQQt0iNb41KH1fC9BN7CJphhMeeW+mquJ0GZ30Ojhw+CBP1y/l6ln9viFpKQQ 5zAYY2jPoSH1xXPJkwSP7ltzTjlYs9cC699rpYieUljOLWZEN9Dw0eKg45x86YmW3X6f dU/2b2gmLMAvYHme8movryADiCpsRG2jJ5faHCjZcUbDMuEHgHAZ16XHFYGKvXqXaSFa DtZicw0rmGVtZTVTafsBXdd1Xx9PLjaq6QprahHW+b90w35ZcSI7kGGvP2m7gELPMHiZ oqnAJ6HlIQ4xlLy3Kb5BmZKaEmqLg9wzCNhYm35FuexjPcUF6q5OLVVsXQq/mEKjYCC/ OGnQ== 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=XlYikOYBFhNUzEkON+scz/0rlpF88vHlRM7yPCP6yM8=; b=ZHNWRb+YQSt9eBH5ZdG0fFMmyOq/PzC8iA5pwbcijgrwLLisFeVKZ//w/T2ovE0Koh e7x1edOr2Cc9w+ik2yxWXgAZQNH/wRqhbPtZ+KWaXRBB8QCWOEXQMbxQ+zX7KQHIGSTZ Ix3h/rB6fNCzGssjW765BUb0/yM777JOMuqP3RUXb9jU+iBpQ+hnmujeVKVIreV+UOMG avJ4raCq8YxgNOnoiZa3EtAYkMswCCVGo35s/+vCWYtPv4HPNVNaEyi7i8WGoQZnF3Ey YZQ13643jGo7sMvZ1kw132HoEB8TFpJk5fGoJY3VXO3+Nuy8DsfI8ubICPBoR+SkPlFX ie5Q== X-Gm-Message-State: AOPr4FWpvE8UpqoopFkWujbQZ7ATVHDv/6iNlq3dfmODcr2kP7fmdbMngqi6ldqemsPqbpAH X-Received: by 10.194.252.162 with SMTP id zt2mr2584300wjc.46.1461152663960; Wed, 20 Apr 2016 04:44:23 -0700 (PDT) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id m6sm5195708wje.21.2016.04.20.04.44.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2016 04:44:23 -0700 (PDT) From: David Marchand To: dev@dpdk.org Cc: thomas.monjalon@6wind.com, viktorin@rehivetech.com Date: Wed, 20 Apr 2016 13:44:01 +0200 Message-Id: <1461152657-19969-2-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461152657-19969-1-git-send-email-david.marchand@6wind.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> <1461152657-19969-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v2 01/17] 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: Wed, 20 Apr 2016 11:44:24 -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 Reviewed-by: Jan Viktorin --- 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 2d16d78..cd8e8d3 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -618,9 +618,6 @@ rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p) 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 40f4922..80d8ec6 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 dbf12a8..3fc82b0 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -731,9 +731,6 @@ rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p) 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