From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0079.outbound.protection.outlook.com [104.47.37.79]) by dpdk.org (Postfix) with ESMTP id 371EC2BDE for ; Mon, 1 Aug 2016 12:44:56 +0200 (CEST) Received: from DM2PR03CA0033.namprd03.prod.outlook.com (10.141.96.32) by BY2PR0301MB0695.namprd03.prod.outlook.com (10.160.63.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Mon, 1 Aug 2016 10:44:53 +0000 Received: from BN1AFFO11FD019.protection.gbl (2a01:111:f400:7c10::192) by DM2PR03CA0033.outlook.office365.com (2a01:111:e400:2428::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15 via Frontend Transport; Mon, 1 Aug 2016 10:44:54 +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 BN1AFFO11FD019.mail.protection.outlook.com (10.58.52.79) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.549.5 via Frontend Transport; Mon, 1 Aug 2016 10:44:54 +0000 Received: from Tophie.ap.freescale.net (Tophie.ap.freescale.net [10.232.14.199]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u71Aibjh018422; Mon, 1 Aug 2016 03:44:52 -0700 From: Shreyansh Jain To: CC: , , David Marchand Date: Mon, 1 Aug 2016 16:15:16 +0530 Message-ID: <1470048332-27318-2-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470048332-27318-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1470048332-27318-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131145218945347983; (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)(1109001)(1110001)(339900001)(199003)(189002)(11100500001)(77096005)(50226002)(33646002)(8936002)(36756003)(104016004)(4326007)(50986999)(76176999)(50466002)(2950100001)(105606002)(189998001)(48376002)(97736004)(92566002)(110136002)(81166006)(81156014)(8676002)(47776003)(2906002)(586003)(68736007)(5003940100001)(85426001)(87936001)(575784001)(86362001)(106466001)(229853001)(2351001)(356003)(19580395003)(19580405001)(305945005)(7846002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0695; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD019; 1:/YUm2s9KCYbM2lZsMqWMFI+irZO68OLfOmWLPuXXUBKtCS07x3SymVVYkBS+az9Oz00jypFo5fTFGU09WJuAg10c0d3cWLUPJhcgrqPu4nhrV66IbLyI1D5PQXMh34HRqheDVuQtbm0zg3vfEjTiaGo9tc/HGw6mz8zOfb0GGxcPuS0/7HLDWIcuQ8Td5xloj4kseMshA5/FS2KnDoptvl/N8B2ytDSZLsZYIoV2YiSlXPbxRqqTfXwaSjEDBwU1A2V8hivZtzZ6vLdnT8EJtvzqF1JHLcyZ0gDmxkZGaDckZdePqTSr7BgJuwiJWC6kphPe3AdWsvTWZZMIBOFZJGPFbu192hwzagIWkXykpiRxMZxHE5Wdhf92evy24djda9rkRN3eORVH/oZsWIr7WRDVlnw/Tf2wcvOFdeVs6wzCpvsjji6bVOXKqhlveSysbQSFK6l4SnAent6Xq48dW8GnrO1OQx93s4RPQo0PjiqVmo0FYT7r7mf3Zh9wEcgExKwo0+Xueo8SiDgOq3Ox8mb5tylOYDr0AHXBenjuVdviAVPKaoMNSSIoogsmBdh8pUrBdNUmkanREy37/3BlYo+KqidJk7y8p4uV3KS9JyFh/r9UHUnrdcJ3xkPZiSvC MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3d6599ce-68a7-4e00-718f-08d3b9f8dfb1 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0695; 2:FTtfrpHoILop5VowPFoPoshumTdEMW7gb9lQfzknpvTIa87rBCFfLQMnURE0OPs61ny29IKHYb60W+ybjQYnYi0+qrpM1nndUhufzSBeQdzrHPOXAUkzyOrtlKhq8sVjccCWiatcx64+xOfJCGsY5AceUiVKi8hxX4sN6WaYJ3H3CW+q0g6Jo29MIxqWc8+S; 3:cFyrlzQPzSBbey/iYZNPcKgsNoyZ/hl9LwXepaU+dMHXB3QOUtsD6DKOeMj4z4moHoR+g1tMWgJHqMu4jbMUM7ASSTz1SRL4S8O7DdjAJKeW90vGddvB/mEbU5kQxDlMUpJx7Qnfd1H5s9ZheWXPQJNTSVhI0/yCdg6dA318JnQ5EtSxiYn8Ld4vkw/rtAnCAye0iJ0DAkzdTZI05hD4MT9VoXPAXlQjzhuX7UzhYi4=; 25:R93snIt/iPt15ILylBZl4m6zxHwXtwmEyxYmRAPlMtjTX7oE7aUxy9AP78FTV7MhjDopwTr5T7nOr3hhH0Y5TUyHrOPQnMH6NnnCRTxYRNGDMBNR8wOvet9GvLHvuWv19w/Qg4ZAyqqgAswi9WI7+Gy40O7vmtfvKIYlzHxYztlMPtVMV99r+LK9uLjfUcm+ihsx2wLwUimB49hUPdFhEl6DnK7uUpvRAgmqffhek7Abxd7G7hPKDN3iJIN+m82hS5PtUjJ9i4xPYBRz7zWrdw3TXpFYL1tB0gp2CYEIyGi6kiLqJUzWVa8lwVbVMiq8odOzD31rfWYwTnhcy/h0IOtt0EyuFiTHNa3S2SNePnFPWg6pl9gJe7XtCIv2KI8uCYB4109BghOe6836meRudHkRq453GmNiVm3CoNNqIQ0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0695; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0695; 31:M9SyEM4Ww5CUVZiVglN5EvD+k1ko7fsGGy08B1GgJF5I3iliuKw36KkFTPxu1F63m2kSG2RTCSyTpSeAwpUjeiJZpQxPY9MktNLqfdKxpW7sTKH13dFSj7YJJ/QOqnX4YGqx6CvQWc0kN5AW6poXpmHw/gYIZ4FhrXHXqzmM8cwRpoZxTCHXqLePUwHbJ8ijXCTbbAufkm7YPK68gaAXkw==; 4:kGxa9Y+v2nIjEcU/ivgw8T+hQfHj6VS1pDQpQA006CDM+ItGSn0j6plSVdl2ilPF2goiVDpoYj/UBa3EPfdjQcOg9rpobu0LfjMLq2OoDKDlvwXN8MqDUzImi8HcF/9M5YDmB014hHHjcboTUGKrqrCoiCRqD+ySPv6SAd/XoKV6+BLRdRgWqrNvnSr6sjZUwAjUPkTqp02fY9aIri8Z6XPR39hrse3ps5zl6taQnkF2iv4eLbCf4/nfffvo1jgymqo+7TSkIcdMHvXe8XI2BSgNqBr65UgPG++wyLObzg3ncHianIP2MBo6Ky+zN+2oN3d8Upb4/T0R6XzGlNz8frQWqi4/lsF+8Xd0YOZur29X4VUakuWXnXO5i0ruEfLgdtEiTDILT2TazacX2QMhBZA8Lq8TBd7OWmgeg3eB0IBka/PFFCP1gStFa0cZ24C6JTxEPjZlKlU5cu7Vdy2GSebLEhacjgQfjD75eDlLQnhq5DqlmbTta/PAVEnkM1V2TbuwOE0Qcq5aLnNp/jEc4g== 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)(13024025)(13023025)(13017025)(13015025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB0695; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0695; X-Forefront-PRVS: 0021920B5A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0695; 23:/12YVx7llrR70vPJBerKyKKZrPWMeo6/v2m5KxB?= =?us-ascii?Q?2zFuvqTizPrxag3eeMLCZ4tmKtfvoghmMroTYsA1Jm962bT6lmWuGtYhUaJ9?= =?us-ascii?Q?lSPUSwDnNH4z5lJf/8NPJkTCnQ2LL4dRgW35KqvENVLQBK8Jouj2N8mrFNn0?= =?us-ascii?Q?tI0pUYZ9CPZtQzxs+F+IB66087WVPr/czB5+c9yEnKHhvnQSJpl00icpvlWT?= =?us-ascii?Q?lpMbmQ6nj2FapWJCG5RnB+ODpK1R93+08tv/WLV2wo+p5pUzOO/9dWpcwAmu?= =?us-ascii?Q?ENi3mUlHfDrEe7jLvnOPi+X7Y4uYvFX9mddG5tAGARZT3mFkPH07Pl22IbSc?= =?us-ascii?Q?l6zSvONMzamS14cgDaqrAS0ilWg0M+pJPrwJ7v4HuFBk2IIOiAdMrWUNPtvI?= =?us-ascii?Q?E1RaAXJeawmMF3AE3k3vhUrxGJovUuF9E+tuTQyMwRnGsYT9r3bDiCniTk3D?= =?us-ascii?Q?zsKQIcBUj/jZ81W2ZRo/rX1is5FRlbSH4qFTXisLiOsPUYh+M4Eg8SESD+ya?= =?us-ascii?Q?8gR1kW6eoznkiHwwNCrQzqQVdDGwhUDwJpV14X2k0ZYCvEy7wW9bwLXDQaxL?= =?us-ascii?Q?OjG9F5vX5FJ7OFaYWJIvUaeOHPmh3wiCstTTC5lD9oV8dyWNzzMqbPP4lmdf?= =?us-ascii?Q?x8JVWny13Rd3YvRn7p/FiWXfuPy5VA/biHXVZlkidE+WKDPRt2a2lSKgE3D4?= =?us-ascii?Q?TI9+PWe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21jyLHHtYSKTnOPddkWjBlyXvA8QC9sJ15jZwY/AVCW4MyEtowhz/zVg0zWPKxUkw=; 7:wZg8P1mV7zWQVUDfXJ1p4bUZlX9ZHU072OD3T1qbcaQqL2WD24BlvG5YZba57pQZI8dluh7XnFwSaYLO+LSBBJE5g6xsI9Xyf6dyH2JEFkPi6J+QhnP7RsIcH8waSVP1rkw7905cU88xlg6jvR6dRZ40MwpT3hGEtw8k7dG4hxhJX9cnk7jq8agevOb6YG90V8I3hmEN4gkChzZBLfqijLei/yJaZVMfxrWIfpZiKNc6ppTMUiSoMr/8jb9w5Tt7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2016 10:44:54.3631 (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: BY2PR0301MB0695 Subject: [dpdk-dev] [PATCH v7 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: Mon, 01 Aug 2016 10:44:56 -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