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 F2C0B8EA0 for ; Fri, 22 Jan 2016 16:27:52 +0100 (CET) Received: by mail-wm0-f45.google.com with SMTP id u188so23035036wmu.1 for ; Fri, 22 Jan 2016 07:27:52 -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=6ouNQg4yjo78cpbc+vYJcHeTaq7kDbCny5so66Es7bg=; b=Ptyr2PVrllIsYE/6XfAKvCgVDcK54V22hol6e4El5X5NXKO8pWIQ4Z5uhL13/F5qZv T3jM5OEvYATg7JKBns1efFpvy9h/3JcHEe3aUzcRPSDl8t+zUUTncdPLgHW9PfpYV+dB DjLdipiIgS/oxToqk6JuqMdQfyHBZ0Vl5vfwSRmtkNuGEHrMoeLKo1Bl0C/tdjEXzPGv OklUBtGcVxpgJll4bCNibbWUEMy6u27XSBly+V/8Ra3Pcsd9co3wYxOBG9pA97yiHIZi 1Z43TsQrQHWUgmdie5Iy2si+mvWe2ACa0uRmWhoBVryr5MTrXnNwvse7zge8FUDKoFai j78A== 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=6ouNQg4yjo78cpbc+vYJcHeTaq7kDbCny5so66Es7bg=; b=PL5yKGKcOJn7gPDdA8TKGiJ7j0B5DbazBoIrxk9L83WB6sIoS1bcdPMbvCl78DFq9d GaDlP84qjqpGENFky7xsVipvLzmj/H4e2xB/of83dV6u+yyHVrXwDBurYBJC0RaGdW0f Hq3yrk+/Fem0yDfPSTIs3s04tN8vCJ85BoPbtjYYFHfURpw7Rr/5SD5MBdGq2FB60jDJ B7igrtksm6gixFI20CrbR6pBBjVX7ovdHQUcsDmrwCqeFLf9ow7B/UJPIHuihP3YZEz2 zUchc8DfNjLNN5R9HVIaYU1bYdc8LRmD+6M3ENzDQ1c22PGaElt965M7r9H6sx0fyFw6 cY7w== X-Gm-Message-State: AG10YOQIPZspbVNkmQuIg2wKfMOuhvlanaqfvDozDAetSmZMMfPTcLA7Bw4G5NeWiYYc10jB X-Received: by 10.28.101.213 with SMTP id z204mr4053831wmb.57.1453476472819; Fri, 22 Jan 2016 07:27:52 -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 w73sm3359464wmw.21.2016.01.22.07.27.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jan 2016 07:27:52 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Fri, 22 Jan 2016 16:27:36 +0100 Message-Id: <1453476464-31767-2-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453476464-31767-1-git-send-email-david.marchand@6wind.com> References: <1453476464-31767-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, 22 Jan 2016 15:27:53 -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). 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