From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0047.outbound.protection.outlook.com [104.47.37.47]) by dpdk.org (Postfix) with ESMTP id 6915B5A08 for ; Fri, 26 Aug 2016 15:57:36 +0200 (CEST) Received: from BLUPR0301CA0007.namprd03.prod.outlook.com (10.162.113.145) by DM2PR0301MB0718.namprd03.prod.outlook.com (10.160.97.139) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Fri, 26 Aug 2016 13:57:33 +0000 Received: from BY2FFO11FD052.protection.gbl (2a01:111:f400:7c0c::156) by BLUPR0301CA0007.outlook.office365.com (2a01:111:e400:5259::17) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9 via Frontend Transport; Fri, 26 Aug 2016 13:57:33 +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 BY2FFO11FD052.mail.protection.outlook.com (10.1.15.189) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Fri, 26 Aug 2016 13:57:34 +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 u7QDvHpe023630; Fri, 26 Aug 2016 06:57:31 -0700 From: Shreyansh Jain To: CC: , , , , Shreyansh Jain Date: Fri, 26 Aug 2016 19:26:41 +0530 Message-ID: <1472219823-29486-4-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131166934547587875; (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)(5003940100001)(8676002)(85426001)(92566002)(36756003)(77096005)(5660300001)(8936002)(2950100001)(19580395003)(356003)(8666005)(305945005)(19580405001)(50226002)(81166006)(106466001)(7846002)(586003)(68736007)(50986999)(575784001)(86362001)(33646002)(87936001)(2351001)(11100500001)(76176999)(626004)(110136002)(229853001)(189998001)(104016004)(2906002)(81156014)(47776003)(50466002)(48376002)(4326007)(97736004)(105606002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0718; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD052; 1:nKFg8/5AOq6c/hehIYDAD3n3G7VNT8K/OaNzUpPv1ljfxyXmO/76aOYisCOmDPIaPN+cEL4qpTLltk0iqdjs9JOwZPqSeH0lo34Tw7BT0aKrbyUyHl+02LMREYNLOsKzNt2vq+893eTzUhZaJh4VQpknU7lyFoHMOQgaOsxx0e/hjrnzhlcmWDij568V4jhC96H3cRn7G20hBuXiUcmvXcC8oHE1wFD0SgjFUm72kPyHLbyAbhyr7xnbRy+0GdjejNfXl2DOKLP6/KkdPeoeo7irur5P2yhjgNsB/QDwndA21dYd5AnzObg5tDgrbxE1Oe8OeEdu2OAVHNgbOzSevz9WQj2rfq9oLm+rua2SPjnrlZUAAB8b52Brpo4isfZmEN4iuVW3KquvG6TwkebUFQcZnyHmPbp5FNcrj47Mi/MuWMYzRVxwaufJc+qbGJRsMRKDQEgmWNJo1kjsENcgI9jl2B2uVlDpy567QaXR6Zau3SdSMkz6tsjUcbeuJgR2y5MGmV/xEDmenyUPTo8cZFHTlIc1cRDbM8wAPauZjawc6IUBd0QJQIzyeEsduB192vZTAfzI2SUH0DXs//yTbFL//8tkj/yzok+plw0OmZnsJ2CwKYBUYV3hQEwljbgUwhmvCckY+R41sPyLoHB2PxU6WvlFrYLa6FpiPZzLfxs076QC/CKLDo5HQ5/VDoOSF2htpjIl8H0YhQyraGWdpEIpfL16v65kYaoUPdAhQb4= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 2e501ccf-80ca-43cf-582b-08d3cdb8ee60 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0718; 2:1UuuYAJlIqm51LnV2lsTBMSzuxYM87zsl6pqrkJwK+M690OZYINMZnB2Ouu52XfdFRXeYyVZMIPxgEU1qHk8aUZtf0t+AxBAaZ7WRKNPZGyc9QB2lWVfCTp62IWFgl7h+3wmgvIUni41SHHcFV3XaQ+2dbQDIVIIsqFMmyI/E32H27mzi0dw/45UREDhCh+E; 3:Mz/M0ujHsTALTpzBsaihnBe04D0mJF9uX4S0p4+rRNUfua6paEXumRU2lqvrN3N3bX2/yj9bIwlZ0sXMagAZxw6TWUZ/UInJks6nP7NBddPbJ/VXNX/wYj2/lmxd1LsZ8ErVTJLxRadwAhPweM6zkSGwb9tO7ugr+WV6EWlNTIgqj+JIiq3WnqY6wj5EgEtVoR+gQd+FFG7Hb6tAKd7EudF3Nf+DMdWjd1vk6stchhg=; 25:e2gOmf9ab4fcg060jaSvU5y8GQ09fpfOQOK2pfVNAyZ0tJ7fl/K8x26Xw69BN4oYNnkhRnolYSlCIZVoqyN3Tn0SbItVznBkF5BCbMG8nfVilyVzc4uYV6dojSNV5aQ5tO8WR5vFyaY332cUioDiJ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14dzTGymTrdSO+LkD1m26LbkVPcWBhvl/300Ndp68Czm0fs5T0Oh/wbXxuZmy0y8tRudPjlccdaA2lQwYAIX5kWpX8RQ= 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)(13023025)(13024025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:DM2PR0301MB0718; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0718; X-Forefront-PRVS: 00462943DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0718; 23:VUw0hM9sLJmmNGph5Stpb9DXa0SuekHSltYBBzH?= =?us-ascii?Q?qxHghvbI39h+3/BgQFZ7WtxSxpWNUtwj2gj4ybHE6A2xy0EHmQtAuhFl5Nay?= =?us-ascii?Q?PPXJd6SdHAKpjmMf83NaEW2WOuLPw6aNjSGL7jEVZUKtbFn42u3D1FTxpag7?= =?us-ascii?Q?1pbEKIp/YvxTCW/+zQf2KcF+8JNQUUrMv3LhnP7sE6zP8w4X/BiAV7OvYjjS?= =?us-ascii?Q?ptV0WCXnmh9hz3PlXjxBOMSxkZr1Fz1IjSf6CJo9vRgKYqE0NHPANFlgk/t1?= =?us-ascii?Q?q5g6ISxk9F2SWwFGCeT2EZmHprBLZf28gt2+AC0YcHpYsIoP3qAfaaFGtgYc?= =?us-ascii?Q?WDJ14gaIsKDu1uUjG1MryKdCPJSWQzKKJJSymVCOxrGwXO/v1NgmngMi/oIB?= =?us-ascii?Q?wqJ/0nW15ezP6ykQvDNUQR2N6Im2HdJw3+g5fswDBVIGh8xola3dIF2a90zh?= =?us-ascii?Q?MYFkAceYCMLYAs8pK6jpc5xRMVCqHZuvP2E+DVpCwbu9vbcl7lHtp/J4eDnY?= =?us-ascii?Q?jFu132DpJRmQcaxXAD7di1w89YaBMnnXmtfWntehvp66dPR97uVQoI0bcDb0?= =?us-ascii?Q?MITU4o4+tt0MpIpJ3K8t2u4krICNA0ubfarmroAgb17mkKaIg7zlFcwrZHFZ?= =?us-ascii?Q?NXFLo+RQ/A3v4tWjGdmdM+PCxFADlnJ8bGXeC3mYUGStgj/Dk5kVbo1E3g01?= =?us-ascii?Q?wMp+ZMQKym17UiGxaMJx6W1MKqQvpTEL7T6QwedAFkXcCX7ZhEchKse8th9b?= =?us-ascii?Q?8C7Qs5Qpq52E1uoJ7pDIfYjv9FbilzJD04X78/IQVf6Xs2wUYvQoldqGpyuq?= =?us-ascii?Q?Ufh1wv7hZ26vg/PQPPzcAV53rWltOHiQh3cYMjHm+M5xcZ0cAYyk5dZKVRHR?= =?us-ascii?Q?Xg9Ufwe+0HlLBE56EmgrQpoG0UOumm2024dOcnoDyRWJ/WqQ5mUahUrbpiOz?= =?us-ascii?Q?BPvmInNmeGN0wrJkzKNa1W7L21dOXdL9g+OGTHEhUofmNYq6aFKZoTxeZiLB?= =?us-ascii?Q?jYre/2G6zCR/nkoStLHZzIb8WRTjotB39A5a73kJPewELLXJzyUCOut33VWq?= =?us-ascii?Q?10g65x4pQm/JRaleujh2Hr4hSlfdI770MBLiQar4OUpLudFlzf6Bxw820Fj+?= =?us-ascii?Q?YFWUUx57JBM/Pc2bQGdwG+WXFh6o8FDX19Uww81qxfksbac9t/LfNmmwhfym?= =?us-ascii?Q?r/9BP7mvzFHSbE8bR6O2WRoLrShryxvFkAhcx?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0718; 6:Cl+HChl4vH6NR7fNEcTx6L5/ece4CfJH1WtZdnZtZ4n/isO5iE0Xi4HSEtgNoIyYvGbLdJ29jAEaclNVCQ/1z7wXtDWoMQfK18qSsMzmsAPzGVMj2ueCi66sqp0mxdT06rfSTKY9QxX15x57iJk436FuUk20WZOro4Cy82bKemfzgsfBu0WWQj/cNle+J672r9gPuD72gWcXpc/uBcOuoIuwumDIKIPSFP5ozHusZHzyB2m7MbjpQ9E+9XMgQfMamFeMg0GQ5qGx3ZPwzZG/ycIc+d2VpyhwUHMMszctoHg=; 5:A9E/H7PpR4i6oq8DZpLdGKCdPDyH9Pz030DazTVcDiQqcd323Y24IxK0G9XiAOE6LGQcpBhNptcUFDD7RXYQGvG+/Q2qC2m5eAlcFmOw40uOIJjrhpwbLTmrhdUo6+JVS9YokXu4h1ey5+U0MsQjIXtjiuOjiEp+pddZOvTOCZ0=; 24:VnZmpp0KXOLlPdVWWCVXXRcEJxFhlozdFE1TFnc3jmD6TNP+bUqv6umXHaD5ivE7XMuQftgP+mjMUPeVM5675jo6yZZFtm4u3XNC/AMa0NA=; 7:Iq59zQcWIUxDB2yGxTBO3v0m8ysV+2vWY4BMj45EXUt7z7jW4mVzmf7zmliEoP+6ZNM5GYZrxFxG+JdofHYdvnBO4cYxuVhGPXsCKIM1GI3qmnUKplTEBmAzg0phlCzFBblgAJEGSz8eyygLrzMAvcxM537+0x4s/9HO9RGgBTvPo0fP+MkghSbL3L0JZwsStVyirUFRD29MlVLJ/noS1tNwFWYe8Y+eLCaiGcMz2rdcLLIVc8CvKKlPFaD7DWsk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 13:57:34.4467 (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: DM2PR0301MB0718 Subject: [dpdk-dev] [PATCH v8 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, 26 Aug 2016 13:57:37 -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