From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0059.outbound.protection.outlook.com [104.47.32.59]) by dpdk.org (Postfix) with ESMTP id 542A120F for ; Mon, 21 Nov 2016 17:56:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Ymov1LBF68ILEh/Ti/jlrCe2cVuYgNQP8ss0TtLR7WE=; b=V9c4IrA4tByizh00vrGHX9R0RcYkiuywZ0VmBiNGOicmug4tx84jq3h8MCTy6j4x2QFOg0v/p2tVDD/7eonUJAwEisuMWE+cai8qAvl+EpbgPgUcf9O0sKZeSZTSsGjFfEc3CPRwcJv/4pbRR/9CAK3F+xLMQkXrc2VhTfqa7t0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from svelivela-lt.caveonetworks.com (50.233.148.156) by CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Mon, 21 Nov 2016 16:56:44 +0000 Date: Mon, 21 Nov 2016 22:26:40 +0530 From: Jerin Jacob To: Shreyansh Jain CC: , , , Message-ID: <20161121165639.GA5717@svelivela-lt.caveonetworks.com> References: <1479628850-27202-1-git-send-email-jerin.jacob@caviumnetworks.com> <8457ded8-e9ee-76ba-671e-a76aed08f6d0@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <8457ded8-e9ee-76ba-671e-a76aed08f6d0@nxp.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: CO2PR11CA0009.namprd11.prod.outlook.com (10.141.242.147) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 2:Ig9V1DtLbkaZG1DWe/47BGjzkA95O4SbO/wb0TK0pZYCQNfbqFJK3zwFhagf70PUbVq34EgOl7y9h8kDqsEicUmsn1Ar9mtbVD3x1hNiJGokVDqJfvAIueQu70/+USQ2IgZzushY102IXi7L/1uTfhVw9qd83tP+SZ580+hhql4=; 3:JQTWCDOSXYpyaf3h6M6sk/+0lMfvQtTjLW59nVqPMpyq/8zrfwAnWa51NT0dMmxgw6M5HHLO0hvthBRdAORRhjfGlFoHg3vWVv8Y6Nbtk2PML2eV3WZj5qO39Kj7UXbOuuUiZyAYfHP4Z03uBEU6efumdM4XLlVeWIyXclVNac8= X-MS-Office365-Filtering-Correlation-Id: aad491fb-0457-4efc-bef1-08d4122f5ffc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 25:uV0sLWrUyWf8/lNB5+qHkQBvayRfYB/Hf0kL2s9JgM5CbWEhk9Dtf8mgdaYLQ73vt5tZr+jeEMyL+jzGOIA0JTWcsYzDTWd3kB/XH8L+ETiOKSPfe435VfX22HdY8Cnube9LB5fzLkaRf9v+FndNIOHzvvUeWx/By3RGMSeGtErPUDhX+wC64BRR0dpsdDuI5HWle/Gsw4igms/FUejN9s6UauE1Wka5wXwTyrbnt9Rn7Ri6TrzBQa0YJa7+F4IczXq8fSvgiCnTEwnHU0iJ44/zunPGtovRo5PpzqE+J1vXzaL5SKJ1otPitZ4ALnzGMpZ4GZz0ANZNCFL6xgmsuaIPY5em63M/x6AJlVKBDR2QqgLfTVfnKAeaEndAATUpPad7P01Gw11quSNDRkWY4qjL5VtX4/mKwSD8wW2to41LheQfbb5DU8h6FtFFTuDGSvhHpHpVXk4JUwk/tqw2/BKyINtwT+y0rHfLYwasYh/mQac1OxQbvnC/FO5dN6WOMwtZvTJWZ27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gV0ruTiFq+6QtDpT+uXQBGWuA18GXWpRV8hzVrBs/0DkF4POIDv0wAHR08xAAw/hVIklSE2/PjENm3k4+sgxirPLObMho2HlIGUMeKD/+MA6D+W6y2h+2Pd+XohFmX4ZRa6eaDO5KnPWM3owAbjYc0YR/rziBM3E= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040307)(6060326)(6045199)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(6061324)(6042181); SRVR:CY1PR0701MB1726; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 4:4RUl5snrJguEwEuGzF/A1v6BxTyIjV2aGIa+A/JJw43TeLdEOXGgq9B9mc94WsXPSvMh/GNpngvxq/+QYgZ8Y547BjgnSu7jGBuwcdsMiiRwpXnyY3gYxNgRw8TfZGEGhl3SjSKSKnqY8+qNwwxYeyZ2hGGhWgVyfgVxVyASYHVwV1PTfobWs7M0xhUbsUU44dGLWHFAwmvXWEt6CAipDVBaXKFLAsNB/T4P99qd1LSK2rq4S+3B3hlOb09Kam+IUZlIEXvhGa0qaR8E+weWccq1jvWEE84oGQhLKmY5SnFkl8HCzatKm94HVB6YqgTDzazNSpzRNVbBe+tbUnGTBfZam8mfw5eyscHopEU//ezSBi+ywxpbNNWui4bcD+4T2qRSqS+ttnZyWvqqn4G0o0Nl5sjAj1CGgzHUaVAA8cMzUCPnDVnKiWprJK6TEP706gZXdr8gKFa9R71E2mnBsKGpafM9UJjDl9vZFHJv3yXTmxTe6x/3Eik/Yh8RPUiG X-Forefront-PRVS: 01334458E5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(24454002)(377454003)(199003)(189002)(6916009)(50466002)(47776003)(42882006)(2906002)(229853002)(7736002)(110136003)(6666003)(97736004)(4001350100001)(42186005)(83506001)(9686002)(38730400001)(106356001)(92566002)(4326007)(53416004)(68736007)(8676002)(189998001)(77096005)(46406003)(8666005)(2950100002)(7846002)(5660300001)(23726003)(69596002)(33656002)(76176999)(1076002)(105586002)(50986999)(54356999)(81166006)(81156014)(3846002)(66066001)(97756001)(6116002)(101416001)(305945005)(18370500001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1726; H:svelivela-lt.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1726; 23:XsulsW6mhiMA239qfzJbbkIY7rFdUt8dFN/wgsR?= =?us-ascii?Q?ZEnya3LnL+fOtjCgPJjE+7OgOfNpRzsNpXVCNX9HRFwbegoFj7i3VkJlK9Pv?= =?us-ascii?Q?uQ+Izi+I/WkS/WiOd9eyVRA4hFbNiZ1ppQ5/AR7IEewrb85nkirKgd5bcRhe?= =?us-ascii?Q?ZCVdXw1mbMHecyYzmfygWdUWNYakod8s3wkC6xzPfJOy0h5peQq1iLzR9hsG?= =?us-ascii?Q?qtdCrKFGWX14uxbCAeERriOQwc1Kl/y6ZqIQMtMWX/3RywF4QGJAjZ6bkBHf?= =?us-ascii?Q?NrKGJPg6Pnda1J8BVFKzIwEfDV29sNkBpNAskG4z1Ly1i5zznfnCHyJ1h4tt?= =?us-ascii?Q?HcemfqZ999W4XOI9rkh5TKwIOnmPP37LwnwNVF+tBF4S/zmQrY1NeBevrW+k?= =?us-ascii?Q?YIcnP+V58Tkfheux/QBvE3UlJS1TJb2xMORnBFKFFBKUvAb6AaKJmGERas9r?= =?us-ascii?Q?r1YAuuh4lBI0A9KmoQccaF8GFTKvrUXZKayjAd/vI10mhXWXINh6FUya7CAO?= =?us-ascii?Q?Ur/Ms6XidFmc+ninOGagSZkFqbeZctI3r7H2k2jz4kvwZ63CrsDUM8u77gwh?= =?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iPGIgBsHji76gAGSm92Cl67ZuyCvNaJO9Mju2vrSMhZWLYVRYk6XEKeyxTHLiaABhU9oUJDtE92j+cUGege2SZA17jyWNe6+CbO4MBqB/IyPlVwJG6snCVZ2iULEyRrsm88yT47o5PbMEPsjdI6a7sbFJ+9y7Z+4wePJupRrHZzQeFS6Lg0Z5eBaY2m7dS/9AoqZFVpyuAbqG7nbw9zOGfbIpHDGrKpmLZCb6oJIj/3iYhF5xUAfx+KPQr+fdt4M=; 5:33X5yOqImxGDs9ZwXDgOvfZN3/wSUr3JJtLGS+Iqs1wOoV4u92c0CzuqHwPCM7ZV8rlYxJtf1+IKLDRexuoOuVnEvsrJQZyxitL8zxtFKPdE1833Vh78zIctb44YhoImgT6Qtbg3YE1lKNXwB4uMLw==; 24:9EGA/wdt7VGnR4o+70KAlYQ8cH/6YIe5kNYBETB48kv/7QuooEMAJLd/yzERM5/oeGx9hFfiQe8bCkiFLW4tf/sg7yEii39H0czLh57y8WY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 7:9mA/Q53CJYc6K39lWTqLxmvayEiMgLd6KhW3Z1MXewghb99GqxP7/1ub9gAIZbw4AMTOHWKeamiQd+965gVS4g/1F0PVCqLTV/AQPvcdX2KM+ffUklOgh42u0F7bZgm/C+Vjeut+2zk9NsrFEOeylSmzIx2Vnz9z+FmlZ+9DYocDUqdqHROfJlM/NEj5IKXqwHuFlQ/CNmlVNgBj4SzsmzRO24XEj/+QpnrRUB+XBSJf+vGaRCGycubICYP8l7veXc51lIOf+gbrba8d0BXw9BNahAXeWyCjFChEFqfwn6cYAtoogA0+d9daK4StKXZ/6UUHmaUThdJzW/X6WrPbW8F8+AooOANht60ZoEv2JlI= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2016 16:56:44.5651 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 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 16:56:55 -0000 On Mon, Nov 21, 2016 at 10:39:00AM +0530, Shreyansh Jain wrote: > 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. Looks good to me. If there are no objection, I can change to rte_eal_vdev_probe() as a separate patch in v2. Let the order change patch be separate. > > - > Shreyansh