From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0056.outbound.protection.outlook.com [104.47.38.56]) by dpdk.org (Postfix) with ESMTP id 16A732BC6 for ; Mon, 21 Nov 2016 06:06:52 +0100 (CET) Received: from CY4PR03CA0010.namprd03.prod.outlook.com (10.168.162.20) by BN6PR03MB2468.namprd03.prod.outlook.com (10.168.223.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10; Mon, 21 Nov 2016 05:06:49 +0000 Received: from BY2FFO11FD019.protection.gbl (2a01:111:f400:7c0c::113) by CY4PR03CA0010.outlook.office365.com (2603:10b6:903:33::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.8 via Frontend Transport; Mon, 21 Nov 2016 05:06:49 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none;caviumnetworks.com; dmarc=fail action=none header.from=nxp.com;caviumnetworks.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 BY2FFO11FD019.mail.protection.outlook.com (10.1.14.107) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Mon, 21 Nov 2016 05:06:49 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:886; Count:13 Received: from [10.232.14.87] ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uAL56ju4028414; Sun, 20 Nov 2016 22:06:46 -0700 To: Jerin Jacob References: <1479628850-27202-1-git-send-email-jerin.jacob@caviumnetworks.com> CC: , , , From: Shreyansh Jain Message-ID: <8457ded8-e9ee-76ba-671e-a76aed08f6d0@nxp.com> Date: Mon, 21 Nov 2016 10:39:00 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1479628850-27202-1-git-send-email-jerin.jacob@caviumnetworks.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131241784093978801; (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)(336004)(339900001)(377454003)(24454002)(199003)(189002)(31696002)(92566002)(68736007)(4326007)(65956001)(65806001)(85426001)(47776003)(5660300001)(31686004)(65826007)(23746002)(104016004)(83506001)(8936002)(81166006)(86362001)(2906002)(81156014)(87936001)(38730400001)(50466002)(33646002)(64126003)(229853002)(4001350100001)(305945005)(7846002)(356003)(97736004)(8676002)(6666003)(230700001)(6916009)(2950100002)(106466001)(626004)(50986999)(54356999)(110136003)(76176999)(105606002)(189998001)(77096005)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2468; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD019; 1:UEsXSdSIqLjs2mzQRrdN0SDo3YEir4ZBPpDfOg3b45CcaUuvZ1yuw4JknZtQhm9a/r8Q1iTwnTUrbcu2xfiK7Y3ZFeBpBXe7cJ08GsPqFh1jK1MdY3HLgLVJHj8CCk0d0z+DUE+TZ2CXf4mr7Ak3Gm/ZoC82G0R2AoXdvtMPtLXJHtMqIy1kRd60jf+dQa+chSWTJHdHsxnJTv5IaYi9P2GH1xHTi5YwLcsxYu3vMYpkICJkLBsh8VKQGWKO/+izZHojRgssSLiRUlbyn7w9ftdK+o4SlMprXSotL2P6s2j4+WpeTudhohp21dUdpD07VDF1+O4ZLAXUwNZGB8t0oVJMlQuxNBBv5QPXxunKw7XblmAn+jXeBPmLob+3ios8Dp7Qx+xqF7jaIKXAXDjM0cCUWkYI7Lu/e1nyCq5fN2wFvMeELRVsawTw+X8npmf7V0koCmoe8mAgkf8HbCt8fiBoCTc/fTuHP/pVsy/iBLXym3Xt5xBEQK4HmIqMf0CN034+kTQZykwwCXJQCNdHCoElIJXTBz1AmqW5+AOB6xlTn+xyeJLIM0bDnuSP8+wZ1YnzT6lpOh1gezomDmOX2Dy+FaNfrnS5JgneX7lUqwPZ80EH8IjSexm13T4BLy55TSyvvYfQjAQGVeTUAfCrWA== X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468; 2:sHRFW63+Iu+BNUgyUtPfXOep7bAoIx+NDI/22rdqbkH6r5h408diCOWfznYmKXYCYSWpTtYauj1YM0r6Eq+CY8tLEX1uY15IK5ABeO5u1SV4BFt1OE3K4Yd+x4C3mrnFtB8CPvlJs45XG+vYvcELgLiWeNAc+eckHlno5Y8WDYg=; 3:asTC7Z4Tl6KGorxREpUmDTQ8txswrzp65DxiQ8ltPQyjqT9gLBsyQtsiMEeG1/FUEG+fT8E83+UBgV8eOw7ddKiiDzF0zsAR3TihoxYZ9TXYWm9ApAVfsvvfDSlNCxOOEOWWkOBrrGZ0avyL9KkP5EzLVoywQNlfO869lFVUKwo+vMBjzt4Lysf+CV8ATdA8RgnuWlOJ0QaeKXBx25tjt3bUBh8GogqzpqoRjDYxzL/eptdJvyTOfqds6T/3weLkJnocTKsmNLQOHZaUTJpfDA== X-MS-Office365-Filtering-Correlation-Id: c957c2fd-5282-4f94-cf51-08d411cc3310 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);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qTNCT4VHcS3kWFpy3Jw/RS/9NuwXrYoa1rYuVFTTcY0VPllloF0gYEKKSz1OypleUVTM4qV8B53VfO+ufdQSLBxSFjvl154g==; 4:4nndsA6qER0F8/Ly4sIvEaZG4V4BUbe2WUup2xFo766M4jHJ4qahSJjr+2fm2DfxKHlThJry60xVUKcFrXRXGqe4jEp4xPEGLbZgT3KYklZSzjoSTbAdP/GLvBMDEO4jaAxJ7ODBGWPKYeSVn+oZ+uw9/5a8cGJGTiHKfyHluExx/4ugw3R6zjC/S4eluuU4ysiec8c96muarrsCGzKk1DLMhHy4+QVEObyVxRqf0zf1N8pXzj5AlXzYwVXQ4mFvXR8kDBdfnxKl6BBXBXEXmrA3rD7xCdDQzRrv9swistz/mdHTX0EzoSWPb6E0df3WuHRpz+g0mnS3Vd3vgOns/bMvrtxU+YZ/eiEoer5KJ/Cj7I2PJbDtbQRzUCGL8WAG5eHurCTGx7hzM48HVcC0dRsuMMfyuNGwWTcV9dTWuZCGtOrmYheLmuX+Pr0vYil2V++C23N4FZS1eOYpRRgQdF84ZO1ft4rJMCX30Pob76LBU0nR+8E8NHgZ3h1e/McehEdHPkUM2RsGF2WUSvrrRd7eon8IsyKzUV1aAgA+U5Q= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095035)(601004)(2401047)(13018025)(13024025)(13015025)(13017025)(8121501046)(5005006)(13023025)(10201501046)(3002001)(6055026)(6096035); SRVR:BN6PR03MB2468; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2468; X-Forefront-PRVS: 01334458E5 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BN6PR03MB2468; 23:pnq1snUSOPr3jQC8QlyTO88OvFKGDJ/sfJX1v?= =?Windows-1252?Q?1DK6i30A4CXKpgzHRtzGG/eU2LCjdjvCWfNddeHNktfR6lkDVFOFcm+W?= =?Windows-1252?Q?mbQ88sR/oxmBd59n8xs4IeFRuJv82wRw5dMcsmClnTUz2W9VGyKUWi13?= =?Windows-1252?Q?IHB/HlPLpiuvj31MPJpId7lh+bVkXt1qquEp96CEcVXNIMxT5554AcGl?= =?Windows-1252?Q?1Jc8i2Xa0lab270xjF6OOtZbKe445efOxF4aOjQnfAHCcIWSCpLDthjC?= =?Windows-1252?Q?/b2+YVn2mukkFi2I2jBNn3Zbdp1zzR/p/uc9l6ArJpY9c/X/no1zZ6cr?= =?Windows-1252?Q?DlEvVeCfPY1tdwZqpLwqk5S19kOa7kLTYirz46kn05wmBQoTmndQTjnf?= =?Windows-1252?Q?n8bZai3kS51CiKtLGUI7WZunPf3hQzS/l+VqMfkiw0OJpZKXGLOnPR4/?= =?Windows-1252?Q?/Ll63eDrvAm6uqjGMD7tetzee9soEpzrSH1gWR0dvqo6+lmj25V+07c4?= =?Windows-1252?Q?g9NTQUbHwD1H/jBc5fMGj7i0WReIQ5+AFRGvUD+4a01o4SGq87hErn4T?= =?Windows-1252?Q?X8zk/LHkZ33NDLZPHJOHcNF37TtH08zY6TxRc+fYYgUEjFtcMLXhXU7H?= =?Windows-1252?Q?TR0tJGus8RWEPiN7JpbF41GGc1LRk2JgKpPOEI/6D5Quo7MSBzpKxjpT?= =?Windows-1252?Q?n5iiN38uvSJAN/nhgTq11jFTFgfMSrtR8Ht7zqgrWnH/b997nUGp2pGt?= =?Windows-1252?Q?1xrU3WyQDJ1sulNDI387GwVcM2PKicgFv2b4V6smtAtFpfCdasVOB05C?= =?Windows-1252?Q?rxDJMXRPspuJe08RCDIhUgf7zK/1yLYUVPUWOrGimvF1+o1oipUGLRCK?= =?Windows-1252?Q?rPBsIcv5NB1JepiVrmVAxWTXhSeIZ2y6t5E3HVbyuqFID9OmRGhtqYvg?= =?Windows-1252?Q?N7uEMPT7lUcqpOKrZCBVe/81muZO1c+kmcLOG9WDQBaLKHpToGwPf6FC?= =?Windows-1252?Q?6bqZx0R4ZUbJJEi7OUxROXzAohy6rvvFjiC/AV4P1/JQEu2GuUrcxoCI?= =?Windows-1252?Q?pm1ttJ6VbYl21vGYliZi7ltXsJQxzKE7os++5t3v+0GR2d5x6/lZezTj?= =?Windows-1252?Q?MzZmYuvKfzdypI4vN6/fm5tPUoj+m5gfMY0yIcHf3nfk2TqPJ28Rqgi5?= =?Windows-1252?Q?hcAmf11M/nESgvgct3fge33zftb//QvN7y7QfDsomL0fmb6oypsv0FkO?= =?Windows-1252?Q?L9zPnjEuQRAnU2VYDB5wpi0Ybvbs6fbo0ef/x99skCoY5//IAF2Uak1Z?= =?Windows-1252?Q?UPxPY4CsclChG9qbvPlse+pBocb6Pv3WbBDmqy+kw5CPbUywfXOllhD7?= =?Windows-1252?Q?cTUtwjvnP97eI/dM1NE84m1HVkinZs2zUpQESMr6ug9eCwwrLQLvD0?= =?Windows-1252?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468; 6:BBf7oxJ79ox2qKvBzInQqWwVRnn3TBORCqT3V3/EKCzt9HkHyJVzmSWlDQyJc9h/4+lfPehY2l5nligLv+PTw5jveSzIYkzgNSbqO/e82y7G6vaN0AWjkLm+gxUS3agUVedEm888b2fjbxCgg+iQOq0oqxt36/bhg2OK1RJgPNJe1hbeZGjjNG81zjtfJpzAXot9JQ0xtjhEDE7+dZhi9VcHdHhUwUBwEgjBRVRYjMZi4pjv95/mR0fYdI38cotuoapB60Z9cOWAsq2jaK2BJo7L8gFgNBMp2nEmc8+6ysxwwTxqwiBIYSDOATcgoPrMDZTkpklC/WojAEa6eBNObw==; 5:0ib5rlNfuFi1MJexJdYomT/bTlR6bfZ04h89Dzp2X3MmRpC07JfINji7Uk7rmXuPd9qQLlM1P32buIbo6umf5Xs2qPimTo3wrT+BlqtXnQ2l6xDJEKXAjPWWtwEMgy7j4GRygaaXvRtHZDKLKjFnH2D/Jz1qXieDjgLqk82KunVi10qZacGjDNCcJZQ3xgSs; 24:s/d+2E/okLrTVO4Rd8/SO8SIcki2uxXzvs0ys2VZK8QbL9cHVO6xOF3CGlY/ZN4tjoXdr9E+hVRcsZQQ6TbnOn56+pMzrEFaQT/bpUfCRpg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2468; 7:8fLOAUa5kAoLiJCZN7GGwpBtzAudjoUoOlEv91vRg3UG9yg7ZYtxVKaY1B5XioAlN45wQlgS0UtRtwYvQq9vvAo4zZri6ZpWLE+DTsTXLu18tf5ACUodrd6cYz+iz4OnnxxjmQCwlnS76WwkiWvfp0aDYiiJihJP+oS0kBguKsYn6mJ3dnIDRHLiUYIReWzguHRLdG0v4Pc7IjjOGXwZcmNSksWbBNsyyXgLWTKPKadlFFnK7sFDGI2i1uQSad3V4xQ+FrSLpOFvUoEyrlb2zSoUgK47hwDTuLoq8IVsHoCuCOwysydZl1IEIQIVdG8JIolaY3avrhSB6B/PhH3BL8TTwx35QeYDtfzLL40f8rY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2016 05:06:49.1794 (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: BN6PR03MB2468 Subject: Re: [dpdk-dev] [PATCH] eal: postpone vdev initialization 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, 21 Nov 2016 05:07:00 -0000 On Sunday 20 November 2016 01:30 PM, Jerin Jacob wrote: > Some platform like octeontx may use pci and > vdev based combined device to represent a logical > dpdk functional device.In such case, postponing the > vdev initialization after pci device > initialization will provide the better view of > the pci device resources in the system in > vdev's probe function, and it allows better > functional subsystem registration in vdev probe > function. > > As a bonus, This patch fixes a bond device > initialization use case. > > example command to reproduce the issue: > ../testpmd -c 0x2 --vdev 'eth_bond0,mode=0, > slave=0000:02:00.0,slave=0000:03:00.0' -- > --port-topology=chained > > root cause: > In existing case(vdev initialization and then pci > initialization), creates three Ethernet ports with > following port ids > 0 - Bond device > 1 - PCI device 0 > 2 - PCI devive 1 > > Since testpmd, calls the configure/start on all the ports on > start up,it will translate to following illegal setup sequence > > 1)bond device configure/start > 1.1) pci device0 stop/configure/start > 1.2) pci device1 stop/configure/start > 2)pci device 0 configure(illegal setup case, > as device in start state) > > The fix changes the initialization sequence and > allow initialization in following valid setup order > 1) pcie device 0 configure/start > 2) pcie device 1 configure/start > 3) bond device 2 configure/start > 3.1) pcie device 0/stop/configure/start > 3.2) pcie device 1/stop/configure/start > > Signed-off-by: Jerin Jacob > --- > lib/librte_eal/bsdapp/eal/eal.c | 6 +++--- > lib/librte_eal/linuxapp/eal/eal.c | 6 +++--- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c > index 35e3117..2206277 100644 > --- a/lib/librte_eal/bsdapp/eal/eal.c > +++ b/lib/librte_eal/bsdapp/eal/eal.c > @@ -577,9 +577,6 @@ rte_eal_init(int argc, char **argv) > rte_config.master_lcore, thread_id, cpuset, > ret == 0 ? "" : "..."); > > - if (rte_eal_dev_init() < 0) > - rte_panic("Cannot init pmd devices\n"); > - > RTE_LCORE_FOREACH_SLAVE(i) { > > /* > @@ -616,6 +613,9 @@ rte_eal_init(int argc, char **argv) > if (rte_eal_pci_probe()) > rte_panic("Cannot probe PCI\n"); > > + if (rte_eal_dev_init() < 0) > + rte_panic("Cannot init pmd devices\n"); > + > rte_eal_mcfg_complete(); > > return fctret; > diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c > index 2075282..16dd5b9 100644 > --- a/lib/librte_eal/linuxapp/eal/eal.c > +++ b/lib/librte_eal/linuxapp/eal/eal.c > @@ -841,9 +841,6 @@ rte_eal_init(int argc, char **argv) > rte_config.master_lcore, (int)thread_id, cpuset, > ret == 0 ? "" : "..."); > > - if (rte_eal_dev_init() < 0) > - rte_panic("Cannot init pmd devices\n"); > - > if (rte_eal_intr_init() < 0) > rte_panic("Cannot init interrupt-handling thread\n"); > > @@ -887,6 +884,9 @@ rte_eal_init(int argc, char **argv) > if (rte_eal_pci_probe()) > rte_panic("Cannot probe PCI\n"); > > + if (rte_eal_dev_init() < 0) > + rte_panic("Cannot init pmd devices\n"); > + > rte_eal_mcfg_complete(); > > return fctret; > Movement looks fine to me. IMO, rte_eal_dev_init() is a misleading name. It actually performs a driver->probe for vdev - which is parallel to rte_eal_pci_probe. - Shreyansh