From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0049.outbound.protection.outlook.com [104.47.37.49]) by dpdk.org (Postfix) with ESMTP id 3A54B72FD for ; Tue, 20 Sep 2016 14:42:14 +0200 (CEST) Received: from BN6PR03CA0058.namprd03.prod.outlook.com (10.173.137.20) by CY1PR0301MB2010.namprd03.prod.outlook.com (10.164.2.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Tue, 20 Sep 2016 12:42:12 +0000 Received: from BY2FFO11FD053.protection.gbl (2a01:111:f400:7c0c::106) by BN6PR03CA0058.outlook.office365.com (2603:10b6:404:4c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8 via Frontend Transport; Tue, 20 Sep 2016 12:42:12 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD053.mail.protection.outlook.com (10.1.15.190) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Tue, 20 Sep 2016 12:42:11 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u8KCexsU006559; Tue, 20 Sep 2016 05:42:08 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Tue, 20 Sep 2016 18:11:14 +0530 Message-ID: <1474375296-26078-3-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131188489320044788; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(356003)(8666005)(50226002)(5660300001)(575784001)(229853001)(50466002)(50986999)(48376002)(2351001)(626004)(86362001)(97736004)(76176999)(7846002)(92566002)(189998001)(5003940100001)(110136003)(104016004)(305945005)(19580395003)(105606002)(85426001)(47776003)(586003)(19580405001)(36756003)(68736007)(2906002)(11100500001)(106466001)(81156014)(87936001)(8676002)(33646002)(2950100001)(77096005)(81166006)(4326007)(8936002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB2010; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD053; 1:0S7msFF9noe9Oh6JC2agvm2AbUgjt2Ckq4FQlmI+g+whNo7u6XPHsXyMHDgFHdwstHAnY9H5meKJz+3sChW5dQRB9rNDA79nHRsACuIWnX4/bUfA49JxY7cLUumdjhzAl09TmW0LPl2DekI4EYun2ZcNQwjFGzOZT5lw3BpXO9pTzYkGVXJQH14IkouylINnG28pGPAg+nH7yrfc2sdQ18eUzscWpYQoEkLVFrwQ+uiSS3nBGCSBIc96IvmIPXZAOKareTfuqd0ypBuwMuuITZAxNJkn4UT2JW7o7CUgzGSGLYqpCUUdAkRnseMA/nHFhUnolFm4a8vHVvhf4yBvOcFGCUS47MRQBhgkcSXVMhTVqfhMnflP3J5EvVt3V+AQeMMYlXoLUAlI5TAdbBkT0B1B7JoDZNteZf0I29hqTJoAM1TDKU7jOFBQxmYaYZ3kg5tedeDS5gpf8BAxEyrr2B1//tlDr3Y0wJqfjrigAfepUqkRFrKPmElju5nzjeATLXENHm5KkPOXvD1LCDOXPqueGaCiB584cbd8Vw9Wf9OtMYQglc7b0mr/pTA82imEjF6xjRDOjvYQ0axTM69TbelS1UbEm94YwIjlrTgZu9ThlGDJ5xZtYbQ6WqmREF4Wd8VrTmJO7q3d0Tszucffz2y861bXugdJm7zCwfyXFaJLLIFjQNVBKTnhLiOyASfQgrbDPx9fkP9ixn8QrR3eJ/xOy4S1nUmZbZQC9dFMzIo= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 341e21c7-8ef6-4530-37e7-08d3e1538aff X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2010; 2:qyeh20ceJrDQ+lpd/Ngqt0EoOy9+uDLJ7k3v1QXJPIhHOkONPlYrwJTM0/4W1iY8+3MSTJcoB3iTfiRp6BL9jj53qRFdi4cIEOEDskocaSOOrEgild7Hw5CyDvA4hw6EdfxzSOujXVTxVBt9HWRXlFZjZ+1CnCQv7im770nhriO7HTI7GvfxhvlJhVJH1n5r; 3:bEvF6YajY9p21XpheyOQZYrAj6ib07oUfyV/EXC+R/T8UCWwayxIWnVhmxz4e0W2384C89SbRYEdio1COJGtq8NFitaalEyMQjwus+wPUSL6dWTBpgwm0ogD339G7LfXWnypp9QdA2tHccJLMrCXFd85sEQ+C++0GxP3G+ccHY7L33fKErShAN8sI1W9GA48dC+FJAa5FU+sKqsQq4qfJcaAOJ02EQ6k6jlqlCXQqWk= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB2010; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB2010; 25:/dd6EPmmtQfn8cmOBlQ2f/pbk9/NuMOinhAcmnVbPAUx8LM14g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n5yBCG49S7eXcAKToibNb9sUzqHAXVb2Ci9ya4S8xf4qBCyZjRrNDPQtW3/uXryOr9x4ej38hBXgQA2r7MpAsa4L3ptIaFt7/BgoCfsUsENBi0jYqM0Y6Qq0RkXZBZ+DmQ8QR3iRnD8MZls5oXFT+cGk7blZ5ku60oqnBPY/UvbibEkwkvfKIELOKxvt8bc8lHnoAzIta9IMSNWMFYy66QCZoD30ToHdLPY/Xh20Rd6ryELDQFLW/5fQimkcj+1lhovrts7UctZlOFlfVUwhbON33a4xAQKXpDPrCy0eBpOA9eQIKCqfrLkVsTpa2gmS84oDefIvehXQkwZKhWYl8K82TG4tKKWvv2Acvt1lUtGumNGptBiBzIgpamF8s/gL7cCo0vo1iprYdg44PXn08Fusf+/8oqWtN/qBVyoWAmXVFtPcgMiLAnaTp8rFSs3u3PHoB34coNPfI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13018025)(13017025)(13015025)(13023025)(13024025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY1PR0301MB2010; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB2010; X-Forefront-PRVS: 0071BFA85B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB2010; 23:1g3suITfk3RBrM0DVOY3uOHLeSDqGIyTNHcUyDy?= =?us-ascii?Q?S3QDASCreydEIaNdC7z8ydOQ3hTCGuRCFI9TWB6WYPkBju1aUYjjeMt4U9yn?= =?us-ascii?Q?AjWxjo/Q+xXKbX/Kg0JMPswjFhv/BCkHHyBC7L1+8aY+2hRViCJ17Q7QmOEi?= =?us-ascii?Q?mVuLG5i5g+mx2Sw7CVSg3eI+6GA1dEGK62cAJSIdy8MeUMbtgR7LPWXGYJ3j?= =?us-ascii?Q?8vEntz9iNQGcu3rGF6YQQrGnHxmLP5jQMVehKMwIyOuxQ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SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2016 12:42:11.8017 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB2010 Subject: [dpdk-dev] [PATCH v11 02/24] 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: Tue, 20 Sep 2016 12:42:14 -0000 From: David Marchand 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 Signed-off-by: Shreyansh Jain --- 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 374b68f..a73cbb0 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -623,9 +623,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 7248c38..6a0f6ac 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); #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices" diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index cd9de7c..f0215ee 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -743,9 +743,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; -- 2.7.4