From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0083.outbound.protection.outlook.com [104.47.37.83]) by dpdk.org (Postfix) with ESMTP id B737C8E65 for ; Wed, 7 Sep 2016 16:09:45 +0200 (CEST) Received: from BLUPR0301CA0034.namprd03.prod.outlook.com (10.162.113.172) by BN6PR03MB2433.namprd03.prod.outlook.com (10.168.223.11) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Wed, 7 Sep 2016 14:09:44 +0000 Received: from BY2FFO11OLC002.protection.gbl (2a01:111:f400:7c0c::130) by BLUPR0301CA0034.outlook.office365.com (2a01:111:e400:5259::44) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Wed, 7 Sep 2016 14:09:44 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=fail action=none header.from=nxp.com; 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 BY2FFO11OLC002.mail.protection.outlook.com (10.1.15.178) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Wed, 7 Sep 2016 14:09:43 +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 u87E8BCm013556; Wed, 7 Sep 2016 07:09:41 -0700 From: Shreyansh Jain To: CC: , Shreyansh Jain , "David Marchand" Date: Wed, 7 Sep 2016 19:37:55 +0530 Message-ID: <1473257297-7221-4-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131177309841552417; (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)(189002)(199003)(8936002)(7846002)(81156014)(81166006)(8676002)(626004)(85426001)(87936001)(229853001)(50226002)(105606002)(19580395003)(106466001)(19580405001)(48376002)(50466002)(33646002)(5660300001)(36756003)(104016004)(305945005)(4326007)(97736004)(5003940100001)(110136002)(586003)(47776003)(2351001)(77096005)(189998001)(68736007)(356003)(2950100001)(86362001)(8666005)(575784001)(50986999)(76176999)(92566002)(2906002)(11100500001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2433; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC002; 1:6MWKfTAL3T5LUeyxvkEbsb+60z/ePt6yvkK9tU3xntPgj1WDqWsc561fkNu2lapDhq7u0KNEmZKVZYS9/pbqmW8QZC2cWrKQBT63Y1wQYO8/7tuS7AAj1dfjcUw34Pc5k0TwB2drB2ORO0toqKFR4PaccTWPPiuWHzmsp6mBhn9JV/VAsyW4YyQUqfSPTwWT2GeBsvb1kFoB0m4CRvw3/zQ9Co6SFus6nQoGwF2lJGuu8VJO5Jvb29OYRoOtcSoceZ0Iv1EvyMIOem+//oqco8RKAqs+baayAdOCyGzNCiA/NaV5TtT/sUBvsoWzIbWHKzeqFpXigDMyHZYYi8twuO3L+75q6/mYHVm1g59hzDBAtjZVuE4fFl8893B/DxAdVW5Kr/C8HwDBjgde4ifQvgo/APW4rnrmZaLfIH2XFI+AUmFM1B0upSFEKTj2wX44qREjgmVz7vTb3VxoJcDWJRQX/D0VSsORUeWze34zhP69VIE3o3eE+8QS4uH+9mkKg5aLdzB45YB0cSjJ/naIRTnN9dcxClTgBdClVYxAhg/9931VFH0nRPNFfO2BYDp7Bx8SKQIgoIjx45iK5TNpKXP5qlwUruwufD4yQSOuPwKw3tbxtIyq8fhTY/LCvVPu MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 91751847-9f1b-4b39-12c2-08d3d7289e27 X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2433; 2:ZhhjUY+OuheEbaAAIDGt5+TtRsgo0BtAxcHFQU3XSq2BITfRRJpO57dFrCk8k29y9g9lJl4l5z85zv15kqjmNW3xEs1ElK9CCxoqfDwYbFNzxnqRL0kFF2HkBsB8h06kqa6G+Wk4yTGvnFbvWiwm5iVtznETRU2SlFoRqDfIPoqQR1Htb1ilm0EXiD3/toAj; 3:U+grd4JPWMhFBMHVhoJUy7NKTspMBuBXiezAGAl2nAC4zK0fi/LXpV6JAP0UBbmdDPT2f6qx4WzLGB1U9uDmWaIivbwUfqpoYdeRRYm8JaFQDIYmHPYtep2sSaxErF0wQ54ujRKuqVHPoHcdbZ+z7n/K24so+Fzg2TgyEcHFH7ag3++c6O0mjkhUwCrxjvpXVnksNbitxPTQIfELRxK4DtmtAGzfsdM6+1olybULr7w=; 25:DhwdNy4og3ZZKm1QdGzx4BoxpDiu+EzEfBxhcWE+nYyWIRw7o4A862iBeE520jeuELVnyWSV3pgNe1NYoD+m9ERqzNiKks0nVJGJIqQZL68nmCR3wDtJ1YwYph8yeHD4wUV/NbFHoPOfxF/qiKab/Oh9jtLBqvOxHNuMxFmhzd+SxhS49Zj1KDOJP30UGLzBqh62mZb3hH0XSqDF8mIL1EZGF+9l8+nh2wwRLWb01fggyMTQFyRI98FRsDVqmjTjydfUbsUkngFvrKFyD46RcBiwp4EMbUcFtYXQaZWRH9deMF0bz2LpT8nSBbMAz0pZynUfQyG33y0XxTgC/ikTq3AtLIaoAbaXfRxkrv7VOR4LcK+OnvydovjCP+c9hBCNzYRVZj7XL8O/y6oSZ0SaB8AHX+T2SjbZVtvPDo0qSao= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN6PR03MB2433; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2433; 31:EMUgCh8gmGIaQ2a3PMIJecCgzY50/53wqy4Y9luZYcze5RUuYlPiaCXONTC9PJFu9PSVbuUlgy8W6uqnfJN94AssDmvVDJzMKyj7zxY10NsTslDqR5ngHhrWmLrmsioyLQIaCAIiCCDVCafv8wvy0RUkgPKztriyS206EEuSFklnPquzNwZvw8HiJuy41Zjw704Mi/GKOAqCV0Y+zpheNa7gihlD8jsQELOCsOx1RWM=; 4:ckNOXQ6dsKNlyfOYhMscpk/AVntkR1lIMajuE0I0yHx64eDqUsczNLsxXRl0AFcR4ulJ/ehO70Kivo6PAblKgj5cCP3pWmBB+FFlShZsdE54c0Bmyp9hgl/6aQNpPz7gIblSxaiJkzmyIOPZS1Oe0rRtjTDoK4ja9Pw0rPiFRul7II+nqzQ/9l007LmNOZXU/SIqZl7GCDVmMxVBsK2UF0hEYkYmWHFoh1c/XSnuzvwmkOrybkAZAhAfddWzAryKWLgV5W40ymUdYjTLnk18diufyt0tx8dykHTNOUB/+23XPl+o5ga+l0Q14LEAaw3p0rNVZbyYfBl6+HxcmbwjWvqw1aKC+F1ivymPiemxtQmKfx4YOWxJhBf1rJGChOHvTo1zS//B6yNRcT1wlGoDN3PCGzj+OvDgT9d7kJQoyiMfaDVIBZo6EwLJATNdZG/WFhuciaCO1nCVaabZ0Dv+fKa+IfBw3Y7KORPqr3mHLr34yUwznuWTfb6WDzgjz+elobubY8KsLo6Kj4dCEPuNnemc4qyqLZGWWUWZy3oQo4I= 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)(13015025)(13017025)(13023025)(13024025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:BN6PR03MB2433; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2433; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2433; 23:3HeZpoE8yAEVAqCD+avX41vrxo0afQY9E6EPWbMl9?= =?us-ascii?Q?TSPHIjBMvhJak/keSNeWEaCqivmpvVLzMYWsjy835PyyLmdyV4f0kYvM2Tmj?= =?us-ascii?Q?UZ3S4/M7pNuffTZlinAkjxbOWUPSyN0yZ9MCRv06SWB5RoLJCyUAs8k++lct?= =?us-ascii?Q?Uo7/66P5hWGXjyCI7K+4OMcqqmOR4UKXB+olEO1wo1fm9BWiMpFy1J6DhceR?= =?us-ascii?Q?6at96XJK2ZfKCCwM65AGyXEInyVY+Rk9uqwHHOzz9ir7Y35n9tp6YtFg9+OS?= =?us-ascii?Q?j9buXBK5yIQVI01nUcKYLb/mt3ktpB9Q3kePpr1zlmu3NzviMWdOTM3rgvkC?= =?us-ascii?Q?K+RvztGR0MsIeCthKmCnDaPHDghpK2b0G1WDZGbb+x1PrHoE9YbB+ISbQqGk?= =?us-ascii?Q?b/FAziguO8BLZF+wPbtVyRInu7orRS6BJjJV4XMh0aTNkJq/GXK9UbkwbYrF?= =?us-ascii?Q?ZQJ3rwXN+WbfdQsXXEDWQWvEudUKpHJ5FgoQusDv8KhsBvdJMcGUS6ONXemd?= =?us-ascii?Q?4bKHsYIiHoUhBU3q/7VuHzdSWPv6ppf3hRFRglfBQtT6bghoE7TOcqvOivqC?= =?us-ascii?Q?Z3eNxd+t1g4anVO/1baMVCl5fcsCp60rCS2Ok1v3RAjSnrFBFow5SbAeu2mC?= =?us-ascii?Q?/93VJ5C7qVSkFNF38s2mljfdraNbyVnHG67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YvO191GKAKuXA0qFsI7utv6EQ3gtIsi48+PnQXg6N0oUW3bMt+TOkXstH3smLW72LW4It/Okcl7PGH+cfStGZQeIt4eQ=; 24:3dURPURyIhY1vw0jEX8DcQzPMHv+HpxdcI0M+/lUxsVbLWRTI7linLnRc3oeVgSQ22Q+Gwe6CzRAu+OcO8Atl6xwVqmuGXkjbilxrKpU75A=; 7:M9dT2cz09xIfDBLmmH7WAA6YW2gS6CgnZTPfCzyMLuZnDb/lYNU4+HzVV2z+rCGlwLXCY/MamqnMTGyHot5PrdAGPRlwU7hgQtJ8DRnMd5we4sj9a/9Bq1I/pb9Hxmn18cD4lN9bxK9norKzz+n1GU35MIV7eUUBaxdWICzPpOT2drotVksso1Q+asQQ6mBJjdupw9KfkzRyuc8a1I7NDBnzoeXncLqt6ieUuqD0bbjMUgLCC/Iy4vIY+7AAxvOO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2016 14:09:43.9524 (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: BN6PR03MB2433 Subject: [dpdk-dev] [PATCH v9 03/25] 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, 07 Sep 2016 14:09:46 -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 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