From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0074.outbound.protection.outlook.com [157.56.110.74]) by dpdk.org (Postfix) with ESMTP id E85B9C13A for ; Wed, 22 Jun 2016 11:06:20 +0200 (CEST) Received: from BY2PR03CA010.namprd03.prod.outlook.com (10.255.93.27) by BN3PR03MB2369.namprd03.prod.outlook.com (10.166.74.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Wed, 22 Jun 2016 09:06:19 +0000 Received: from BL2FFO11FD052.protection.gbl (10.255.93.4) by BY2PR03CA010.outlook.office365.com (10.255.93.27) with Microsoft SMTP Server (TLS) id 15.1.492.11 via Frontend Transport; Wed, 22 Jun 2016 09:06:19 +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 BL2FFO11FD052.mail.protection.outlook.com (10.173.161.214) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Wed, 22 Jun 2016 09:06:19 +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 u5M9663a022009; Wed, 22 Jun 2016 02:06:16 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 22 Jun 2016 14:36:20 +0530 Message-ID: <1466586396-22618-2-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466586396-22618-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1466586396-22618-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131110599794570762; (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)(1110001)(1109001)(339900001)(189002)(199003)(85426001)(2351001)(110136002)(36756003)(81156014)(8676002)(229853001)(47776003)(92566002)(81166006)(33646002)(189998001)(2906002)(86362001)(48376002)(5003940100001)(11100500001)(50466002)(106466001)(105606002)(76176999)(68736007)(50986999)(97736004)(4326007)(8936002)(87936001)(19580405001)(19580395003)(6806005)(50226002)(7846002)(104016004)(586003)(2950100001)(77096005)(356003)(69596002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2369; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD052; 1:0MkuMqYN9/AZbAF/ybQVOBU22Li/U9VJ09B0uZPzVG/Qf9f5rxkfoe0fNoW9NNmAdq8owat60xnKxRjKIYpgR0+q20YG5E+4YWoR1dnvmeNIm/4sz8Zdgnb4WkGr0kOPpX87xX7GcJ499ClHFGmUuoILCGfnO1XUhOkdgiBbCqP5L8wbkHWSi2sYlVZFRLK/WADpKNPPQkIx9uMGkAZViembbbhJL7v3zukHNc2355csTggj6U5D6F2W9SSjJSDZgHPKY/ErFD4eQIVEQyqkYOCXQlNufIHMFlil7z3wxPPX08024g9Srktp7hWCWbFWuH+XIF9oAjXKrFUyY/smZuXSYW1zRDAyAqIIw82YkhOREPYgxd05cqvuHCQugyKJIZRoqJ3tIuDURC8TjiU6nwl+3XpcmKMvtHqHfpatycZ2jZj8PsQenAX+Jj6hNZAXpViwRJsDqp5XeJmGcHF5zG8ThsmXHCBk+gzGfasFJsbshf9/S/XnYdKwcLLGOtBSCrM+zGqLuEFUCY/iMuKP2XQANvLiMNIplm7TwIh0fSP+NI7fzbL4gg5kUXOFsZnsKv3KBqDQRbJBflKMWWZQmQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1d1e4121-d680-4454-d4cc-08d39a7c797f X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2369; 2:FQwIhLCfnC6OogRndqiN588gPLQNBZ1d3kbqNSACUJX+lmcPjhK5MMySFes+990FlmoKgGRue3zu0tPW4xZnDPTnfixY3tg6jiOrjF/Z1LshPg7rkYsA9TVafuZPDVklZEie+CySMOyPHhoPO7RfH58z9Uliaduz85CrBc/biuL99T96kCSssw5wNl3D5VMl; 3:hcN7pzRL1rN0PUoCHwqkIHNK8vtUQ8NcsavDC7U+CrhLTn6Akuv6r99UebWh4ClO3vjE6+AQwF6n/tm9l28RY9wApReDUK9ajr4vtUdetsj4Pvw+iAWlC8QYeQEEc/kknlDj5m2+CE4vkzEuipfMBH4JKKov75zJxSKsqQBNgS+J8VZpuzsrjxhisHaebtOog8BJ1DSALVT2YMVnOZH/NDins8AneTI51Sm7XJmNgws= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB2369; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2369; 25:z2UlTth4kk3Tde75qOhaJDqgzTB7w34GscXVOH2HZ1W3wAbgcsm77BBUiXjdS+pj20e1D21srsXACRcleW6VamQyODIKcLXeAd0bJOsVkVYftJ7DLzLrCstA/Gjj+J1nQOC09NAlClebqn97GPYgW2BXUtMna1OyePtpR6K2qzdZ8NU5GFJFeNeXJ9qCHFL7gX7t+PN5FDNMxrb/g+Ciqe+/tZTZbMBAlrpbJqreL/mFj3ewlcKz7nUAzYqhCqjE801NrXGMJ2mPKTsPFZ9jXvBTwQjeka0qJpjImfCeB/jgjpsKRganNIvnLNLLEGUVHe80r6Ehhb2BXVSKB0B4uBNszZ4Upo9ZaByEnXi9PB2BSGq/Z0+CoUftDz3igqwZk8UqXPv55h+Y0geI/OHfifEkxRQiBMkxCiqTFguexvuy9TM78UDPnXu4LoO4fcguho2UAepzY5RX7K0Z8K33uNG7Bf8pLLBmgNbTdU6QuU08XkGjaXd2u8EQzi+SPhBCCTzcjmtiaW+B+DqZ2Kbnmrs+xqgsOKeKRqRD7ctn/smweMfjB0fUjdqTT1BqEwyKb1RCsl80a/0/qzuwnsMNaDWJDF6H/cD55tz/8c/XOJXnF1adrYP5L3LzF7IoldajmJqNi99e8fCztLUwFHrxbW/GxJG20pq5Xfb+xYJ4YYuufDrwa6Vy4UpF2bFf7wnz8lT74WNrCthplFSun3Fb+Q== 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)(8121501046)(5005006)(13024025)(13023025)(13015025)(13017025)(3002001)(10201501046)(6055026); SRVR:BN3PR03MB2369; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR03MB2369; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2369; 4:o9oB8JAhV8tfKbAhGVGeS+8CMDduccOfbXFdCIoRhN8ztfn2jHJDMEZCj0ALWFMe0kTgar50vcEJYALu9dXKfoBGcRWDe0jpMIkrEqX8rxeJpfw/qs3/e27TynvngtNRoBV5aCPZvm3D0iD357F3TqSmMnPwoC4pSm4mAl2jYJV3hClp19+VqHBRgOLhwiVWOaHsGywxhp918a4xUzB7pKTd0HJYzICARthaDUEbna1rIiLQMMYgcLOUvGgLW+x0W8J92SGbLCmwFzfcSBbaLglazqmyAPzGbCKsoiIqFAqxjEq5s1lyu0AXujPXTuzW8HePG8Jfuj3PWUP0in4bAqw+w/GXRCKDNi8OarTRc1a/kGwvwaO2b9Qx3Xj8YV1jYupFcGjY8F31CQ98X9y7NBmWiOmAi8XhYY3HPiVlEAVrSITaVxBUCGy4J2wvf9JcjVPeQAoOSDPpkZ3sdSAEAbX5fkfR611muKwnz0AQeS2rs1jwSInnx2mZLeDHkkd8KY3TwxUdzXpn066leQArBw== X-Forefront-PRVS: 0981815F2F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2369; 23:RJb1NG/da1VuXbmtaQaf5rmeqTQIyiC+bPLpVNQl0?= =?us-ascii?Q?+cqEN+sOgiFfD6oEhv1axZdtW0zakhgHZe09xurFxkfu1UMgqULTmzPXnpxY?= =?us-ascii?Q?yqgTvMXEb4dgxDwXHsiQFxrrpWlM+HuDCNaUyPFC0645K6VwgK052w61rU/q?= =?us-ascii?Q?ceghK1YwkvQz+HnKamKKXIsZQrfT2xIE98sKMN3iTMMgs7pON06t1FhLQhg5?= =?us-ascii?Q?iLBJJ8nsxvMjKOWXjANaufWbRk7/7kMttmPG1dY2qv3gYrN4zECwxFOw7kWj?= =?us-ascii?Q?eq7tqDNBt4tl/WoNoG1y8qKogoI9StPv6GpE28l31qT5QNMwnvYHiNTNNVZH?= =?us-ascii?Q?MDyV0Fe7hzw+BXLrux0QOLev0Ea8hhg2ZRuwiDLW/rCssOlM0jFB+GkL0kti?= =?us-ascii?Q?TIHiRUgnhCWHYgl9AHm4UUZj398kG56bsHQ7zWI5Oyc5D+YyA/TTmf79oPti?= =?us-ascii?Q?5lbZQ2j6R4v0YFpqlOlyJJoJJ3VWNSoYAI4V1fU/aOaPUx6LY48FuefoHzv5?= =?us-ascii?Q?XKy6wPsaIkQyY8+WOFh8sKKsjTWoLiQaQ7msBFoWilSu6S3LMWTJ2mjVtMm4?= =?us-ascii?Q?KfABYifiYOYlWNGs1Cen5Wf9QHAXlQ9qMhaJdhkUYVWQdScXWWR1q14swBav?= =?us-ascii?Q?TRGBd1g8K7URBRpewOKZcLPVHzJhmBBFC6ptL2XqI7U6UW74sSF+CmA13ZFE?= =?us-ascii?Q?oikvfWD4sHcbccYrVSkzL29y5WJYMWP+XH4/IdWN3WNC0GGJ7lqyPe1LImWI?= =?us-ascii?Q?K8/YVfd2/4I7o3d7D0bTtFZNCdbXo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7:ElcJzM0EEq03g1ytEvYrxZbROmR82SmnycONxXOwR7lE2d5rNcIMZ0B/T51WBwBVqGBmkH2e97wzrYiHKqWe/pfnlxBiLfaWrrCRB/kIt6k+GIBb+slLAsm99KEFjyWW2aOzgWZ+L6vZTCg4ECtCvMqu1Q1sRDrPjEDZ4+4hNlh3guQwA3X9/I8arfpYR86ob959S0kj6/iHVFnMiRfBCpJdk+EQ/px/B2GcE9CguOZCUEJpG9tUG1JSxUo5gWR+ORA+I2x/i+pf/HnYrcIGlA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2016 09:06:19.2231 (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: BN3PR03MB2369 Subject: [dpdk-dev] [PATCH v5 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, 22 Jun 2016 09:06:21 -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