Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2450326rwb; Fri, 11 Nov 2022 09:26:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf6t9BJPRsvLKqb37Jjsvq8m451P8n0flu3Fgyz5H9IIgczYqkAg/NgFKnsfExztzXy0aOiG X-Received: by 2002:a17:906:b103:b0:7ad:c3b6:fe89 with SMTP id u3-20020a170906b10300b007adc3b6fe89mr2481694ejy.697.1668187562301; Fri, 11 Nov 2022 09:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668187562; cv=none; d=google.com; s=arc-20160816; b=vzT8D9bZ9JD/Cqzg888iViKyGbI4y+SNtDWm/FIWYcXh+P3bi9tNasBWna1Z6ryDSb gmlqlAkcPenBhYSBfHq3/GjoKQkXv/PUlfS4U1qFhvJs4UbRdn/Nwz4tsh4IWO8VTfKA 3DSpQii2X7JKO0p8lZTEFhfjnRGdl6Cxp5+sRw1Euf0Z75sEmL69+xW7ZEgh29bSVBr4 yWUGPQ72JDdKL+Rb1k9a16eWf04kuakx66N9PFSQU/Yz4ynzf0M4WwsJic5auQ9RlvYj ZXeOilic/814p/JBtvG2/6vdD0Scfj3c9qClo/jSnhktB7CB7+aYPfbc3VhKmGCt5Ab6 0rnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cxk3XWTNkS58BkYtCbFUD+1fMalKWYKZdCc95irMKXg=; b=Y7hPiJeIbFNg6iEZsB8FrKTCBFOTUMVCeYGLaXguyqm3KEXgpo7/r/x1/KbvyCdje7 a4yaedV0tnbb8ECeHDsEoRVvvf/nRKfNFIijbgxUAt1PUZAnNvMEtFUnAGz74iBKLCmG 8yV0DiIphjbeqVSpIm7n2cG6GQ4wQWsgUnuh9gh7rAipu+GMii/h4KoR+dJkcLqY2t3u s1Dm41LJPrz5o/0h11w/yqB6upZVEpZr1y9k+XKPnIi2vHQ9F28aLenzKhqX6MYFGbBN rFxcjFr2la1SaI5VM2SbgojMrLWUV5usygrLNmE9klluJHDrmCP5YkbEewV3Mo6YKJeV F31w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b3fbS/O7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o22-20020a170906975600b007ae8b1704b9si2662840ejy.406.2022.11.11.09.25.40; Fri, 11 Nov 2022 09:26:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b3fbS/O7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234129AbiKKQj2 (ORCPT + 91 others); Fri, 11 Nov 2022 11:39:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233654AbiKKQj0 (ORCPT ); Fri, 11 Nov 2022 11:39:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87E901EAC4; Fri, 11 Nov 2022 08:39:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2E8506205E; Fri, 11 Nov 2022 16:39:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06AC4C433C1; Fri, 11 Nov 2022 16:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668184764; bh=51DZ/DhXy+o8eovZwCh/p1flVLy2+G6I4SyHU4iowK4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b3fbS/O7BKscJ+M8MJ74btT9HHELO6n6NqYBnKLa9lSJ7SDJHvQMb7X7U9xRw6HY+ OcD4Ns1Qxnedwal8xtlq0ri4t/1As6EizXlUI3045XOMdxaQ/PZevZ3gGzQGwSNJyz L4+n+asPryV4DpPC1znEAHqwa+2rL8mTVxyr4lTMKSXbfNkqUwdyknbNZzF86deUPA Ekvb3/sxJxbwmc99xPmCRFKYC1aubdoZYhrdz9t7DNma3PD/X+gbYEiNPAWICMC8YJ XhcitZFFrUjo5WvHjHT+DMBo9SecxD5zikrYLSEmMpxJEluccdskaQAjIJwQulLSNc S4jWJAHv37/ag== Date: Fri, 11 Nov 2022 18:39:19 +0200 From: Leon Romanovsky To: "Longpeng(Mike)" Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, jianjay.zhou@huawei.com, zhuangshengen@huawei.com, arei.gonglei@huawei.com, yechuan@huawei.com, huangzhichao@huawei.com, xiehong@huawei.com Subject: Re: [RFC 0/4] pci/sriov: support VFs dynamic addition Message-ID: References: <20221111142722.1172-1-longpeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221111142722.1172-1-longpeng2@huawei.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 11, 2022 at 10:27:18PM +0800, Longpeng(Mike) wrote: > From: Longpeng > > We can enable SRIOV and add VFs by /sys/bus/pci/devices/..../sriov_numvfs, but > this operation needs to spend lots of time if there has a large amount of VFs. > > For example, if the machine has 10 PFs and 250 VFs per-PF, enable all the VFs > concurrently would cost about 200-250ms. However most of them are not need to be > used at the moment, so we can enable SRIOV first but add VFs on demand. It is unclear what took 200-250ms, is it physical VF creation or bind of the driver to these VFs? If the latter, you can try with sriov_drivers_autoprobe set to true. This is how ennoblement of large SR-IOV systems is done. Also PCI spec declares "VF enable" bit, which is applicable to all VFs associated to that PF, see section "9.3.3.3.1 VF Enable". Thanks > > This series introduces two interfaces: > 1. sriov_numvfs_no_scan: enable SRIOV without add the VFs. > 2. sriov_scan_vf_id: add a specific VF. > > Longpeng (4): > pci/sriov: extract sriov_numvfs common helper > pci/sriov: add vf_bitmap to mark the vf id allocation > pci/sriov: add sriov_numfs_no_scan interface > pci/sriov: add sriov_scan_vf_id interface > > drivers/pci/iov.c | 162 +++++++++++++++++++++++++++++++++++++++++----- > drivers/pci/pci.h | 1 + > 2 files changed, 148 insertions(+), 15 deletions(-) > > -- > 2.23.0 >