From: Jason Gunthorpe <jgg@nvidia.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: Max Gurtovoy <mgurtovoy@nvidia.com>, <alex.williamson@redhat.com>,
<kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<liranl@nvidia.com>, <oren@nvidia.com>, <tzahio@nvidia.com>,
<leonro@nvidia.com>, <yarong@nvidia.com>, <aviadye@nvidia.com>,
<shahafs@nvidia.com>, <artemp@nvidia.com>, <kwankhede@nvidia.com>,
<ACurrid@nvidia.com>, <gmataev@nvidia.com>, <cjia@nvidia.com>
Subject: Re: [PATCH RFC v1 0/3] Introduce vfio-pci-core subsystem
Date: Mon, 18 Jan 2021 11:10:20 -0400 [thread overview]
Message-ID: <20210118151020.GJ4147@nvidia.com> (raw)
In-Reply-To: <20210118143806.036c8dbc.cohuck@redhat.com>
On Mon, Jan 18, 2021 at 02:38:06PM +0100, Cornelia Huck wrote:
> > These devices will be seen on the Auxiliary bus as:
> > mlx5_core.vfio_pci.2048 -> ../../../devices/pci0000:00/0000:00:02.0/0000:05:00.0/0000:06:00.0/0000:07:00.0/mlx5_core.vfio_pci.2048
> > mlx5_core.vfio_pci.2304 -> ../../../devices/pci0000:00/0000:00:02.0/0000:05:00.0/0000:06:00.0/0000:07:00.1/mlx5_core.vfio_pci.2304
> >
> > 2048 represents BDF 08:00.0 and 2304 represents BDF 09:00.0 in decimal
> > view. In this manner, the administrator will be able to locate the
> > correct vfio-pci module it should bind the desired BDF to (by finding
> > the pointer to the module according to the Auxiliary driver of that
> > BDF).
>
> I'm not familiar with that auxiliary framework (it seems to be fairly
> new?);
Auxillary bus is for connecting two parts of the same driver that
reside in different modules/subystems. Here it is connecting the vfio
part to the core part of mlx5 (running on the PF).
> but can you maybe create an auxiliary device unconditionally and
> contain all hardware-specific things inside a driver for it? Or is
> that not flexible enough?
The goal is to make a vfio device, auxiliary bus is only in the
picture because a VF device under vfio needs to interact with the PF
mlx5_core driver, auxiliary bus provides that connection.
You can say that all the HW specific things are in the mlx5_vfio_pci
driver. It is an unusual driver because it must bind to both the PCI
VF with a pci_driver and to the mlx5_core PF using an
auxiliary_driver. This is needed for the object lifetimes to be
correct.
The PF is providing services to control a full VF which mlx5_vfio_pci
converts into VFIO API.
> > drivers/vfio/pci/Kconfig | 22 +-
> > drivers/vfio/pci/Makefile | 16 +-
> > drivers/vfio/pci/mlx5_vfio_pci.c | 253 +++
> > drivers/vfio/pci/vfio_pci.c | 2386 +--------------------------
> > drivers/vfio/pci/vfio_pci_core.c | 2311 ++++++++++++++++++++++++++
>
> Especially regarding this diffstat...
It is a bit misleading because it doesn't show the rename
Jason
next prev parent reply other threads:[~2021-01-18 16:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-17 18:15 [PATCH RFC v1 0/3] Introduce vfio-pci-core subsystem Max Gurtovoy
2021-01-17 18:15 ` [PATCH 1/3] vfio-pci: rename vfio_pci.c to vfio_pci_core.c Max Gurtovoy
2021-01-17 18:15 ` [PATCH 2/3] vfio-pci: introduce vfio_pci_core subsystem driver Max Gurtovoy
2021-01-17 18:15 ` [PATCH 3/3] mlx5-vfio-pci: add new vfio_pci driver for mlx5 devices Max Gurtovoy
2021-01-18 13:38 ` [PATCH RFC v1 0/3] Introduce vfio-pci-core subsystem Cornelia Huck
2021-01-18 15:10 ` Jason Gunthorpe [this message]
2021-01-18 16:00 ` Cornelia Huck
2021-01-18 18:16 ` Jason Gunthorpe
2021-01-19 18:56 ` Cornelia Huck
2021-01-19 19:42 ` Jason Gunthorpe
2021-01-22 19:25 ` Alex Williamson
2021-01-22 20:04 ` Jason Gunthorpe
2021-01-25 16:20 ` Cornelia Huck
2021-01-25 18:04 ` Jason Gunthorpe
2021-01-25 23:31 ` Alex Williamson
2021-01-26 0:45 ` Jason Gunthorpe
2021-01-26 3:34 ` Alex Williamson
2021-01-26 13:27 ` Max Gurtovoy
2021-01-28 16:29 ` Cornelia Huck
2021-01-28 21:02 ` Alex Williamson
2021-01-31 18:46 ` Max Gurtovoy
2021-02-01 4:32 ` Alex Williamson
2021-02-01 9:40 ` Max Gurtovoy
2021-02-01 17:29 ` Alex Williamson
2021-02-01 17:17 ` Jason Gunthorpe
2021-01-31 18:09 ` Max Gurtovoy
2021-01-26 17:23 ` Jason Gunthorpe
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=20210118151020.GJ4147@nvidia.com \
--to=jgg@nvidia.com \
--cc=ACurrid@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=artemp@nvidia.com \
--cc=aviadye@nvidia.com \
--cc=cjia@nvidia.com \
--cc=cohuck@redhat.com \
--cc=gmataev@nvidia.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liranl@nvidia.com \
--cc=mgurtovoy@nvidia.com \
--cc=oren@nvidia.com \
--cc=shahafs@nvidia.com \
--cc=tzahio@nvidia.com \
--cc=yarong@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).