From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0084.outbound.protection.outlook.com [157.56.110.84]) by dpdk.org (Postfix) with ESMTP id C4A39C6FC for ; Thu, 16 Jun 2016 16:06:41 +0200 (CEST) Received: from DM2PR03CA0033.namprd03.prod.outlook.com (10.141.96.32) by BY2PR0301MB1622.namprd03.prod.outlook.com (10.163.28.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.517.8; Thu, 16 Jun 2016 14:06:39 +0000 Received: from BY2FFO11FD004.protection.gbl (2a01:111:f400:7c0c::125) 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.523.12 via Frontend Transport; Thu, 16 Jun 2016 14:06:38 +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 BY2FFO11FD004.mail.protection.outlook.com (10.1.14.158) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Thu, 16 Jun 2016 14:06:38 +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 u5GE6Xo2026530; Thu, 16 Jun 2016 07:06:36 -0700 From: Shreyansh Jain To: CC: , , David Marchand Date: Thu, 16 Jun 2016 19:36:35 +0530 Message-ID: <1466086011-11920-2-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466086011-11920-1-git-send-email-shreyansh.jain@nxp.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> <1466086011-11920-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131105595988026287; (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)(199003)(189002)(8676002)(81156014)(81166006)(48376002)(2950100001)(356003)(104016004)(5008740100001)(110136002)(189998001)(33646002)(19580405001)(19580395003)(8936002)(2351001)(229853001)(50466002)(77096005)(97736004)(106466001)(5003940100001)(105606002)(92566002)(11100500001)(586003)(69596002)(87936001)(4326007)(2906002)(85426001)(36756003)(68736007)(76176999)(50986999)(6806005)(86362001)(50226002)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1622; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD004; 1:ziflTq/S4auF5+vQVdVxZQFfypK3HQKr15x9QVsp6k1YpKKcHU0mtbCd5LHzkC4abb5CpBSedhgz/DFdDynvnmFR44ZR5NvbVxBQ9GVTVii0jp6BfZBsASR8JKSOiawQVp7npJsQ2O1i1k0R+3ZnFEmAsPyBr1ohk4Mxd7Hv+5miy8WojCBE4lAEqtCKWoDjOR8yY5+oQO3C13156sjwfkJQt6SD6LsvBRc3ZcgZ1B14WhTJLhP/vmgg6DhjkpnTBy8kGUXp99hSqRYk/ft3tAUI3V4oEq8xJJ6WjXmcAOKPQN8fZtdTD6+wHoKmKlJtsjV8BQlbN7S2uceao07M2sy8vcmocAO3pN1h4Lg/BPcjXGb2hWJJY0NNnFnkoGdIn4mZ8UHHNZcgSooJXGhQQINuqkf44NyrX85UU4trIgdb9w3RJyzXDf2aGGZD7ZVtXHh/ilRCl+z35nQw79Qc7wE4sSdNTEDCPaQosYfWd7dvZ0AOOMIy4myYfLqxGfDZC0I6/tYjNgQy0hUMC2pk5L1cBI6b/QcFEY93Flp6bFc7jF4+dBZAsTaqwMxda/1c6m7CiQKDQYEe6f3lWESqcw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 80d8c256-d66f-44dd-424f-08d395ef6f63 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1622; 2:zw2z3gvGCi/r89R7DeRkJf1C85o/uXpL/wQM1CSBxu2r1Tmvdc4jvnnOw1tz2M/ioQgou8SJO7NllmirGwdW8jTWugO+FF/z6UWVu+OYqv2NegaDOuZ9LFhEanceL2Lp9JjhbhpnB2SIMhB7H4wTssDKHlZkp+jrETd2Y6vqf2306Up2QVAaUy7KJhCMNyhD; 3:NxueNk+HEKL+PfQ/A6ItLF6gbq/NblQKKiFS+tjwMdee65cWFCfWAvxDTcZogLt8d+MlzeiOq+yDlLDlBjA6wAwEOU9z4pntuzUWN0ARfNmu1iLbYXTtOSQFUDXss/pUHCTr7ZqZoGnRCDPiMYfdCv0lX+Wpv3V6o2/Xyj6FejjVtT+qFHJOWJRZuFYM5KqsCHBBPgfvmgu71Axy+sK+f8b6aZ3WlfIDAyI9MG3UJtk= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB1622; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1622; 25:8KzzNtO8/yZ7zYH6WAbuE5pPmf7/DwH5b0pyoZrziaqGtAStPceOLWdLNCyLPxGOUWHk/fO989zbOV2zll2lM2L8fHKzxW9uWclYTs0TSc7TZMYr7TsomUd+9F3R0jiEar98NCuCJsQc9QRWaDqcq0filiQ2gv9ITQ0rOznWIrB/NoAWf1+03rlF3AH6Db0Vhbz5A+mKmY8zIqmVHVmBhiu72GuU/Ox9C1phGfyw5ipMKNyXGZFp+qe1kvuxZBJSzHCmInprhbOUYz729J66R7LemQq8iBiRnweZofZMIEBwtBcltZjIm4ZWCFbK/sU48WU0e5FwC17M0hSBj5yLLtWmQ8VfT+cDrF1/DATUEXXn4FiJh3meDvYfoTOgiCTxQBtv8jcCFMaPDXPSLyg92CYCgY/yfW7wizYQXjGr3L4VHJn0DQ0sU4f+SB8a9jhmAVqLy1idxeJc0sxDUo4XE5RQYrgvAEAIFzkv3otaGi/tzvB2HUNww3qEXOZMK/10roQmudqAhWfmOH/3AVwhpBmWGCFFGKmweJBaj12vwU18qiIX+GEx9uY37iZm+KhwvDNL/A1zLyp1dSud+00kqbbfqRuw4MgFevQ5FqCxyK5qq1UxZx8+o65TvCM2w7nD1A4otcgGBCDgjAuMcQ+k4Mm4wjEeQDbdBhm/ijQcSRs7npEeWWb90V+6glPU9xr81fS8a+3bCwyl2DgYJuwfvAIlIoA8+QkKH2y+gSM49qo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13023025)(13017025)(13024025)(13015025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:BY2PR0301MB1622; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB1622; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1622; 4:ssk2JPBhiOtGFjAwFxXzv8e1DxROBIaI8+G+y5cn3F5zFtDPu/5F0/CNL6AuzZt8CXst35b55BJOnbuieU4iwzMPlrWDyc3KlLxXSJUoZnMZDdLB/tASRmO5SlX5eAwa2n+XkN8v1C5bU7b+/1ukEvaJK3k9lfDG3uSzpZQ6+SxXCAoxO8mOAqCRLkiXMPVRazeYCTR6FE9ComxyvUv6iizfoSZsV5muk10XldiYmGAC3SE3tHZoWhjB/b3nfAwh6Py4fzfXQbIkfVEqHGjCeCxmaFMLyff2/G8ub0NIqzUiEBDwPF8MkOleDm75DheiGVTH03wJdjiVg0WJD3hzM4T2b86m9sISzJ2IhKxJxFXehNnxfgX62NFq9ymwiXn8Cuh2/3P9zbE6AhkbSWfCflcg6TClxBsAwZT6HntdkxccENg2pHziRgLwoVFefNObTgEWuv8XCAUGpszQT6/gtK0zVw2FhXlwoMclqVDmLEE= X-Forefront-PRVS: 09752BC779 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB1622; 23:eP5qjsYnB5o5sQVbKMlJqv0oB2ZJjPn639NHRJo?= =?us-ascii?Q?dkd7pol2jY7L0+y//HAdQ9M8ODbeUc71FkiD6or/5iuzygGLi9eKA6YUrhdO?= =?us-ascii?Q?ZIwhHFOoEVn+ocF3ovYRxti5eLXJERMtc+Og+dq2B2NMH6xD+BUhFD+kPjFT?= =?us-ascii?Q?Tcpu1gDATjsoNcpxTH02MeN+Ff8AgYB+M/JhhpLcidL5t5iF0V1bBf6mKQBD?= =?us-ascii?Q?CLv9zSNUxsAVgJvZeL/qrz5ockpCMMPfj+AzAZe7ln3zlVjR6CAEaRdnnPE2?= =?us-ascii?Q?PvtCJnq0sIlii84WZ6vaqNY3TeK8e3L2oBcrGCvg8IYe7+IyrCE612+eSBh/?= =?us-ascii?Q?W0MVfH+xR7uTr0wDmp/uQ27ET7ByxqDU41v+G9xckYz40Mmc3tAKrRwXVG3t?= =?us-ascii?Q?ySzk45ZBX79Z6CiiXjVfz32QlUcfAAZHi8t9QJvc02dIOlagR4UIuCfTUHd2?= =?us-ascii?Q?BTScbtt1bKS3IuwOZkyCjaojluc3vhWjhI2rpXSl0JU57xRKdKMNXoI4AxqD?= =?us-ascii?Q?3Ma5htOT1y16hcIy//RaK+kFr0LTcGt90e/hD18vb6I5s+1q3zQavetnyXvr?= =?us-ascii?Q?ISmqsf1HpKsEvT+pDd533GJtVO06PFmUJmjBF0lVmmsrReAwGy61wh8xrlJ4?= =?us-ascii?Q?cZ+K2HtZJ9bJwE3H1xKm/uOKqWs0tHyjJGGNDEHr7bZFJDhOAHvS2KAr94iX?= =?us-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BfOCILicnUV8xGr9H7ZEPp2g38RXANNYenlfc7a0III=; 24:9S4xm3dLk0264NXQr7jUyCCNceJSvifXWUKF15uv/xletvVIlR3NlqPWz2KlVhihwBf1OI39hfPljUufK4sex7DyLwYnRu2qTVPfcNmMXEo=; 7:x+4yliY/b7Pq2g11tkTjJiobKm9gvn+UGIVAKIAnoSLYlnjdpmYUSDPJ1HXuIjCdcU1gaWngQ246wCUq1uLP7XPtI1fI+h8ZGof5vDMGFtrfj11x9em00lNPtLg5xDGK/kpnz+y+iON3kzUtCfhZ0REs8K9Ra61/07wMvw7Knw9sIWwAjX4D0DHOdOdGcl/VjP+io8eghlDhnEKZf4xFug== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2016 14:06:38.6778 (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: BY2PR0301MB1622 Subject: [dpdk-dev] [PATCH v3 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: Thu, 16 Jun 2016 14:06:42 -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 --- 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