On 11/22/23 17:09, David Marchand wrote:
> The DPDK unit test only runs if vfio or igb_uio kernel modules are loaded:
> on systems with only mlx5, this test is always skipped.
> 
> Besides, the test tries to grab the first device listed by dpdk-devbind.py,
> regardless of the PCI device status regarding kmod binding.
> 
> Remove dependency on this DPDK script and use a minimal script that
> reads PCI sysfs.
> 
> This script is not perfect, as one can imagine PCI devices bound to
> vfio-pci for virtual machines.
> Plus, this script only tries to take over vfio-pci devices. mlx5 devices
> can't be taken over blindly as it could mean losing connectivity to the
> machine if the netdev was in use for this system.
> 
> For those two reasons, add a new environment variable DPDK_PCI_ADDR for
> testers to select the PCI device of their liking.
> For consistency and grep, the temporary file PCI_ADDR is renamed
> to DPDK_PCI_ADDR.
> 
> Reviewed-by: Maxime Coquelin <maxime.coque...@redhat.com>
> Acked-by: Eelco Chaudron <echau...@redhat.com>
> Signed-off-by: David Marchand <david.march...@redhat.com>
> ---
> Changes since v4:
> - separated from the original series,
> - rebased,
> - dropped mlx5 devices from the discovery script,
> - documented DPDK_PCI_ADDR env variable,
> 
> Changes since v3:
> - fixed nit from Maxime,
> 
> Changes since v2:
> - sorted logs alphabetically,
> 
> ---
>  Documentation/topics/testing.rst | 11 ++++++---
>  tests/automake.mk                |  1 +
>  tests/system-dpdk-find-device.py | 39 ++++++++++++++++++++++++++++++++
>  tests/system-dpdk-macros.at      | 10 ++------
>  tests/system-dpdk.at             | 14 ++++++------
>  5 files changed, 57 insertions(+), 18 deletions(-)
>  create mode 100755 tests/system-dpdk-find-device.py
> 
> diff --git a/Documentation/topics/testing.rst 
> b/Documentation/topics/testing.rst
> index 5f6940b84d..fb9b3e77b1 100644
> --- a/Documentation/topics/testing.rst
> +++ b/Documentation/topics/testing.rst
> @@ -343,15 +343,20 @@ To see a list of all the available tests, run::
>  
>  These tests support a `DPDK supported NIC`_. The tests operate on a wider 
> set of
>  environments, for instance, when a virtual port is used.
> -They do require proper DPDK variables (``DPDK_DIR`` and ``DPDK_BUILD``).
>  Moreover you need to have root privileges to load the required modules and 
> to bind
> -the NIC to the DPDK-compatible driver.
> +a PCI device to the DPDK-compatible driver.
>  
>  .. _DPDK supported NIC: https://core.dpdk.org/supported/#nics
>  
> +The phy test will skip if no suitable PCI device is found.
> +It is possible to select which PCI device is used for this test by setting 
> the
> +DPDK_PCI_ADDR environment variable, which is especially useful when testing
> +with a mlx5 device::
> +
> +    # DPDK_PCI_ADDR=0000:82:00.0 make check-dpdk
> +
>  All tests are skipped if no hugepages are configured. User must look into 
> the DPDK
>  manual to figure out how to `Configure hugepages`_.
> -The phy test will skip if no compatible physical device is available.
>  
>  .. _Configure hugepages: 
> https://doc.dpdk.org/guides-22.11/linux_gsg/sys_reqs.html
>  
> diff --git a/tests/automake.mk b/tests/automake.mk
> index f8a925012d..69117514cc 100644
> --- a/tests/automake.mk
> +++ b/tests/automake.mk
> @@ -192,6 +192,7 @@ SYSTEM_OFFLOADS_TESTSUITE_AT = \
>  
>  SYSTEM_DPDK_TESTSUITE_AT = \
>       tests/system-common-macros.at \
> +     tests/system-dpdk-find-device.py \

I didn't review this version in full, but I think, this should go to
CHECK_PYFILES instead.  The *_AT macros are for .at files.

Maybe Kevin can make this change before applying.  Assuming the
flake8-check will pass.

>       tests/system-dpdk-macros.at \
>       tests/system-dpdk-testsuite.at \
>       tests/system-dpdk.at
> diff --git a/tests/system-dpdk-find-device.py 
> b/tests/system-dpdk-find-device.py
> new file mode 100755
> index 0000000000..b0997380bc
> --- /dev/null
> +++ b/tests/system-dpdk-find-device.py
> @@ -0,0 +1,39 @@
> +#!/usr/bin/env python3
> +# Copyright (c) 2021 Red Hat, Inc.

2024, I guess? :)

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to