From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756263AbdCUFoL (ORCPT ); Tue, 21 Mar 2017 01:44:11 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41293 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751675AbdCUFoK (ORCPT ); Tue, 21 Mar 2017 01:44:10 -0400 Date: Tue, 21 Mar 2017 16:43:05 +1100 From: Gavin Shan To: Alex Williamson Cc: Bodong Wang , Gavin Shan , bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, saeedm@mellanox.com, Eli Cohen Subject: Re: [PATCH] pci/sriov: Add an option to probe VFs or not before enabling SR-IOV Reply-To: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170320225708.6868676a@t450s.home> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-MML: disable x-cbid: 17032105-0004-0000-0000-000001EFC9F6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032105-0005-0000-0000-000009E1A190 Message-Id: <20170321054305.GA12230@gwshan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-21_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703210052 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Gavin