From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0065.outbound.protection.outlook.com [104.47.40.65]) by dpdk.org (Postfix) with ESMTP id 47962107A for ; Wed, 13 Dec 2017 16:10:55 +0100 (CET) Received: from BLUPR0301CA0022.namprd03.prod.outlook.com (10.162.113.160) by CY1PR03MB2364.namprd03.prod.outlook.com (10.166.207.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 15:10:54 +0000 Received: from BL2FFO11OLC015.protection.gbl (2a01:111:f400:7c09::179) by BLUPR0301CA0022.outlook.office365.com (2a01:111:e400:5259::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 15:10:53 +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 BL2FFO11OLC015.mail.protection.outlook.com (10.173.160.81) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 15:10:46 +0000 Received: from [10.232.14.39] ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBDFAoXl001181; Wed, 13 Dec 2017 08:10:51 -0700 To: =?UTF-8?Q?Ga=c3=abtan_Rivet?= CC: References: <20171213144704.4d7675gw7iaasvtb@bidouze.vm.6wind.com> From: Shreyansh Jain Message-ID: <83cbd5e1-fc40-534d-09f6-d47f094028df@nxp.com> Date: Wed, 13 Dec 2017 20:54:25 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171213144704.4d7675gw7iaasvtb@bidouze.vm.6wind.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576514468418684; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(346002)(376002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(24454002)(199004)(189003)(93886005)(81166006)(50466002)(105606002)(356003)(36756003)(85426001)(53936002)(77096006)(81156014)(6246003)(2870700001)(2950100002)(68736007)(5660300001)(498600001)(31686004)(65806001)(65956001)(64126003)(97736004)(2906002)(31696002)(2486003)(65826007)(23676004)(6916009)(6666003)(86362001)(76176011)(316002)(305945005)(58126008)(229853002)(4326008)(106466001)(8936002)(47776003)(67846002)(104016004)(8676002)(83506002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2364; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC015; 1:qPeZxlSHf0mNFUHmetT3aEhBHBIeZ7gMIISg9Lqcp5ZL1/xDqfodd0YvUHLopZrabBc5ZGjYCQ4ZRr4GslO3QdmR+T5ChiECQgJntzpl8cgDrWDNwBMQewxcV4/1++yI X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd00a578-f450-40da-3320-08d5423bb021 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2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4:eWCsZ6YiQkDz3ZFwqsSZ2UDwJRyKFTgpq6mcq0/pci+/ez/X05KRwIKGN5Sfrudr6D2475UXsxGlW2fnMTcYqojM1txOOd9oVYh2s69NaXcw71m77tCdXl9YH9mVHQQCzNCQ0VDBaJ6wcnavtTwsgCI1w8btmvvIXFtlCQ1GrXl6ptjdhNIeknLh+mTxdbxETxZOWxEwpfrOkVW0s9Ivwn1Mi0QCz0SgBtE1qKFbFlPL6FZ6i6EA2ow59Wd4T+GnebviW0+eDy0XDib83tDPyg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(3231023)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123556025)(20161123559100)(20161123565025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(201708071742011); SRVR:CY1PR03MB2364; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2364; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAzTUIyMzY0OzIzOkR3eUFZMTlHbDJOc0hDU0VZUG1oNmRWb2NX?= =?utf-8?B?TFNUd0hEWkdQWW9mNmVrWnpGZ05Dc2doMGdUMTVidWVtMC9xLzJYemQ2UjlN?= =?utf-8?B?dXcrZ3g4NWMvRnF4L2krTENRdlhpaHRvcStaS3ZpeUJTcGZKcE9QLzFZT1dL?= =?utf-8?B?aG16dWpxV2FYWXVLKzVxNkJiT3doZjJZajNZb2YwM1hFblUyYmZwQUNOaDhT?= =?utf-8?B?Rk5PVXcrU09VOWlRTmlmT0hjUCtUN2NlVSsxdVJnT0owT1VxWW02YWhpVEpx?= =?utf-8?B?R0pkYUVUU0J0VkpqUXFydENyV2RDc0xLOC80UFVVSThLRCtwc3NTRXFUZkJY?= =?utf-8?B?Sk5CalNJ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v5FQw+ifUkx5pKoZqoUg6F3wVkIegDmxTmVtiYyZXlJl6Sa8b0gldxAzvl487TcNydJIGpdB277nCOrJgAJbiwQEhsl9sOTK1xNoXQJmo045gFU=; 24:nKlGICfV6Un9tOnXXiOmMQKTGeYPFpuSeTEPHTLcxl57HGBS6F/nt29gaFbksFAIPcA7NZhpUjJM4Q+YiEy2pD4oaxP9BYUAp0RSjW3/D1M=; 7:T+K9oouTUdT1/VAtssVFW9KlANHtCGI4T4NEmxrymLP/OzccZ7dWt+GOM1KGkVdl6RlfevIXkWO/pVEoVkjBGZlDkYpDskOb/7cCaOSGqniZIThEai3Kgf5P5wH02Lo697X21O9thiTp66h81UEYRWH3HthOTVYgbYAhrQ+/hKYS6aS7aMShVc/QY2JkEE6d9reh7RKL6DyPFw8HWu0dWSVhpmqn429vdRdgvSTUfciZmUQp5pnlc3K+ycE+5Sit SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 15:10:46.6546 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd00a578-f450-40da-3320-08d5423bb021 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: CY1PR03MB2364 Subject: Re: [dpdk-dev] [PATCH v2 12/18] eal: add generic device declaration parameter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 15:10:56 -0000 On Wednesday 13 December 2017 08:17 PM, Gaƫtan Rivet wrote: > On Wed, Dec 13, 2017 at 07:56:42PM +0530, Shreyansh Jain wrote: >> On Thursday 12 October 2017 01:51 PM, Gaetan Rivet wrote: >>> Add a new generic device declaration parameter: >>> >>> --dev= >>> >> >> [...] >> >>> >>> diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c >>> index 603df27..b7591fd 100644 >>> --- a/lib/librte_eal/common/eal_common_options.c >>> +++ b/lib/librte_eal/common/eal_common_options.c >>> @@ -95,6 +95,7 @@ eal_long_options[] = { >>> {OPT_PROC_TYPE, 1, NULL, OPT_PROC_TYPE_NUM }, >>> {OPT_SOCKET_MEM, 1, NULL, OPT_SOCKET_MEM_NUM }, >>> {OPT_SYSLOG, 1, NULL, OPT_SYSLOG_NUM }, >>> + {OPT_DEV, 1, NULL, OPT_DEV_NUM }, >>> {OPT_VDEV, 1, NULL, OPT_VDEV_NUM }, >>> {OPT_VFIO_INTR, 1, NULL, OPT_VFIO_INTR_NUM }, >>> {OPT_VMWARE_TSC_MAP, 0, NULL, OPT_VMWARE_TSC_MAP_NUM }, >>> @@ -1120,6 +1121,21 @@ eal_parse_common_option(int opt, const char *optarg, >>> } >>> break; >>> + case OPT_DEV_NUM: { >>> + struct rte_devargs da; >>> + int ret; >>> + >>> + if (rte_eal_devargs_parse(&da, optarg) < 0) >>> + return -1; >>> + ret = rte_bus_probe_mode_set(da.bus->name, >>> + RTE_BUS_PROBE_WHITELIST); >>> + if (ret < 0 && ret != -ENOTSUP) >>> + return -1; >>> + if (eal_option_device_add(NULL, optarg) < 0) >>> + return -1; >>> + } >> >> Might be a naive question: Any specific reason why we don't add the devices >> directly into devargs_list here (eal_parse_args -> eal_parse_common_option >> -> OPT_DEV ->) rather than wait for eal to call eal_option_device_parse >> again? >> >> Is it to allow eal_plugins_init() to finish? >> > > Yes. And actually this makes me aware of an issue with this > implementation. > > Calling rte_eal_devargs_parse here is premature, and > rte_bus_probe_mode_set as well. > > eal_plugins_init() must be executed before calling rte_devargs to allow > for buses introduced as plugins to be able to recognize their devices. There might be one more catch. Maybe eal_parse_args also finds all the plugins to load (-d ...). > > I will reorder a few things in eal_options, thanks for catching this. > >>> + break; >>> + >>> case OPT_VDEV_NUM: >>> if (eal_option_device_add("vdev", optarg) < 0) >>> return -1; >> >> [...] >> >