From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0056.outbound.protection.outlook.com [157.56.110.56]) by dpdk.org (Postfix) with ESMTP id 1789BB436 for ; Tue, 21 Jun 2016 14:02:43 +0200 (CEST) Received: from DM2PR03CA0029.namprd03.prod.outlook.com (10.141.96.28) by BN3PR03MB2372.namprd03.prod.outlook.com (10.166.75.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Tue, 21 Jun 2016 12:02:41 +0000 Received: from BY2FFO11FD010.protection.gbl (2a01:111:f400:7c0c::138) by DM2PR03CA0029.outlook.office365.com (2a01:111:e400:2428::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12 via Frontend Transport; Tue, 21 Jun 2016 12:02:41 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD010.mail.protection.outlook.com (10.1.14.74) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Tue, 21 Jun 2016 12:02:41 +0000 Received: from Tophie.ap.freescale.net (Tophie.ap.freescale.net [10.232.14.199]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u5LC2TDI004076; Tue, 21 Jun 2016 05:02:39 -0700 From: Shreyansh Jain To: CC: , Date: Tue, 21 Jun 2016 17:32:30 +0530 Message-ID: <1466510566-9240-2-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131109841613429160; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(110136002)(76176999)(19580395003)(189998001)(106466001)(8936002)(2351001)(50986999)(229853001)(105606002)(104016004)(2906002)(69596002)(356003)(8676002)(11100500001)(81156014)(68736007)(7846002)(50226002)(81166006)(6806005)(36756003)(5003940100001)(2950100001)(586003)(77096005)(86362001)(19580405001)(50466002)(33646002)(48376002)(47776003)(4326007)(87936001)(85426001)(92566002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2372; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD010; 1:yTlZ8egS1zCL9bUQGSmSFSKWGG6UOX29jLYN1kWu5RRwBA8j26jHwKTIXiyUIzVTmI9U9Ml/npPZudEvseKVQHDqAs+Q5I8+XCLUiWVJHy/Jt4ysWIkDFArlxC1/3xhqZHqaZ1e1TJQewEw6I5PhPANRIoNKNrqVt0zUWuigKGfcaInAMwt0U+LstaEbBEXvoE0N1hGq4ePRgVqX1r+9kv6vm8qFhiLq9Sr4uXDkR1M1hvcdke0cr7mzgM9ZvnXwPIs/ChMQKg7b0k6CPWs557h4XHxPlx003LTXRrjDE4yz9gIa7KEJ8rEjT7HD5EEddBTYLpiymomy3AHPRRMRe2YM5WncbEJukeXgHuxycI7e1xF4GaAVZTWKZVzmgH+D5NpLdBFca0hovz1CUKZO/X6hnxyE5Z17gfWw8cDo56kgTVIgYVLcExGMGVZSCup/tfXJ4kS1ZhfkzgN/bynPDOxE+7PD8kgAgWeJrA3/bwREc4HNpu4dE3XYsOeSd1Dl3HzwSYkxCk8EIm2mIlhYLoFKqxL4xY2U+lLVfOIBK72jQziH4WHjCoPsyEX62lbojoFBNrLaUuRdpCpLBtQ2NA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 48a592df-44bd-46b5-19a8-08d399cbf264 X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 2:4Dtz3LQ7A4auPd0fw4nYmCUgKeJlgwLwakKVhXb3FQNip8FyqpDucDKzjt5M/MDKOJIyX4X0P5g3V/DmmlEcEGRxzzRfbsqho/iXFknTJ8FJvEQweynpDSRKl8yrr07PW/zuC28kQ9Q3uYXXgrEzUC+KKEQpizjffbIYSdQGHwMFfsof5taTdW97x5rSsrJ2; 3:6EodRo8wZHDHHaCbyeHfOnD3lJIQqCiExD4jE0Yp7vohFkjNKuQL7Ls7XqYDCytpVnI38mJggSNuo/glxI1OmMs7U2PQgNt6I47EDURGupZKh6ZmLsfMqRWb0zccVq2L3a/ZdlnEeMXVbMiEwv+W2P5fPmuvKYmUikfE0cDKskDEhStL0VOLwyjyHcs1kZU2P1NrM56R7nC0kRjeEFpnkwUD0ayixt/MCsxRr1pm9vQ= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB2372; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 25:h0PdkKCi4U9wO15YnStkBCsfhhJ6WX2Jx0V6GDjNxiSsaXGmQAF+WYazFp6AZRXC613RQRE4VzWXL0j27nDpX3WPafc+aZtxdThPd0n09QQHI54mIgM7tH+CtXJleRZbijSN+9SCh3JqmSCAc79JZjAxQ32a0/EklvRNOUoswGzabsGbG/HyZ7/Qs9pvxmvCBzi5I0hhUaBvFkChaoVYr/8ecjnlEKNRlyVA78YL7VtGymceCTwBWdmET6QnO+6PcJjWTxxfYATLXCj1rRMNoE9kXJyaSS/WsoyjK6wKRjuQ8lBmjCxebnFeqeChM6C8/22XFgJLWekDn3vkEaHOjsS2RysOKriRz7LVgyJwQIIZBeURqCmSVO0mXCx1+A1Qxfs0MnJ3OhkHcFw1d1PxQoLc1s0Z8WvJlDFB03sDj7c/JjRDLrgeJ+cMpEi2LNYgHaWuqSIZ16jw7fANJBawvj6fSMzNDuMr2pwW4fjXKEpAKjaDUcEy13DzDm4H/cXsBnPXf5+8G/JbqJxmDRb7R/BWmQUXuESE5nCfSWf06qMiqjpj6BOtlzD1QpV3Tzz3o9NbM84dZ7hOb8ck370GwMiFxisQASLHYUdOYrZ01K0axKXZWAx2jPYPtb08UlfGYyTsr77lhilZq6YYEiy2fk0ntHVc1yxqvrqIvEBHToE8HpcFyrNDtUCAulGr1bqBxvian8YlTYAF7lD//FHtCzsfKOox1GGSVL4HsvVcPWE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13017025)(13024025)(13023025)(13015025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:BN3PR03MB2372; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR03MB2372; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2372; 4:14WzErVRdcIAJZhciguZBx3BfJ3z8vCgeA3WfGFZOchCOkllVOsBxTs4QKhcLL+MHJ1vOp7Nx46S9SxHzJjYmgdHJsLESy2ulpEcSSrIZSenCVq9sHj5l+ncow/YDEbdLtV2/x6SQyow4FYDOEChWM0LELj8Aia7966sPNEnVefK2+Z2zcqF1FAX0JBjvY/xciOhy5m1A4xvWWd1vdrOxBHQun14OJCyIur9gzbKTwKXbIQMMuLXs97XrZfGIKVsdbVWjn1RULFn7vbTY8ZpZpgj6nOuLKllk+Uk2aWTINTofmp1KP+QaI4t17PZFzzADpM1NADtpr+cqUQ+9jC6HZ+edkA7mku7Jzg7yolBeMUOBtetXiN9T1r9t7QqyLTFMQkzYOIJdFB4VvY0hN1KpHOa+BeLofaXoWSUOqgEYgDf0tXNeGwhJKHhbPNCX6U04CuF9/RtRHdTB6PsX1ips5U9zwszVfdtKx4Mo9P0m2vuBbufHNjm/sfehhe5CH4qHptahaXSN/JzDZXkt2GOcA== X-Forefront-PRVS: 098076C36C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2372; 23:DFWBMSYAQwpPa0CYgG47lu3AMjyNCzOhzGtOxDTcr?= =?us-ascii?Q?TKTUHDdDlF9HCj0hQOulP0to6P7H0hlawOEpYwITY3kH03H8dyXtYIzJlgI5?= =?us-ascii?Q?kif3rDjMCubaI09WqD9BvF5qOUKy0BjYIxtfK7Nvc9FBy2A+CZjQrpVozroe?= =?us-ascii?Q?ppbz27tbyt9Pdb6BxnR9Y+WWdcQwWvpFmboYL90m5EpvTyQh7haO4fHD9mwV?= =?us-ascii?Q?wNc9VIoQycQziC43fH0P3izXNU1qSr/JLCF1rjmBk7Git8qxUR/kYIechQkn?= =?us-ascii?Q?pD1ekZr9H6Yszd5L8AZJWZ6B5eF9LlarbUHSj0otPEH1uWaoYGMHxPwYBAwI?= =?us-ascii?Q?X9V/Zee2wwvFTeU/u4JUHLzLz2vEF02gmfU6fZVkTWLN2GVVhxUDjAxP42//?= =?us-ascii?Q?NOMrPNlFePNdMqDZetIcXYhlLnBbtivSFhwlX8D+wnzqmyskbBJ9jW1j4fff?= =?us-ascii?Q?r6Ga1oiqvpk0bxlmK9l8ibRM7LPGtV5jX9jKCaisS/5Qsw+iPKew61pur2GN?= =?us-ascii?Q?eA1BhqroYgfOCWW7Vcl0uFatADBff+LHrLS/Dl+AqOqKSr6ct/vtfWIchRsK?= =?us-ascii?Q?Q5UJGzeNJbyCWhpvhFwlzvqm5jnvuqS4xKG64gSOYJpby2yQpuDy9V9mpFAA?= =?us-ascii?Q?+Lz9lTsWtpUqGiODV1pG/I9veRwrDQUVNDdvbpNLEGWOYBTi2LpNnl4o11sn?= =?us-asc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s9MvLHC3mBKtS1td3S/s3nbZsmbU41Lj63M6Ho5i7nLFXIbDWatz9Fbri1tpYM8nu2/vsOQj0iOwBW30=; 7:XaVzizjyLkp2fUQz70AeqDzHegFtJvHX/UG6A8GAPeUWVrdH/qcKn/JcaaTI/0+Y75DCa7TKLQ+OiMMLp5m8nwBqMhPVC8rbRlByvM+QVZiOjZExtyCqS1ImcKkgl1iRtZfrl183MNLai2mKwzD6yjM6E8Mji7ZKmqQAe1MwS1jr2wSYPLdJuBkpr1B03Ja6l5P3RMd1KeJJrsNbGtr1AGI7W6fj1ppuTOvAwL0DddYvgGnjinVmHyMxVAHrdkuD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 12:02:41.2181 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2372 Subject: [dpdk-dev] [PATCH v4 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: Tue, 21 Jun 2016 12:02: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 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 7fdd6f1..880483d 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 ba5283d..fee4aa5 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 f9c3efd..bfc410f 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