Skip to content

Commit fc9da66

Browse files
brettcreeleyawilliam
authored andcommitted
vfio/pds: Add Kconfig and documentation
Add Kconfig entries and pds-vfio-pci.rst. Also, add an entry in the MAINTAINERS file for this new driver. It's not clear where documentation for vendor specific VFIO drivers should live, so just re-use the current amd ethernet location. Signed-off-by: Brett Creeley <[email protected]> Signed-off-by: Shannon Nelson <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Shameer Kolothum <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
1 parent 7dabb1b commit fc9da66

File tree

5 files changed

+108
-0
lines changed

5 files changed

+108
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
.. SPDX-License-Identifier: GPL-2.0+
2+
.. note: can be edited and viewed with /usr/bin/formiko-vim
3+
4+
==========================================================
5+
PCI VFIO driver for the AMD/Pensando(R) DSC adapter family
6+
==========================================================
7+
8+
AMD/Pensando Linux VFIO PCI Device Driver
9+
Copyright(c) 2023 Advanced Micro Devices, Inc.
10+
11+
Overview
12+
========
13+
14+
The ``pds-vfio-pci`` module is a PCI driver that supports Live Migration
15+
capable Virtual Function (VF) devices in the DSC hardware.
16+
17+
Using the device
18+
================
19+
20+
The pds-vfio-pci device is enabled via multiple configuration steps and
21+
depends on the ``pds_core`` driver to create and enable SR-IOV Virtual
22+
Function devices.
23+
24+
Shown below are the steps to bind the driver to a VF and also to the
25+
associated auxiliary device created by the ``pds_core`` driver. This
26+
example assumes the pds_core and pds-vfio-pci modules are already
27+
loaded.
28+
29+
.. code-block:: bash
30+
:name: example-setup-script
31+
32+
#!/bin/bash
33+
34+
PF_BUS="0000:60"
35+
PF_BDF="0000:60:00.0"
36+
VF_BDF="0000:60:00.1"
37+
38+
# Prevent non-vfio VF driver from probing the VF device
39+
echo 0 > /sys/class/pci_bus/$PF_BUS/device/$PF_BDF/sriov_drivers_autoprobe
40+
41+
# Create single VF for Live Migration via pds_core
42+
echo 1 > /sys/bus/pci/drivers/pds_core/$PF_BDF/sriov_numvfs
43+
44+
# Allow the VF to be bound to the pds-vfio-pci driver
45+
echo "pds-vfio-pci" > /sys/class/pci_bus/$PF_BUS/device/$VF_BDF/driver_override
46+
47+
# Bind the VF to the pds-vfio-pci driver
48+
echo "$VF_BDF" > /sys/bus/pci/drivers/pds-vfio-pci/bind
49+
50+
After performing the steps above, a file in /dev/vfio/<iommu_group>
51+
should have been created.
52+
53+
54+
Enabling the driver
55+
===================
56+
57+
The driver is enabled via the standard kernel configuration system,
58+
using the make command::
59+
60+
make oldconfig/menuconfig/etc.
61+
62+
The driver is located in the menu structure at:
63+
64+
-> Device Drivers
65+
-> VFIO Non-Privileged userspace driver framework
66+
-> VFIO support for PDS PCI devices
67+
68+
Support
69+
=======
70+
71+
For general Linux networking support, please use the netdev mailing
72+
list, which is monitored by Pensando personnel::
73+
74+
75+
76+
For more specific support needs, please use the Pensando driver support
77+
email::
78+
79+

Documentation/networking/device_drivers/ethernet/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Contents:
1616
altera/altera_tse
1717
amd/pds_core
1818
amd/pds_vdpa
19+
amd/pds_vfio_pci
1920
aquantia/atlantic
2021
chelsio/cxgb
2122
cirrus/cs89x0

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22348,6 +22348,13 @@ S: Maintained
2234822348
P: Documentation/driver-api/vfio-pci-device-specific-driver-acceptance.rst
2234922349
F: drivers/vfio/pci/*/
2235022350

22351+
VFIO PDS PCI DRIVER
22352+
M: Brett Creeley <[email protected]>
22353+
22354+
S: Maintained
22355+
F: Documentation/networking/device_drivers/ethernet/amd/pds_vfio_pci.rst
22356+
F: drivers/vfio/pci/pds/
22357+
2235122358
VFIO PLATFORM DRIVER
2235222359
M: Eric Auger <[email protected]>
2235322360

drivers/vfio/pci/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,6 @@ source "drivers/vfio/pci/mlx5/Kconfig"
6363

6464
source "drivers/vfio/pci/hisilicon/Kconfig"
6565

66+
source "drivers/vfio/pci/pds/Kconfig"
67+
6668
endmenu

drivers/vfio/pci/pds/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
# Copyright (c) 2023 Advanced Micro Devices, Inc.
3+
4+
config PDS_VFIO_PCI
5+
tristate "VFIO support for PDS PCI devices"
6+
depends on PDS_CORE
7+
select VFIO_PCI_CORE
8+
help
9+
This provides generic PCI support for PDS devices using the VFIO
10+
framework.
11+
12+
More specific information on this driver can be
13+
found in
14+
<file:Documentation/networking/device_drivers/ethernet/amd/pds_vfio_pci.rst>.
15+
16+
To compile this driver as a module, choose M here. The module
17+
will be called pds-vfio-pci.
18+
19+
If you don't know what to do here, say N.

0 commit comments

Comments
 (0)