diff mbox series

[v11,vfio,7/7] vfio/pds: Add Kconfig and documentation

Message ID 20230713003727.11226-8-brett.creeley@amd.com (mailing list archive)
State New, archived
Headers show
Series pds-vfio-pci driver | expand

Commit Message

Brett Creeley July 13, 2023, 12:37 a.m. UTC
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 <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
---
 .../ethernet/amd/pds-vfio-pci.rst             | 79 +++++++++++++++++++
 .../device_drivers/ethernet/index.rst         |  1 +
 MAINTAINERS                                   |  7 ++
 drivers/vfio/pci/Kconfig                      |  2 +
 drivers/vfio/pci/pds/Kconfig                  | 19 +++++
 5 files changed, 108 insertions(+)
 create mode 100644 Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
 create mode 100644 drivers/vfio/pci/pds/Kconfig

Comments

Simon Horman July 15, 2023, 9:05 a.m. UTC | #1
On Wed, Jul 12, 2023 at 05:37:27PM -0700, Brett Creeley wrote:
> 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 <brett.creeley@amd.com>
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
> Reviewed-by: Simon Horman <simon.horman@corigine.com>
> ---
>  .../ethernet/amd/pds-vfio-pci.rst             | 79 +++++++++++++++++++
>  .../device_drivers/ethernet/index.rst         |  1 +
>  MAINTAINERS                                   |  7 ++
>  drivers/vfio/pci/Kconfig                      |  2 +
>  drivers/vfio/pci/pds/Kconfig                  | 19 +++++
>  5 files changed, 108 insertions(+)
>  create mode 100644 Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
>  create mode 100644 drivers/vfio/pci/pds/Kconfig
> 
> diff --git a/Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst b/Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
> new file mode 100644
> index 000000000000..7a6bc848a2b2
> --- /dev/null
> +++ b/Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
> @@ -0,0 +1,79 @@

...

> diff --git a/Documentation/networking/device_drivers/ethernet/index.rst b/Documentation/networking/device_drivers/ethernet/index.rst
> index 94ecb67c0885..804e1f7c461c 100644
> --- a/Documentation/networking/device_drivers/ethernet/index.rst
> +++ b/Documentation/networking/device_drivers/ethernet/index.rst
> @@ -16,6 +16,7 @@ Contents:
>     altera/altera_tse
>     amd/pds_core
>     amd/pds_vdpa
> +   amd/pds_vfio
>     aquantia/atlantic
>     chelsio/cxgb
>     cirrus/cs89x0

Sorry for not noticing this, but there seems to be a missmatch
between 'amd/pds_vfio' above, and the name of the file in
question. Perhaps the file should be renamed pds_vfio.rst?

'make htmldocs' reports:

 .../index.rst:10: WARNING: toctree contains reference to nonexisting document 'device_drivers/ethernet/amd/pds_vfio'
 .../amd/pds-vfio-pci.rst: WARNING: document isn't included in any toctree
Brett Creeley July 17, 2023, 4:55 p.m. UTC | #2
On 7/15/2023 2:05 AM, Simon Horman wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> On Wed, Jul 12, 2023 at 05:37:27PM -0700, Brett Creeley wrote:
>> 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 <brett.creeley@amd.com>
>> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
>> Reviewed-by: Simon Horman <simon.horman@corigine.com>
>> ---
>>   .../ethernet/amd/pds-vfio-pci.rst             | 79 +++++++++++++++++++
>>   .../device_drivers/ethernet/index.rst         |  1 +
>>   MAINTAINERS                                   |  7 ++
>>   drivers/vfio/pci/Kconfig                      |  2 +
>>   drivers/vfio/pci/pds/Kconfig                  | 19 +++++
>>   5 files changed, 108 insertions(+)
>>   create mode 100644 Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
>>   create mode 100644 drivers/vfio/pci/pds/Kconfig
>>
>> diff --git a/Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst b/Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
>> new file mode 100644
>> index 000000000000..7a6bc848a2b2
>> --- /dev/null
>> +++ b/Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
>> @@ -0,0 +1,79 @@
> 
> ...
> 
>> diff --git a/Documentation/networking/device_drivers/ethernet/index.rst b/Documentation/networking/device_drivers/ethernet/index.rst
>> index 94ecb67c0885..804e1f7c461c 100644
>> --- a/Documentation/networking/device_drivers/ethernet/index.rst
>> +++ b/Documentation/networking/device_drivers/ethernet/index.rst
>> @@ -16,6 +16,7 @@ Contents:
>>      altera/altera_tse
>>      amd/pds_core
>>      amd/pds_vdpa
>> +   amd/pds_vfio
>>      aquantia/atlantic
>>      chelsio/cxgb
>>      cirrus/cs89x0
> 
> Sorry for not noticing this, but there seems to be a missmatch
> between 'amd/pds_vfio' above, and the name of the file in
> question. Perhaps the file should be renamed pds_vfio.rst?

I will take a look at this. I renamed comments/files based on renaming 
the driver to pds-vfio-pci, but missed this.

Thanks for taking another look. I will get this fixed on v12.

Brett

> 
> 'make htmldocs' reports:
> 
>   .../index.rst:10: WARNING: toctree contains reference to nonexisting document 'device_drivers/ethernet/amd/pds_vfio'
>   .../amd/pds-vfio-pci.rst: WARNING: document isn't included in any toctree
> 
> 
>
diff mbox series

Patch

