From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0075.outbound.protection.outlook.com [104.47.34.75]) by dpdk.org (Postfix) with ESMTP id 63839F94 for ; Tue, 12 Jul 2016 08:01:07 +0200 (CEST) Received: from BLUPR0301CA0042.namprd03.prod.outlook.com (10.162.113.180) by BLUPR0301MB1986.namprd03.prod.outlook.com (10.164.22.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16; Tue, 12 Jul 2016 06:01:06 +0000 Received: from BL2FFO11FD043.protection.gbl (2a01:111:f400:7c09::160) by BLUPR0301CA0042.outlook.office365.com (2a01:111:e400:5259::52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Tue, 12 Jul 2016 06:01:06 +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 BL2FFO11FD043.mail.protection.outlook.com (10.173.161.139) with Microsoft SMTP Server (TLS) id 15.1.534.7 via Frontend Transport; Tue, 12 Jul 2016 06:01:05 +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 u6C60qWZ006202; Mon, 11 Jul 2016 23:01:03 -0700 From: Shreyansh Jain To: CC: , , Date: Tue, 12 Jul 2016 11:31:06 +0530 Message-ID: <1468303282-2806-2-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468303282-2806-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1468303282-2806-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131127768654519018; (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)(199003)(189002)(36756003)(586003)(6806005)(104016004)(76176999)(50986999)(77096005)(86362001)(575784001)(4326007)(92566002)(2950100001)(87936001)(50466002)(106466001)(105606002)(229853001)(2351001)(19580405001)(19580395003)(11100500001)(47776003)(33646002)(48376002)(97736004)(8676002)(110136002)(50226002)(2906002)(356003)(189998001)(8936002)(68736007)(85426001)(7846002)(5003940100001)(81166006)(81156014)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0301MB1986; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD043; 1:kv/LqWUe0eE7Qh73zvIN9mrmnOVq9fmJ05PGeV4u8XNjfgCYaU4tOXgIX5+MO+F2f/AdY1ygVruuv4Gxf8gYku3EDMw+5KhZZC9kF6kFO8x0YvQdFsusDFeQsjaAEJaZ4+9F8YfLa2teKZ53OmGTyH5ztnnX8rxYkJDhKP5V3xgd+GUHl6/xXjfNFGZet8wu34+ZcZHENjpM8nXjLVDlv1vXIxmueOWsRpUYLsYMYYctL+EpQl8NPqDt1QWGlD5zxJeBGxnHPrmKfThFS0olmSP8swlS5qQxVDNw0uLn8NFrVrv3iDLHYU+S9Uqkb6Evka9XxySHs/nYZj5Wwoi7TLsl+SVw8KcG5JyGlhpJtSEWtv+R3Sofk/xiKepRgpaH/gyIXqEUxRE5awXygEuVOZKG4R1+FCBwRrqSXkvhg98+TvluvBI/1WdHLpbjJnW6O40ZzBXffAEpeYpjXddMjIErGoTU4VkAhnVo9wGsVwZeb0yuNmLy3THS3ePiO/JShLSityE1aXoivFcOxPyMdp1einWyhHwCY+xflxpn2nYG+Nre5CdaTPhxep1IefatshNmFCBo48N42sRUgEqB/GcCR1oXPKsbxFCLhsCOosERACWLm+/oUgqxNLaVEjMD MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: f9d412b5-344a-4aad-9aea-08d3aa19e94e X-Microsoft-Exchange-Diagnostics: 1; BLUPR0301MB1986; 2:SxN/jpAKcMv4Xrv910oOJrhX+E+57lfP3aOLbpFXNi8NY+OPD26UYXE0Besp8cA1hhNtUynjqPanGWNpN5hKTMruwQknmTkckXzxNfM3QEB2PdRPpaDfgSa/hPoyGEmQS8J/EXm5yLWp6nWMbeRvzOsM2Nz+5jN3GMqPYV339l0CNTQaraIyz9rGFwU0baUd; 3:owAw6A/JJBdCRTUWAPzo3C1Zw92JLp8u2W4YyIpTocObpbwEIa2kCv31R/WEhHSS3JK7YAgY0CfqLb9LiH42scvOGj2+75z1kGRknRHkOttgx9qJFqb4piZjMcmGkKu2m1t7SPCp5ZMMhAgm36cdGWdeqOL83AjKxex8WwTpbxSSwirt+dAuW8Rewvyeseou61BjV8uwfTlOZCCHmMgFh4efo22ko4mw4UUV5hyh+3M=; 25:818T6fGO58kqrD7ClT6OLCA9SIg+rXX3nwXxEJzTDhUjjitu1XOr8bLVyECFROYE8Bb80B2l0DebrB8U3FzvtYXuNesxRv1fAq/A0GXQ3fur91WqMJQEEMIV3OhZu6A++k0igO456SUGIH9wupdzB4mfJD4A3uddoXvwgoDp/4nVeZXuW9ZJjofpuKU4EAUqaw54ny96j7JXCyllqY7iz596QOjFTTRVufzIRUCEOSJuBDLJcgYgtNshKwYKX64kBio5znEVyZ6v4ozV06+lD3N7VG24fn5AYSZqvDLuG1wA8Lh0NEYiKdFDu+uw+pe8nPbBZYwtBoH/P1rLL3Al+lHV0E2MGquXdEJFv9AYiM41d6whPt9Zi10Yuck+8kdSBW+PuNEYywOU9JdwxZxPmAVcwZ0eOji8iRn344HW31Y= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB1986; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0301MB1986; 31:3NP6vbGWzfJNAFyuSNTEnBA1isusjiSVMr6icPpuMYvScPok82qsMPx9U2y/HBgF9jEDTttP1NhAEdMVaX6Vf9aorpX7ut5UocjFOcNreh1/dlrf2NydoXwk1Pqf+4WabR1a05jl7pepiGr+6bzfC0CR7SOQQi55PI72FDhX79eIhym/8DzEI/EXqV4w9EmXKkFI3USVLuWtvpj2L/0iLA==; 4:+/vbS+5ioJvBMglnwiRwGkZIkdsromqWqF1iyNBzix2LBrOO1ju9NbDe1WVSUNUcMaIrizhy0hytoimBUMA2vf3lcfun5sh4w452h6jPRBveAwI5+/IRYMe2MQNPQXw1hjZga5TDO6+waKrsxNuXVE6Qy1/1YHiA2Tn651F+JpF4jXi08vweffA33MUolNZkISm2yKHzKD3dEcKzp5+TWG020JWzdbyei7dJb//HWFpb6b5/FY19gvP2qdh9zuchRdkclX8egzsVUnp98US1pFA/Oi6B3BQRgha0WHMFHxIwNwk8FYseIT41ppyg/FSB86lKsUDnXm1eGg99WRk4WU+F1SqLelfNGpsKG/gH1TzcXLprLvRumpRyVmM9IcZVhHqayIwK2sKxV/jvryGsV7DzCIPPEBLOLnIdSyZ1y43o1V+ElVLS0D441i0wCq4w8YX9QZQU2mz4EIG7LQ2s5jcIB02Vu0f95rX/jiWnvs0tr7NnWdUXwDDPhZmB40uX6+l6ZIN+zW3mjGTs1wVNQA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13018025)(13024025)(13017025)(13023025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:BLUPR0301MB1986; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR0301MB1986; X-Forefront-PRVS: 0001227049 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0301MB1986; 23:W4vxBPTK0oIMOswDD3RuEEN2ZivA0iGbj0KglRs?= =?us-ascii?Q?unlX3RRCU/z5PvwktiHVHVAex4s5RyGNeoaS/V008N8MyoQu+eAg3fpTvFYI?= =?us-ascii?Q?oYtg+bM7RvH2WZ1ODNRUB4htKCLRfKiHLiM3eqBD6l8/vZYYa2wgM/gMscme?= =?us-ascii?Q?luO0k6OKcs4Ev2kJWfXiy2bh0f3V3iplBsNkPc4HTw09a3x+9b/t+w+fcuY+?= =?us-ascii?Q?Eo1qzKzZlGAZGZdiXAN/iX5khjZWDqugQY8Xs3mT65FT8a7fIyJusRU4h7ST?= =?us-ascii?Q?7aXHnXD1PVUz155IQ5g33QCzUYn5+kWzorjyZfhC4trzOEMxsrHduFcrp67Z?= =?us-ascii?Q?bRyWNi3qMUq90MGR7lNI86ZxBvNyTCLIvWnr+hskQQpz3qMnTs50zbKH++fD?= =?us-ascii?Q?20QR06k9tbm+jap2kB7lyNDefyaGEwQGNR73uOb8U0TfMCScL/xK4AD8ngiq?= =?us-ascii?Q?0RR6eGjwezr/T7DCwkorcby/NiRC9LeNd++QhR5RN0byXvLS1NdfU1BuVBbG?= =?us-ascii?Q?VTjt8rrtws1THCWpkdVOyDa64tK7sQqgNyG9ow84LkgK5CGRM+OViJL1tXXE?= =?us-ascii?Q?2pfiUBf7atx4bBU5p57Nnp/mzch9Nf0MVPr9+7YZumT2NKKlznEY8SNl49j8?= =?us-ascii?Q?hJHbvIxHThTC26QoqZ7uQTNzPAuBgUf58jz02bC1kz94kdAgCRn/BJT86Fm4?= =?us-ascii?Q?5KhhPhpusO+4dtG5yvos8Lqr2aj2eJazcPMOZyUgHurq/3J9Ar6oULuuzY+B?= =?us-ascii?Q?kXTdwXzbw8z/Li3zlmKf1sn/6x0e7XgukLXGxq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y8CRKbGXyAH7YEasPp4A8HFcW5C6v8/sZ1l9bdv+cggRdcr29f9nIX3LlPkgWEqjj0P675zngQgygAHh+P8sleBc6M9IwUgZYTZPkKe2NogBeDUx6VMGjCKkRFUNZGNpMKYN5gHMLg3+EsPe0TYCC4eoKYZJb50ZWkGKPGwfuUrXGuiukt7qUOYlBw9gtg55ajITYpolf7oscmXMiIoJVBA7Gk5Od2k9jLZmOuFNaVOBElljd6UyZI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2016 06:01:05.2646 (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: BLUPR0301MB1986 Subject: [dpdk-dev] [PATCH v6 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: Tue, 12 Jul 2016 06:01:08 -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