Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932558AbdCUNoD (ORCPT ); Tue, 21 Mar 2017 09:44:03 -0400 Received: from mail-db5eur01on0078.outbound.protection.outlook.com ([104.47.2.78]:34816 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932484AbdCUNoB (ORCPT ); Tue, 21 Mar 2017 09:44:01 -0400 Authentication-Results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; Subject: Re: [PATCH] pci/sriov: Add an option to probe VFs or not before enabling SR-IOV To: Alex Williamson , Gavin Shan References: <1490022874-54718-1-git-send-email-bodong@mellanox.com> <20170320230706.GA12252@gwshan> <7bfcfdcd-e0a8-f1e9-f112-fa35fdb845d7@mellanox.com> <20170320225708.6868676a@t450s.home> <20170321054305.GA12230@gwshan> <20170321000158.444991a3@t450s.home> CC: , , , , Eli Cohen From: Bodong Wang Message-ID: <7d9d8756-d737-66dd-4c0c-f407985f3db6@mellanox.com> Date: Tue, 21 Mar 2017 08:43:32 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170321000158.444991a3@t450s.home> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [70.113.13.4] X-ClientProxiedBy: DM5PR17CA0040.namprd17.prod.outlook.com (10.173.128.154) To DB6PR0502MB3061.eurprd05.prod.outlook.com (10.172.245.135) X-MS-Office365-Filtering-Correlation-Id: 0afb4332-dde4-488e-3da5-08d470604f59 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081);SRVR:DB6PR0502MB3061; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0502MB3061;3:aUdW/3C1GVc3tiyrwLYpTfsWEES1kyTwE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9eXIMK/VHW59Duvt/Uy/lYWDnpCyvzjBZoKoe3knrLuu/IvMZrtfaBjfULPHcvmpb1qr1j7eA82zF9MeH/7FFayIlRGkAoBTx0z2LhOSO77N24kowsaY7t4raFbclKLUfxtMA2hQhwU927m6IoKghzgPtvGubYE6d+yJxlvNBz7TRVsvPk7L+QOXowmqIL6ak6i75tsCo3e0+2qc4Yh63YFFCtvLvQQClJyd3H6fkIB1hkTyAMfHe1Q5AsibT1p7R2YBA8FsfjDxlqOfvC4H8SoRpwlvdJAW8rDHsBTdFNN/gzGpGSOomdjmSQ6KYBBgKi2VipjO0j63wwxS7C9jQjgafdVRmzR0yB5RucFrH7Z8DU7pEZk4bfS2EoenK9Lai51/4UsSf1uIeXTX9PqAW83sXYi35tEaZ9eEv9RmElU8bboltoNCJBj3YuyBMbrup66OMun+HyPxi X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(104084551191319); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123558025)(20161123564025)(6072148);SRVR:DB6PR0502MB3061;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0502MB3061; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0502MB3061;4:5QWu6nle7yba2EBKisJlPp9jHCSVSTvn4okvCKUltT2TwvToLZpg6k3bNUSGcWzjM0Ie2kHD3nNcVootBryW7c1sbvyLrF3T7973Ih4e3nnPbKXS9RPxGlqdzaW9Lzf/G+Jm/XKyMDaS/7U2D0cGAuWS+DHPfGYi/xBp56G8KIDKo8CtW/l4plNhNksOWTEj6xpse94CG+vWqjFhPcG/EfFqSxBZXLZcv6TyPf8c+j+LICYTK5pwS0W/t7av3xn0FdqD15Ap1axS2G22BZIe4gWDNuDZJcfcQUh8XcGUg2ehiFgJDHBUrsK6BdjddWCEaoC+hY7bcBqc/+lhUMiiSLQCkjqoqymCs9A0mKfTQXE9ARpk4bYhHkuCbIebcOBR6NGxxpglBG4ty5pWG7tIssVqfl37ESUu3oRz/+5YFIYl61aNJfTot9ltRf407nfZBpVR3kfWsZXc+rHp0P+I3pjAkQCmVd8uJ+yIe1rblQpvwX5nX4tnL9yBFkuPvl24aJtF6IxLX1zpUWIslpX0dxXcfSHuRw7izOhDBHfLjmJhCNG7RdFVxa9lPiFFYNxVVHLJswBjLqExzGrudQ2F3cg33D+OvTgZVzGDvjsjgVN0QCvx+0F39NbJ8Lv/ykny+7HRuG2Hr06EqTLB/OB0jdLsKJBcD9ux3EPGbc9b78g= X-Forefront-PRVS: 02530BD3AA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(39840400002)(39850400002)(39450400003)(39410400002)(39860400002)(377454003)(24454002)(51914003)(5660300001)(50986999)(3846002)(6116002)(93886004)(31696002)(31686004)(65956001)(42186005)(6666003)(107886003)(4001350100001)(2950100002)(117156001)(53546009)(81166006)(66066001)(76176999)(36756003)(8676002)(38730400002)(50466002)(65806001)(54356999)(2906002)(47776003)(305945005)(7736002)(33646002)(83506001)(54906002)(86362001)(53936002)(189998001)(230700001)(90366009)(6486002)(4326008)(77096006)(229853002)(25786008)(6246003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0502MB3061;H:[192.168.1.110];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DB6PR0502MB3061;23:ohNiRTSdYszJ6CB2p4FA6YPcSE0yh2fJipF?= =?Windows-1252?Q?TnWCd/H8Dnz1Q4Y1JuwsFutc0kKscBey9VtP5hL8fhn1pLKcN2BryD5z?= =?Windows-1252?Q?frgbYHgsX2XXU0+XpfPGat0ouPoov6rpKdNWRPJni9/2DzwD3bQIaXyN?= =?Windows-1252?Q?+06et8+b8QIXo7pwJZjRwb6Yjv6s2xZ2Rwgrh8Yi2Un25FMDW2XRjYbo?= =?Windows-1252?Q?CwG/zhhQ7eJqgHRutRGbe8hcAcsUDlkmNLqm1BbI+Kc35nYOgM1Blrr2?= =?Windows-1252?Q?9WMMH/HMgCMX2Lyw9XrMQZgnghFRsFcuFrivV6UR6yucoiuJxXfSOHEB?= =?Windows-1252?Q?HhF0EQslSvkkCKBYY7dUA0eQ8lW5SNzUSbPko1lJf4KTcqOv4/1wQUGX?= =?Windows-1252?Q?qrz6OsFTs/taZofw3YvqleFhNEUMGN0fXFV9qXUrSZT2mPaWkn8WBNT+?= =?Windows-1252?Q?1miM1Vv7bHyLeJK/W69uIX51flAxGNxfgidmxSJ2Lq4nEQ0B8MPjKBxf?= =?Windows-1252?Q?rgVrbn+d9mUA8XijBHNtcdcGhdQgJom3s8Bau2wlU/Jigub/Awz7ptJt?= =?Windows-1252?Q?j0T8c72EoenlHyGnPpu6/hHW8Sx3krCUqUKiR15vhVo/4zajOqiSFnOM?= =?Windows-1252?Q?gHmgA5RIsrtTubn6lfY7I/b/vCbWDljvEwozl2Fq5rEC4eYMpwljPocJ?= =?Windows-1252?Q?aGbTQBtuMc3Z4QLWIhnlAxshjTE7diqWgqXWl6IRpOLVZtGAJ6NPKFD8?= =?Windows-1252?Q?xaGhBz2Pm018Xb8Zk8BJ1LW+sKKt8Xc89FcMho1m9jCN22WDMFfxl/gu?= =?Windows-1252?Q?D0bfCskhbljEJtqcgZ8C7ew51EsDLc66GtS/4BqKTgHcToQrO4ot+lxP?= =?Windows-1252?Q?vRkZbDXhyvfFAVmzyxaOq3LSsGPu0Sqm7F8gqDMV1QxdFdr3nqlu/Cde?= =?Windows-1252?Q?AhoIIS/Wnrv77fXzlof4eZDfbrYAB9dN5WdEMo+SfmVhCtps1ipo96t3?= =?Windows-1252?Q?DyTTdxCYiO6oVh4FESjXodI0h9myZmigXBhC+oEdH+G5tOw0gpxPMN4p?= =?Windows-1252?Q?C836VOuurY+cqTHcwFPagNQeIk1sHnmyH/BOzfYEXfpfXfStT+x2Oy4k?= =?Windows-1252?Q?SZ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BtFIFHZ8YLh9zahwM7cs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB6PR0502MB3061;7:/MfpoCmwJnRK85iLFZoLiN8ZAz9eCsxgQ2iPsQVFavJVASqWjmd1T+hrDNxslBS4W8eckPN2HU87hrlGOsRFiv5m3JXm37M0j9ihbP+F7uXwiP0NE0CV94IHvnCArfRe6Du8authkdx790khUEN2lOsQ6vGYwBENe2QAvEYnM+CJgYAiMiXMPlGZCsbWUMRwbb69vUaYpdLXVob9DCPMQ9CoWbiR6wyDnQZ8QuWQCrYLNbbdoSTjTVPMxoq+y8eVnjQ7kuxaqFM6OYDlNrJTWvEMWJZzHIj6P0+XF2nPPBZ4RdCgywqX41QbWIDXw1hY1DX3SvqbYLKILHtHME2Awg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2017 13:43:50.3781 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0502MB3061 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3036 Lines: 54 On 3/21/2017 1:01 AM, Alex Williamson wrote: > On Tue, 21 Mar 2017 16:43:05 +1100 > Gavin Shan wrote: > >> On Mon, Mar 20, 2017 at 10:57:08PM -0600, Alex Williamson wrote: >>> On Mon, 20 Mar 2017 18:34:23 -0500 >>> Bodong Wang wrote: >> .../... >> >>>>> Bodong, I'm not sure if there is a requirement to load driver for the >>>>> specified number of VFs? That indicates no driver will be loaded for >>>>> other VFs. If so, this interface might serve the purpose as well. >>>> Gavin, thanks for the review. That is indeed an interesting suggestion. >>>> Theoretically, we can change that probe_vfs from boolean to integer. >>>> And use it as a counter to probe the first N VFs(if N < total_vfs). >>>> Let's see if there are any objections. >>> Is it just me or does this seem like a confusing user interface, ie. to >>> get binary on/off behavior a user now needs to 'cat total_vfs > >>> sriov_probe_vfs'. It's not very intuitive, what's the use case for it? >>> >> After it's changed to integer, it accepts number. If users want to load >> driver for all VFs and don't want to check the maximal number of VFs, >> they can simply write 0xffffffff. So "on" and "off" are replaced with 0xffffffff >> and 0, but users has to press the keyboard more times though. >> >> drivers/net/ethernet/mellanox/mlx4/main.c::probe_vfs_argc allows to specify >> the number of VFs with which we're going to bind drivers. Less time is needed >> to enable SRIOV capability. As I had in some development environment: assume >> PF supports 256 VFs and I'm going to enable all of them, but I only want to >> load driver for two of them, then test the data path on those two VFs. Besides, >> I can image the VF needn't a driver in host if it's going to be passed to guest. >> Not sure how much sense it makes. > Yes, I understand what you're trying to do, but I still think it's > confusing for a user interface. This also doesn't answer what's the > practical, typical user case you see where it's useful to probe some > VFs but not others. The case listed is a development case where you > could just as easily disable all probing, then manually bind the first > two VFs to the host driver. Which is the better design, impose a > confusing interface on all users to simplify an obscure development > environment or simplify the user interface and assume developers know > how to bind devices otherwise? Thanks, > > Alex I agree with Alex on this concern. Sometimes, I need to probe 1 or 2 VFs to host side just for development purpose. Bind/unbind satisfy this case perfectly, and that's how current implementation is designed. But, from Gavin's use case, it will be a pain to bind/unbind hundreds of VFs. So, I want to understand how common this use case is. If it's not common, I prefer to keep current design because 1) the interface is much easier to understand and use 2) less error prone because no need to check current total_vfs and maintain a static counter to enable N vfs. Bodong