diff --git a/Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst b/Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
new file mode 100644
index 000000000000..7a6bc848a2b2
--- /dev/null
+++ b/Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
@@ -0,0 +1,79 @@ 
+.. SPDX-License-Identifier: GPL-2.0+
+.. note: can be edited and viewed with /usr/bin/formiko-vim
+
+==========================================================
+PCI VFIO driver for the AMD/Pensando(R) DSC adapter family
+==========================================================
+
+AMD/Pensando Linux VFIO PCI Device Driver
+Copyright(c) 2023 Advanced Micro Devices, Inc.
+
+Overview
+========
+
+The ``pds-vfio-pci`` module is a PCI driver that supports Live Migration
+capable Virtual Function (VF) devices in the DSC hardware.
+
+Using the device
+================
+
+The pds-vfio-pci device is enabled via multiple configuration steps and
+depends on the ``pds_core`` driver to create and enable SR-IOV Virtual
+Function devices.
+
+Shown below are the steps to bind the driver to a VF and also to the
+associated auxiliary device created by the ``pds_core`` driver. This
+example assumes the pds_core and pds-vfio-pci modules are already
+loaded.
+
+.. code-block:: bash
+  :name: example-setup-script
+
+  #!/bin/bash
+
+  PF_BUS="0000:60"
+  PF_BDF="0000:60:00.0"
+  VF_BDF="0000:60:00.1"
+
+  # Prevent non-vfio VF driver from probing the VF device
+  echo 0 > /sys/class/pci_bus/$PF_BUS/device/$PF_BDF/sriov_drivers_autoprobe
+
+  # Create single VF for Live Migration via pds_core
+  echo 1 > /sys/bus/pci/drivers/pds_core/$PF_BDF/sriov_numvfs
+
+  # Allow the VF to be bound to the pds-vfio-pci driver
+  echo "pds-vfio-pci" > /sys/class/pci_bus/$PF_BUS/device/$VF_BDF/driver_override
+
+  # Bind the VF to the pds-vfio-pci driver
+  echo "$VF_BDF" > /sys/bus/pci/drivers/pds-vfio-pci/bind
+
+After performing the steps above, a file in /dev/vfio/<iommu_group>
+should have been created.
+
+
+Enabling the driver
+===================
+
+The driver is enabled via the standard kernel configuration system,
+using the make command::
+
+  make oldconfig/menuconfig/etc.
+
+The driver is located in the menu structure at:
+
+  -> Device Drivers
+    -> VFIO Non-Privileged userspace driver framework
+      -> VFIO support for PDS PCI devices
+
+Support
+=======
+
+For general Linux networking support, please use the netdev mailing
+list, which is monitored by Pensando personnel::
+
+  netdev@vger.kernel.org
+
+For more specific support needs, please use the Pensando driver support
+email::
+
+  drivers@pensando.io
diff --git a/Documentation/networking/device_drivers/ethernet/index.rst b/Documentation/networking/device_drivers/ethernet/index.rst
index 94ecb67c0885..804e1f7c461c 100644
--- a/Documentation/networking/device_drivers/ethernet/index.rst
+++ b/Documentation/networking/device_drivers/ethernet/index.rst
@@ -16,6 +16,7 @@  Contents:
    altera/altera_tse
    amd/pds_core
    amd/pds_vdpa
+   amd/pds_vfio
    aquantia/atlantic
    chelsio/cxgb
    cirrus/cs89x0
diff --git a/MAINTAINERS b/MAINTAINERS
index 486fb3a84696..74f309b5de62 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -22353,6 +22353,13 @@  S:	Maintained
 P:	Documentation/driver-api/vfio-pci-device-specific-driver-acceptance.rst
 F:	drivers/vfio/pci/*/
 
+VFIO PDS PCI DRIVER
+M:	Brett Creeley <brett.creeley@amd.com>
+L:	kvm@vger.kernel.org
+S:	Maintained
+F:	Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst
+F:	drivers/vfio/pci/pds/
+
 VFIO PLATFORM DRIVER
 M:	Eric Auger <eric.auger@redhat.com>
 L:	kvm@vger.kernel.org
diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig
index 86bb7835cf3c..8125e5f37832 100644
--- a/drivers/vfio/pci/Kconfig
+++ b/drivers/vfio/pci/Kconfig
@@ -63,4 +63,6 @@  source "drivers/vfio/pci/mlx5/Kconfig"
 
 source "drivers/vfio/pci/hisilicon/Kconfig"
 
+source "drivers/vfio/pci/pds/Kconfig"
+
 endmenu
diff --git a/drivers/vfio/pci/pds/Kconfig b/drivers/vfio/pci/pds/Kconfig
new file mode 100644
index 000000000000..ef5c5972ad92
--- /dev/null
+++ b/drivers/vfio/pci/pds/Kconfig
@@ -0,0 +1,19 @@ 
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2023 Advanced Micro Devices, Inc.
+
+config PDS_VFIO_PCI
+	tristate "VFIO support for PDS PCI devices"
+	depends on PDS_CORE
+	select VFIO_PCI_CORE
+	help
+	  This provides generic PCI support for PDS devices using the VFIO
+	  framework.
+
+	  More specific information on this driver can be
+	  found in
+	  <file:Documentation/networking/device_drivers/ethernet/amd/pds-vfio-pci.rst>.
+
+	  To compile this driver as a module, choose M here. The module
+	  will be called pds-vfio-pci.
+
+	  If you don't know what to do here, say N.