From: Leon Romanovsky <leon@kernel.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Jakub Kicinski <kuba@kernel.org>,
linux-pci@vger.kernel.org, linux-rdma@vger.kernel.org,
netdev@vger.kernel.org, Don Dutile <ddutile@redhat.com>,
Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH mlx5-next v1 2/5] PCI: Add SR-IOV sysfs entry to read number of MSI-X vectors
Date: Tue, 19 Jan 2021 07:38:07 +0200 [thread overview]
Message-ID: <20210119053807.GB21258@unreal> (raw)
In-Reply-To: <YAW/Wtr0thScxvK/@kroah.com>
On Mon, Jan 18, 2021 at 06:03:22PM +0100, Greg KH wrote:
> On Sun, Jan 10, 2021 at 05:07:24PM +0200, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@nvidia.com>
> >
> > Some SR-IOV capable devices provide an ability to configure specific
> > number of MSI-X vectors on their VF prior driver is probed on that VF.
> >
> > 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/.../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 <leonro@nvidia.com>
> > ---
> > Documentation/ABI/testing/sysfs-bus-pci | 14 +++++++++++
> > drivers/pci/iov.c | 31 +++++++++++++++++++++++++
> > drivers/pci/pci.h | 3 +++
> > include/linux/pci.h | 2 ++
> > 4 files changed, 50 insertions(+)
> >
> > diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
> > index 05e26e5da54e..64e9b700acc9 100644
> > --- a/Documentation/ABI/testing/sysfs-bus-pci
> > +++ b/Documentation/ABI/testing/sysfs-bus-pci
> > @@ -395,3 +395,17 @@ Description:
> > The file is writable if the PF is bound to a driver that
> > supports the ->sriov_set_msix_vec_count() callback and there
> > is no driver bound to the VF.
> > +
> > +What: /sys/bus/pci/devices/.../sriov_vf_total_msix
> > +Date: January 2021
> > +Contact: Leon Romanovsky <leonro@nvidia.com>
> > +Description:
> > + This file is associated with the SR-IOV PFs.
> > + It returns a total number of possible to configure MSI-X
> > + vectors on the enabled VFs.
> > +
> > + The values returned are:
> > + * > 0 - this will be total number possible to consume by VFs,
> > + * = 0 - feature is not supported
> > +
> > + If no SR-IOV VFs are enabled, this value will return 0.
> > diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> > index 42c0df4158d1..0a6ddf3230fd 100644
> > --- a/drivers/pci/iov.c
> > +++ b/drivers/pci/iov.c
> > @@ -394,12 +394,22 @@ static ssize_t sriov_drivers_autoprobe_store(struct device *dev,
> > return count;
> > }
> >
> > +static ssize_t sriov_vf_total_msix_show(struct device *dev,
> > + struct device_attribute *attr,
> > + char *buf)
> > +{
> > + struct pci_dev *pdev = to_pci_dev(dev);
> > +
> > + return sprintf(buf, "%d\n", pdev->sriov->vf_total_msix);
>
> Nit, please use sysfs_emit() for new sysfs files.
I'll do, thanks.
>
> thanks,
>
> greg k-h
next prev parent reply other threads:[~2021-01-19 6:21 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-10 15:07 [PATCH mlx5-next v1 0/5] Dynamically assign MSI-X vectors count Leon Romanovsky
2021-01-10 15:07 ` [PATCH mlx5-next v1 1/5] PCI: Add sysfs callback to allow MSI-X table size change of SR-IOV VFs Leon Romanovsky
2021-01-11 19:30 ` Alexander Duyck
2021-01-12 3:25 ` Don Dutile
2021-01-12 6:15 ` Leon Romanovsky
2021-01-12 6:39 ` Leon Romanovsky
2021-01-12 21:59 ` Alexander Duyck
2021-01-13 6:09 ` Leon Romanovsky
2021-01-13 20:00 ` Alexander Duyck
2021-01-14 7:16 ` Leon Romanovsky
2021-01-14 16:51 ` Alexander Duyck
2021-01-14 17:12 ` Leon Romanovsky
2021-01-13 17:50 ` Alex Williamson
2021-01-13 19:49 ` Leon Romanovsky
2021-01-10 15:07 ` [PATCH mlx5-next v1 2/5] PCI: Add SR-IOV sysfs entry to read number of MSI-X vectors Leon Romanovsky
2021-01-11 19:30 ` Alexander Duyck
2021-01-12 6:56 ` Leon Romanovsky
2021-01-12 21:34 ` Alexander Duyck
2021-01-13 6:19 ` Leon Romanovsky
2021-01-13 22:44 ` Alexander Duyck
2021-01-14 6:50 ` Leon Romanovsky
2021-01-14 16:40 ` Alexander Duyck
2021-01-14 16:48 ` Jason Gunthorpe
2021-01-14 17:55 ` Alexander Duyck
2021-01-14 18:29 ` Jason Gunthorpe
2021-01-14 19:24 ` Alexander Duyck
2021-01-14 19:56 ` Leon Romanovsky
2021-01-14 20:08 ` Jason Gunthorpe
2021-01-14 21:43 ` Alexander Duyck
2021-01-14 23:28 ` Alex Williamson
2021-01-15 1:56 ` Alexander Duyck
2021-01-15 14:06 ` Jason Gunthorpe
2021-01-15 15:53 ` Leon Romanovsky
2021-01-16 1:48 ` Alexander Duyck
2021-01-16 8:20 ` Leon Romanovsky
2021-01-18 3:16 ` Alexander Duyck
2021-01-18 7:20 ` Leon Romanovsky
2021-01-18 13:28 ` Leon Romanovsky
2021-01-18 18:21 ` Alexander Duyck
2021-01-19 5:43 ` Leon Romanovsky
2021-01-16 4:32 ` Alexander Duyck
2021-01-18 15:47 ` Jason Gunthorpe
2021-01-15 13:51 ` Jason Gunthorpe
2021-01-14 17:26 ` Leon Romanovsky
2021-01-18 17:03 ` Greg KH
2021-01-19 5:38 ` Leon Romanovsky [this message]
2021-01-10 15:07 ` [PATCH mlx5-next v1 3/5] net/mlx5: Add dynamic MSI-X capabilities bits Leon Romanovsky
2021-01-10 15:07 ` [PATCH mlx5-next v1 4/5] net/mlx5: Dynamically assign MSI-X vectors count Leon Romanovsky
2021-01-10 15:07 ` [PATCH mlx5-next v1 5/5] net/mlx5: Allow to the users to configure number of MSI-X vectors Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210119053807.GB21258@unreal \
--to=leon@kernel.org \
--cc=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=ddutile@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=jgg@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).