From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 978D3C433E6 for ; Tue, 2 Feb 2021 07:04:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6BFE864EDF for ; Tue, 2 Feb 2021 07:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232430AbhBBHEg (ORCPT ); Tue, 2 Feb 2021 02:04:36 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:13554 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232180AbhBBHEN (ORCPT ); Tue, 2 Feb 2021 02:04:13 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 01 Feb 2021 23:03:33 -0800 Received: from localhost (172.20.145.6) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 2 Feb 2021 07:02:57 +0000 Date: Tue, 2 Feb 2021 09:02:46 +0200 From: Leon Romanovsky To: Bjorn Helgaas , Saeed Mahameed CC: Jason Gunthorpe , Alexander Duyck , Jakub Kicinski , , , , Don Dutile , Alex Williamson , "David S . Miller" Subject: Re: [PATCH mlx5-next v5 1/4] PCI: Add sysfs callback to allow MSI-X table size change of SR-IOV VFs Message-ID: <20210202070246.GC1945456@unreal> References: <20210126085730.1165673-1-leon@kernel.org> <20210126085730.1165673-2-leon@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20210126085730.1165673-2-leon@kernel.org> X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL105.nvidia.com (172.20.187.12) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1612249413; bh=pcdL63axnrv3GD7icYQTjaMNlVO17X6R4uuh8YZy1R4=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:X-Originating-IP: X-ClientProxiedBy; b=VZh07m+jtRQUiB7GKf3LZFAAEXyOnaDe34qthj5P6wMHl7zu4uFd1A8u3Fqe8SDB6 F7h5eqF0EWF1iqJ+YtFWHckG6BxtF4FStkVEVC986BErYV2sGjysQ7724DOsrjSmj8 ZFrowCpNH4gVZ42hFZUp6BNLKHLio50ds5RDaqNBKbTRw1MFlgpWzCp4tigOo44B4/ xFPl8QSSiSu4JTXsvN2me3tbRHbi/Txj7gPq7q+3CheSW1DTsE3ccFNzNizjexNDPM 86CnGNzr6O1ZZpuAe4/Txi+BxsomWbSzsdSG7O5or42uvobu4OtQdzC8J38Ii3hxd0 jkQwQ24vHf/AA== Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Jan 26, 2021 at 10:57:27AM +0200, Leon Romanovsky wrote: > From: Leon Romanovsky > > Extend PCI sysfs interface with a new callback that allows configure > the number of MSI-X vectors for specific SR-IO VF. This is needed > to optimize the performance of newly bound devices by allocating > the number of vectors based on the administrator knowledge of targeted VM. > > This function is applicable for SR-IOV VF because such devices allocate > their MSI-X table before they will run on the VMs and HW can't guess the > right number of vectors, so the HW allocates them statically and equally. > > 1) The newly added /sys/bus/pci/devices/.../vfs_overlay/sriov_vf_msix_count > file will be seen for the VFs and it is writable as long as a driver is not > bounded to the VF. > > The values accepted are: > * > 0 - this will be number reported by the VF's MSI-X capability > * < 0 - not valid > * = 0 - will reset to the device default value > > 2) In order to make management easy, provide new read-only sysfs file that > returns a total number of possible to configure MSI-X vectors. > > cat /sys/bus/pci/devices/.../vfs_overlay/sriov_vf_total_msix > = 0 - feature is not supported > > 0 - total number of MSI-X vectors to consume by the VFs > > Signed-off-by: Leon Romanovsky > --- > Documentation/ABI/testing/sysfs-bus-pci | 32 +++++ > drivers/pci/iov.c | 180 ++++++++++++++++++++++++ > drivers/pci/msi.c | 47 +++++++ > drivers/pci/pci.h | 4 + > include/linux/pci.h | 10 ++ > 5 files changed, 273 insertions(+) Bjorn, Can I please get your Acked-by on this so it will go through mlx5-next -> netdev submission flow? Thanks