From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0084.outbound.protection.outlook.com [104.47.38.84]) by dpdk.org (Postfix) with ESMTP id 9AFBD4CE4 for ; Fri, 16 Sep 2016 06:32:14 +0200 (CEST) Received: from BN6PR03CA0054.namprd03.prod.outlook.com (10.173.137.16) by DM5PR03MB2619.namprd03.prod.outlook.com (10.168.196.149) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.629.8; Fri, 16 Sep 2016 04:32:13 +0000 Received: from BN1AFFO11FD033.protection.gbl (2a01:111:f400:7c10::170) by BN6PR03CA0054.outlook.office365.com (2603:10b6:404:4c::16) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.619.10 via Frontend Transport; Fri, 16 Sep 2016 04:32:13 +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 BN1AFFO11FD033.mail.protection.outlook.com (10.58.52.246) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 04:32:12 +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 u8G4Trfj029256; Thu, 15 Sep 2016 21:32:10 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Fri, 16 Sep 2016 09:59:38 +0530 Message-ID: <1474000200-16705-4-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131184739331770250; (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)(48376002)(8936002)(97736004)(50986999)(81166006)(2906002)(4326007)(68736007)(86362001)(575784001)(76176999)(50226002)(626004)(104016004)(7846002)(50466002)(586003)(2950100001)(5660300001)(47776003)(19580405001)(229853001)(92566002)(19580395003)(2351001)(305945005)(77096005)(189998001)(8666005)(81156014)(36756003)(33646002)(105606002)(106466001)(5003940100001)(85426001)(87936001)(110136003)(356003)(8676002)(11100500001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2619; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD033; 1:ZqtQEgMqtovQLReBzXFoENa5NlS1gzLqDDxSgTDQdvNrNWTan0xlHAxUAaAfG4XvFitWtdyyHwa/6P5aIaN2eQjEc0vP6vVjyHnfs8l7LyZFVj7kCqpMGjtNSSxzB2kH/lP8GBhS6EZbYSpD53SgNmTn2DKAAp9Hx+DwR+DVtba4KjyFJTEh9+QS9V6OMqFqcif6MrayHi/kuq7yhBghk+BySuUrfVUk2X/zIkeiUeFq7NfDisMqQIEYqGNQiE0Q7WT0vPpRZCdVU5C6bgQkPi18ScNy/94gEqnXshvZZJcb8jZX0nayQjT4fiSFvumv+FpZ35Hfdhnc91VvvguSe45iJFhBKPoX1/ScvRQ4pIRv4xTKT1LigkteGh3GzjtClhhwQ4XrzttuuNlnm/uPcDyawxSI9zAity73j+ODvYGnnB56gA8a1hJ2gfEMybdmwz9meNjN4FN46b+QGgv/aAEs7WcmuygCOcq1hzg5HKevCN00fzaLEwjgTRk8oCTiQXFSqn2iwiq9VFdc60hj1tBnK5SKJ3NXDf6jsn6+14mNopsAyf6QMBmEAuHJatIBkySBcTm9jXADlNJtbhs3ag7Q2bUjtX6fNUtpu2qLZKW4ivwxYee+QDQR4h3QnmUD2aNX4eNSrluRUic8sFBcxm1yIL0GfVHLpt2bph7szzys/w4KGgAfjPRXWnkEPLMAFYKrgKdvvF6uZFs3gh5rcuBcflGPrTz/ddsKnjkqWFk= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 186d3fd5-c18a-4b67-7c82-08d3ddea6e36 X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2619; 2:XQ9FlGjMCuuHPFhK4MrQaSEoXNr+aQ+G+aP2uv8RR/DbkXvr7kb7kLmwScUS7NEakzXwCEHIVFz3CjWnv7Vgy2934rjV0NjbCWwAchZECHdd4aCdEdLKE9d2Tl+zfkGAudk5RuwhKyUVBcj0tQ6ShZNLM1lpamFfNZCOkweVb9zRRJilJMKtDMJwlmwzA8eZ; 3:vgz9QRhCfoQ5AcZH0OplyXpVKhm/19sgeNh4TmyypGhWXKTYk1am5E017TrG9kWeqvMSNewO6brAI47epIAcdvl89vb8bac1Zm8OsrOqGsyIi7IS8S1CjLq9DnDMS4WBRxeuKwndV/GWjc7ZYeJySXxYVG7g/9bSb4ELYBkdaC591356S6zI48OC6nmznOG52mWQ0juQRsVC67zo4R1b4HowcnhLqDcwdeHOaMN2oVc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM5PR03MB2619; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2619; 25:dbEtXOM92IiMDsTolHHypzo+UMnnCkmAvUFkC97dyzj6Kyluys0eiif1hboxhNsWG6H3WjhNW83Uf5Q6IVRe5XnEnwC3BCWtp3FO0L5p5sB6IKxlQlfKOlYPcM0S7Y/v6WDY40cK6upOnKcAnR0N6QobJjimN7ZPLzpWIJtJhTS5zbTsl9vO12hXu0BC8DxAoTjQ18zXGsw2WZGmGtYwCe1P3Q1xQzWeDDBSJ2ZBofZTd2n1i/xWfwqb0GiqBbEr/U7fHYnlNcaum3sYpwzo2vrenxfFDgT7ENtO6F1oIPj+rF2t1wRaOnIVIfGadihmzziQpcCRNJLZduS0F/ClmcDRopIJto3OCf7rOLMLYZowO6vIs6boMMJGB2yBZK/XThMq1hisVW+FLggT+fnB3vZw6Dg100Q5GiPQkW5+wT+vAaXAr4FxF6rPGhiI0O4lRH88BnJh8kwmT1F1hiyVCcUOv4Mqcrz5WwB5fnE2Bzw4J8SOLmWWHbAXfXOTzm6lDqnI1++Oq5zoan8O01iWsoA4GOQ5w4jGQOFecNOVnyLqNmyvqhxVMvU/M3dtaVdYHfOSvghvgr6uLrhTsY5vK6mLFnOTf2+1PmYgDFJSwENg77EJUlKbn9ZK3zlwc57MUlYiMn6of+L6UuUDxatu5JAp0nf6pF0QMFKPCk7lPYikYkFZQeRzdQyYd5HWbN+RW3Oiva3f18AetHwt8vn8Qg==; 31:L+FmwU1sfoDdZOpsFyWqAvpsYbTcm8je7wM0hDeLinHouec+fJ6Ytrl+pFYZj/gR7yiYQ7tBgUZL3GtsnjdeSZnl6UuTor8xxFPBBR2aS1qwp5IkxNACa6v5Sz1aOUWPQpUMR8+wywF1rMYfpPNtfbVv7Gm3k/3968Jh7fopzq6t/ITlheHiAuC/DUcNHQA5oKgtGLFXjXu7g1K/XC+7c0lpNILuO7w4vtWJjeBgjy8= 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)(13017025)(8121501046)(5005006)(13015025)(13024025)(13023025)(13018025)(3002001)(10201501046)(6055026); SRVR:DM5PR03MB2619; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2619; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2619; 4:P61h/o0mWt1FQQ60jGrykISERr691js5HtJDv+mOzpGMZ2PCRTjnJJREZJtOZYg7gvVyOCYZ+kQh2gXp3wHUS0CaKs9p8paU71Vqhd9Sugh/3pwql7qu7ecmglB2i+Zf/6/W2YHhmOtDNiC98tl60Ryx86qvfHRrdZ5urA6c/1dItY3oeKQYsTicOvyDTj41rPHr6VBAjI+xAxcpdPCK68o5hBX+lY4uGZ7NkY0CwuWmJijuu0NaLv+LbTkb373oyxI5HR2dQJJcRd/qBH03Zu/PYAneMQbtAC/hVaLmju2nSp+l+1aPkUWax6LUe/DNZzD++OLenL9jGSCy0+qEThUg1hbDxs8k8j0t+9NLzlnE5OLzUzSUqwOhsceRlbZ9Ntkof48VPyirX8uZKlIlQFz4Axmu8UBpHit4TSSAFXeo2Tl+UciGYp2Eqo84Xm1AXDZjVFRAkwpDf3zIPMkITX9nju00jMFFhY/qSfh+avhvfAnCfy6ojViNDN9zZRpUn1j03pvjK46dE+B/6x9U7F8G13Qa57RPJHhnH/IXiSU= X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2619; 23:iVBqaX8p3xH7WCbA+340NTpqnaRDMd/vFLSLRbGA/?= =?us-ascii?Q?HEXwPZWZHHUKwSUV4z0apn9DMpJBEQf5zBzjXYh6BAce3ekx1cPPV58FFDCh?= =?us-ascii?Q?j4BeF7oIpDThZySebOLnzK/J2zzlG8pBoz+1n18n20sVpWcsm1wk1h7mcv7v?= =?us-ascii?Q?wiNlgLT8Tw9v0Ohm0qMm5vxmVCHOr1ZiBsYZuNsCTHec8NBOdoWxNR9SOWSF?= =?us-ascii?Q?ODzqdHz2LjNWgW89CwY0YxQBSYZv6I5oQPzWESdupe0WCDntIjsuh/Zawcw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650 (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: DM5PR03MB2619 Subject: [dpdk-dev] [PATCH v10 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: Fri, 16 Sep 2016 04:32:15 -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