From patchwork Fri Oct 6 12:55:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 132359 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BB434426D0; Fri, 6 Oct 2023 14:55:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 406CD402C8; Fri, 6 Oct 2023 14:55:14 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 07C6F400D7 for ; Fri, 6 Oct 2023 14:55:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696596912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JkM4Rf8X2O3wMgEiVzuW/a+EgCEPDrzu3QKUw2vJy3k=; b=jENuA77Pt10yftNPCx0Xq3aDjzxQ1naVquCjyczBzjiVxli+4gW2u05WYQ1ri9T7/KVUst PofIR9OyrP7wsq9k0oJqAWOqVltxsJDI+brPUYwOzjyE+rPRtIBNKbrEnlPWvLnmeq/uH2 RXWI33+QtQp2tL19ojAEFw/gznGqVro= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-343-31GpNWFNNyCIAPj_aKmzKA-1; Fri, 06 Oct 2023 08:55:09 -0400 X-MC-Unique: 31GpNWFNNyCIAPj_aKmzKA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A118D3C1709C; Fri, 6 Oct 2023 12:55:08 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AFA02027019; Fri, 6 Oct 2023 12:55:06 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, maxime.coquelin@redhat.com, ferruh.yigit@amd.com, gakhil@marvell.com, Nicolas Chautru , Sunil Uttarwar , Yuying Zhang , Beilei Xing , Simei Su , Wenjun Wu , Qiming Yang Subject: [PATCH] doc/guides: refer to generic binding devices section Date: Fri, 6 Oct 2023 14:55:00 +0200 Message-ID: <20231006125500.740299-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Rather than copy/paste everywhere how to bind a device and create VF devices, refer to the Linux GSG section about it. Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin --- doc/guides/bbdevs/acc100.rst | 73 ++--------------------------- doc/guides/bbdevs/fpga_5gnr_fec.rst | 71 ++-------------------------- doc/guides/bbdevs/fpga_lte_fec.rst | 70 ++------------------------- doc/guides/bbdevs/vrb1.rst | 66 ++------------------------ doc/guides/cryptodevs/ccp.rst | 14 +----- doc/guides/nics/intel_vf.rst | 57 ++++------------------ 6 files changed, 25 insertions(+), 326 deletions(-) diff --git a/doc/guides/bbdevs/acc100.rst b/doc/guides/bbdevs/acc100.rst index 8a275dcdd4..f26ce58f78 100644 --- a/doc/guides/bbdevs/acc100.rst +++ b/doc/guides/bbdevs/acc100.rst @@ -94,7 +94,7 @@ Initialization -------------- When the device first powers up, its PCI Physical Functions (PF) can be listed through these -commands for ACC100 and ACC101 respectively: +commands for ACC100 (device id ``0d5c``) and ACC101 (device id ``57c4``) respectively: .. code-block:: console @@ -102,76 +102,11 @@ commands for ACC100 and ACC101 respectively: sudo lspci -vd8086:57c4 The physical and virtual functions are compatible with Linux UIO drivers: -``vfio`` and ``igb_uio``. However, in order to work the 5G/4G +``vfio_pci`` and ``igb_uio``. However, in order to work the 5G/4G FEC device first needs to be bound to one of these linux drivers through DPDK. - -Bind PF UIO driver(s) -~~~~~~~~~~~~~~~~~~~~~ - -Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use -``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. - -The igb_uio driver may be bound to the PF PCI device using one of two methods for ACC100 -(for ACC101 the device id ``57c4`` should be used in lieu of ``0d5c``): - - -1. PCI functions (physical or virtual, depending on the use case) can be bound to -the UIO driver by repeating this command for every function. - -.. code-block:: console - - cd - insmod ./build/kmod/igb_uio.ko - echo "8086 0d5c" > /sys/bus/pci/drivers/igb_uio/new_id - lspci -vd8086:0d5c - - -2. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool - -.. code-block:: console - - cd - ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0 - -where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:0d5c - - -In a similar way the 5G/4G FEC PF may be bound with vfio-pci as any PCIe device. - - -Enable Virtual Functions -~~~~~~~~~~~~~~~~~~~~~~~~ - -Now, it should be visible in the printouts that PCI PF is under igb_uio control -"``Kernel driver in use: igb_uio``" - -To show the number of available VFs on the device, read ``sriov_totalvfs`` file.. - -.. code-block:: console - - cat /sys/bus/pci/devices/0000\:\:./sriov_totalvfs - - where 0000\:\:. is the PCI device ID - - -To enable VFs via igb_uio, echo the number of virtual functions intended to -enable to ``max_vfs`` file.. - -.. code-block:: console - - echo > /sys/bus/pci/devices/0000\:\:./max_vfs - - -Afterwards, all VFs must be bound to appropriate UIO drivers as required, same -way it was done with the physical function previously. - -Enabling SR-IOV via vfio driver is pretty much the same, except that the file -name is different: - -.. code-block:: console - - echo > /sys/bus/pci/devices/0000\:\:./sriov_numvfs +For more details on how to bind the PF device and create VF devices, see +:ref:`linux_gsg_binding_kernel`. Configure the VFs through PF diff --git a/doc/guides/bbdevs/fpga_5gnr_fec.rst b/doc/guides/bbdevs/fpga_5gnr_fec.rst index 9d71585e9e..d126c9c3e4 100644 --- a/doc/guides/bbdevs/fpga_5gnr_fec.rst +++ b/doc/guides/bbdevs/fpga_5gnr_fec.rst @@ -72,76 +72,11 @@ When the device first powers up, its PCI Physical Functions (PF) can be listed t sudo lspci -vd8086:0d8f The physical and virtual functions are compatible with Linux UIO drivers: -``vfio`` and ``igb_uio``. However, in order to work the FPGA 5GNR FEC device firstly needs +``vfio_pci`` and ``igb_uio``. However, in order to work the FPGA 5GNR FEC device firstly needs to be bound to one of these linux drivers through DPDK. - -Bind PF UIO driver(s) -~~~~~~~~~~~~~~~~~~~~~ - -Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use -``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. - -The igb_uio driver may be bound to the PF PCI device using one of two methods: - - -1. PCI functions (physical or virtual, depending on the use case) can be bound to -the UIO driver by repeating this command for every function. - -.. code-block:: console - - insmod igb_uio.ko - echo "8086 0d8f" > /sys/bus/pci/drivers/igb_uio/new_id - lspci -vd8086:0d8f - - -2. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool - -.. code-block:: console - - cd - ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0 - -where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:0d8f - - -In the same way the FPGA 5GNR FEC PF can be bound with vfio, but vfio driver does not -support SR-IOV configuration right out of the box, so it will need to be patched. - - -Enable Virtual Functions -~~~~~~~~~~~~~~~~~~~~~~~~ - -Now, it should be visible in the printouts that PCI PF is under igb_uio control -"``Kernel driver in use: igb_uio``" - -To show the number of available VFs on the device, read ``sriov_totalvfs`` file.. - -.. code-block:: console - - cat /sys/bus/pci/devices/0000\:\:./sriov_totalvfs - - where 0000\:\:. is the PCI device ID - - -To enable VFs via igb_uio, echo the number of virtual functions intended to -enable to ``max_vfs`` file.. - -.. code-block:: console - - echo > /sys/bus/pci/devices/0000\:\:./max_vfs - - -Afterwards, all VFs must be bound to appropriate UIO drivers as required, same -way it was done with the physical function previously. - -Enabling SR-IOV via vfio driver is pretty much the same, except that the file -name is different: - -.. code-block:: console - - echo > /sys/bus/pci/devices/0000\:\:./sriov_numvfs - +For more details on how to bind the PF device and create VF devices, see +:ref:`linux_gsg_binding_kernel`. Configure the VFs through PF ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/guides/bbdevs/fpga_lte_fec.rst b/doc/guides/bbdevs/fpga_lte_fec.rst index c3379c24e3..53b7cd5678 100644 --- a/doc/guides/bbdevs/fpga_lte_fec.rst +++ b/doc/guides/bbdevs/fpga_lte_fec.rst @@ -71,75 +71,11 @@ When the device first powers up, its PCI Physical Functions (PF) can be listed t sudo lspci -vd1172:5052 The physical and virtual functions are compatible with Linux UIO drivers: -``vfio`` and ``igb_uio``. However, in order to work the FPGA LTE FEC device firstly needs +``vfio_pci`` and ``igb_uio``. However, in order to work the FPGA LTE FEC device firstly needs to be bound to one of these linux drivers through DPDK. - -Bind PF UIO driver(s) -~~~~~~~~~~~~~~~~~~~~~ - -Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use -``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. - -The igb_uio driver may be bound to the PF PCI device using one of two methods: - - -1. PCI functions (physical or virtual, depending on the use case) can be bound to -the UIO driver by repeating this command for every function. - -.. code-block:: console - - insmod igb_uio.ko - echo "1172 5052" > /sys/bus/pci/drivers/igb_uio/new_id - lspci -vd1172: - - -2. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool - -.. code-block:: console - - cd - ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0 - -where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd1172: - - -In the same way the FPGA LTE FEC PF can be bound with vfio, but vfio driver does not -support SR-IOV configuration right out of the box, so it will need to be patched. - - -Enable Virtual Functions -~~~~~~~~~~~~~~~~~~~~~~~~ - -Now, it should be visible in the printouts that PCI PF is under igb_uio control -"``Kernel driver in use: igb_uio``" - -To show the number of available VFs on the device, read ``sriov_totalvfs`` file.. - -.. code-block:: console - - cat /sys/bus/pci/devices/0000\:\:./sriov_totalvfs - - where 0000\:\:. is the PCI device ID - - -To enable VFs via igb_uio, echo the number of virtual functions intended to -enable to ``max_vfs`` file.. - -.. code-block:: console - - echo > /sys/bus/pci/devices/0000\:\:./max_vfs - - -Afterwards, all VFs must be bound to appropriate UIO drivers as required, same -way it was done with the physical function previously. - -Enabling SR-IOV via vfio driver is pretty much the same, except that the file -name is different: - -.. code-block:: console - - echo > /sys/bus/pci/devices/0000\:\:./sriov_numvfs +For more details on how to bind the PF device and create VF devices, see +:ref:`linux_gsg_binding_kernel`. Configure the VFs through PF diff --git a/doc/guides/bbdevs/vrb1.rst b/doc/guides/bbdevs/vrb1.rst index 9c48d30964..9d05772967 100644 --- a/doc/guides/bbdevs/vrb1.rst +++ b/doc/guides/bbdevs/vrb1.rst @@ -111,72 +111,12 @@ can be listed through these commands for Intel vRAN Boost v1: sudo lspci -vd8086:57c0 The physical and virtual functions are compatible with Linux UIO drivers: -``vfio`` and ``igb_uio``. +``vfio_pci`` and ``igb_uio``. However, in order to work the 5G/4G FEC device first needs to be bound to one of these Linux drivers through DPDK. - -Bind PF UIO driver(s) -~~~~~~~~~~~~~~~~~~~~~ - -Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use -``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver. - -The igb_uio driver may be bound to the PF PCI device using one of two methods -for Intel vRAN Boost v1: - -#. PCI functions (physical or virtual, depending on the use case) can be bound -to the UIO driver by repeating this command for every function. - -.. code-block:: console - - cd - insmod build/kmod/igb_uio.ko - echo "8086 57c0" > /sys/bus/pci/drivers/igb_uio/new_id - lspci -vd8086:57c0 - -#. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool - -.. code-block:: console - - cd - usertools/dpdk-devbind.py -b igb_uio 0000:f7:00.0 - -where the PCI device ID (example: 0000:f7:00.0) is obtained using ``lspci -vd8086:57c0``. - -In a similar way the PF may be bound with vfio-pci as any PCIe device. - - -Enable Virtual Functions -~~~~~~~~~~~~~~~~~~~~~~~~ - -Now, it should be visible in the printouts that PCI PF is under igb_uio control -"``Kernel driver in use: igb_uio``" - -To show the number of available VFs on the device, read ``sriov_totalvfs`` file. - -.. code-block:: console - - cat /sys/bus/pci/devices/0000\:\:./sriov_totalvfs - -where ``0000\:\:.`` is the PCI device ID - -To enable VFs via igb_uio, echo the number of virtual functions intended -to enable to ``max_vfs`` file. - -.. code-block:: console - - echo > /sys/bus/pci/devices/0000\:\:./max_vfs - -Afterwards, all VFs must be bound to appropriate UIO drivers as required, -same way it was done with the physical function previously. - -Enabling SR-IOV via VFIO driver is pretty much the same, -except that the file name is different: - -.. code-block:: console - - echo > /sys/bus/pci/devices/0000\:\:./sriov_numvfs +For more details on how to bind the PF device and create VF devices, see +:ref:`linux_gsg_binding_kernel`. Configure the VFs through PF diff --git a/doc/guides/cryptodevs/ccp.rst b/doc/guides/cryptodevs/ccp.rst index 52e98b0859..a314fb6fd1 100644 --- a/doc/guides/cryptodevs/ccp.rst +++ b/doc/guides/cryptodevs/ccp.rst @@ -70,18 +70,8 @@ This code was verified on Ubuntu 16.04. Initialization -------------- -Bind the CCP devices to DPDK UIO driver module before running the CCP PMD stack. -e.g. for the 0x1456 device:: - - modprobe uio - insmod igb_uio.ko - echo "1022 1456" > /sys/bus/pci/drivers/igb_uio/new_id - -Another way to bind the CCP devices to DPDK UIO driver is by using the ``dpdk-devbind.py`` script. -The following command assumes ``BFD`` as ``0000:09:00.2``:: - - cd to the top-level DPDK directory - ./usertools/dpdk-devbind.py -b igb_uio 0000:09:00.2 +Bind the CCP devices to ``vfio_pci`` or ``igb_uio`` (see :ref:`linux_gsg_binding_kernel`) +before running the CCP PMD stack. To use the PMD in an application, user must: diff --git a/doc/guides/nics/intel_vf.rst b/doc/guides/nics/intel_vf.rst index d365dbc185..8d157ceaa4 100644 --- a/doc/guides/nics/intel_vf.rst +++ b/doc/guides/nics/intel_vf.rst @@ -150,16 +150,8 @@ For example, rmmod i40e (To remove the i40e module) insmod i40e.ko max_vfs=2,2 (To enable two Virtual Functions per port) -* Using the DPDK PMD PF i40e driver: - - Kernel Params: iommu=pt, intel_iommu=on - - .. code-block:: console - - modprobe uio - insmod igb_uio - ./dpdk-devbind.py -b igb_uio bb:ss.f - echo 2 > /sys/bus/pci/devices/0000\:bb\:ss.f/max_vfs (To enable two VFs on a specific PCI device) +* Using the DPDK PMD PF i40e driver, bind the PF device to ``vfio_pci`` or ``igb_uio`` and + create VF devices. See :ref:`linux_gsg_binding_kernel`. Launch the DPDK testpmd/example or your own host daemon application using the DPDK PMD library. @@ -200,22 +192,14 @@ For example, rmmod ixgbe (To remove the ixgbe module) insmod ixgbe max_vfs=2,2 (To enable two Virtual Functions per port) -* Using the DPDK PMD PF ixgbe driver: - - Kernel Params: iommu=pt, intel_iommu=on - - .. code-block:: console - - modprobe uio - insmod igb_uio - ./dpdk-devbind.py -b igb_uio bb:ss.f - echo 2 > /sys/bus/pci/devices/0000\:bb\:ss.f/max_vfs (To enable two VFs on a specific PCI device) +* Using the DPDK PMD PF ixgbe driver, bind the PF device to ``vfio_pci`` or ``igb_uio`` and + create VF devices. See :ref:`linux_gsg_binding_kernel`. Launch the DPDK testpmd/example or your own host daemon application using the DPDK PMD library. * Using the DPDK PMD PF ixgbe driver to enable VF RSS: - Same steps as above to install the modules of uio, igb_uio, specify max_vfs for PCI device, and + Same steps as above to bind the PF device, create VF devices, and launch the DPDK testpmd/example or your own host daemon application using the DPDK PMD library. The available queue number (at most 4) per VF depends on the total number of pool, which is @@ -286,15 +270,8 @@ For example, rmmod igb (To remove the igb module) insmod igb max_vfs=2,2 (To enable two Virtual Functions per port) -* Using DPDK PMD PF igb driver: - - Kernel Params: iommu=pt, intel_iommu=on modprobe uio - - .. code-block:: console - - insmod igb_uio - ./dpdk-devbind.py -b igb_uio bb:ss.f - echo 2 > /sys/bus/pci/devices/0000\:bb\:ss.f/max_vfs (To enable two VFs on a specific pci device) +* Using the DPDK PMD PF igb driver, bind the PF device to ``vfio_pci`` or ``igb_uio`` and + create VF devices. See :ref:`linux_gsg_binding_kernel`. Launch DPDK testpmd/example or your own host daemon application using the DPDK PMD library. @@ -409,22 +386,8 @@ The setup procedure is as follows: rmmod ixgbe modprobe ixgbe max_vfs=2,2 - When using DPDK PMD PF driver, insert DPDK kernel module igb_uio and set the number of VF by sysfs max_vfs: - - .. code-block:: console - - modprobe uio - insmod igb_uio - ./dpdk-devbind.py -b igb_uio 02:00.0 02:00.1 0e:00.0 0e:00.1 - echo 2 > /sys/bus/pci/devices/0000\:02\:00.0/max_vfs - echo 2 > /sys/bus/pci/devices/0000\:02\:00.1/max_vfs - echo 2 > /sys/bus/pci/devices/0000\:0e\:00.0/max_vfs - echo 2 > /sys/bus/pci/devices/0000\:0e\:00.1/max_vfs - - .. note:: - - You need to explicitly specify number of vfs for each port, for example, - in the command above, it creates two vfs for the first two ixgbe ports. + When using DPDK PMD PF driver, bind the PF device to ``vfio_pci`` or ``igb_uio`` and + create VF devices. See :ref:`linux_gsg_binding_kernel`. Let say we have a machine with four physical ixgbe ports: @@ -437,7 +400,7 @@ The setup procedure is as follows: 0000:0e:00.1 - The command above creates two vfs for device 0000:02:00.0: + The mentioned steps above should result in two vfs for device 0000:02:00.0: .. code-block:: console