Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4510355rwb; Sun, 13 Nov 2022 07:25:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf7QAPj+eZFtoY8Nvw672f3BGpIizw7zosbL5wU4nZeXj3V+v9V54L1Bzz+TYnMiBZ6SpP64 X-Received: by 2002:a17:90b:3d06:b0:213:dce7:e12b with SMTP id pt6-20020a17090b3d0600b00213dce7e12bmr10428882pjb.164.1668353156516; Sun, 13 Nov 2022 07:25:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668353156; cv=none; d=google.com; s=arc-20160816; b=NSWlcxtJRbLP0BMyO/iiOK7wPlDhQ+nFS7PMuVpoLQ4QiDvVKibl1PSFAJfriNrILt A1QUolaHR8FOmu9cgrVXgnYtkk1Y3P75DCu3SiqSjdtls0MKm76/GAOwBSDiaXnz2W8B ZuMVYCseVhwiJYLgozkS3q4St+5rp8bLAI9vI0F+pnVCl0ZjWqDCWk2mBG5B7aB2bM53 YnJQUX+i6PyZkmWs1NDf1WfiFoIhjjzcXxO00Q7E+qpDSvkznNegizP11zFcIXYwxfL5 f/w5iNg+ilbQpRsVy3NtzkemPOrr98LhBW2LtUeaeN1oNmIBDLxaMXi/ATs09PLf/k3H OnRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=nzoFy5f/Vj95gMhz9lSrGhNEltK0DMRY/ZCpuvAkMw0=; b=TcwbX/IplZ70nLP1GJdLTuqXuDGuZEEt5YRfGK+kwS0cS34dZB6/2+SAOZ+P3fgygw ZBVTA0YW2/CBzuk5E0ZgAQewLU16tA0ytoop0uYAURNdDarsiLuaB22agrVOgiMk/2AU bad4hALYYdv/+TuRaZ8bNDrgQM08d6h+bRKa0K+sroEgtcRtdF1ZmAIlUipxkKxWxGfl o4qUNm6km4r5hdpKaxBuJbBgRVkQM8okoueeHWO0PZWGkAS6fKbc0A9t3BZAPE07w2MG plT5VmTGCKSc2K5IwScy1O7roHgtMrenxOV9mHy5Gmb4kNN21/vbOeNIoygYblxh1McW ts3g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a056a001ad000b00565cb1ebdb2si7181621pfv.267.2022.11.13.07.25.44; Sun, 13 Nov 2022 07:25:56 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233971AbiKMNto (ORCPT + 89 others); Sun, 13 Nov 2022 08:49:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235231AbiKMNtj (ORCPT ); Sun, 13 Nov 2022 08:49:39 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4CF411160; Sun, 13 Nov 2022 05:49:37 -0800 (PST) Received: from kwepemi100025.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N9DM36QxbzRpCv; Sun, 13 Nov 2022 21:49:19 +0800 (CST) Received: from [10.174.148.223] (10.174.148.223) by kwepemi100025.china.huawei.com (7.221.188.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 13 Nov 2022 21:49:33 +0800 Message-ID: <49006cf2-1f54-d53d-4f8a-0c1dfae9aa28@huawei.com> Date: Sun, 13 Nov 2022 21:49:32 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC 0/4] pci/sriov: support VFs dynamic addition To: Bjorn Helgaas CC: , , , , , , , , References: <20221111230703.GA759162@bhelgaas> From: "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" In-Reply-To: <20221111230703.GA759162@bhelgaas> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.148.223] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi100025.china.huawei.com (7.221.188.158) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 在 2022/11/12 7:07, Bjorn Helgaas 写道: > 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. >> >> 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 > > When you respond to Leon's questions, please also spend a little time > to look at the iov.c history and coding style and follow it, so we > don't have to waste time commenting on or fixing trivial things. > Okay, thanks for your valuable suggestions. > For example, there are no previous subject lines for that file that > start with "pci/sriov". Don't make up a new prefix; use what's been > done in the past. And follow the style of capitalizing the first word > after the prefix. > > There are a few comments that look like they are more than 80 columns. > Again unlike everything else in the file. > > The PCIe spec spells it "SR-IOV", not "sriov". Do the same in your > commit logs and comments. > > Capitalize "VF" consistently. I see "VF" and "vf" used randomly. > > Sysfs changes require documention updates, e.g., in > Documentation/ABI/testing/sysfs-bus-pci. > .