DPDK patches and discussions
 help / color / mirror / Atom feed
From: Patrick Robb <probb@iol.unh.edu>
To: Dean Marx <dmarx@iol.unh.edu>
Cc: luca.vizzarro@arm.com, yoan.picchi@foss.arm.com,
	 Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com,
	dev@dpdk.org
Subject: Re: [PATCH v3 3/4] dts: add physical function capability check
Date: Fri, 4 Jul 2025 00:23:43 -0400	[thread overview]
Message-ID: <CAJvnSUDR-T_u-PTy1jovzusZzoQ9znkQVFza9VACNAa65gY3fg@mail.gmail.com> (raw)
In-Reply-To: <20250702162331.352313-3-dmarx@iol.unh.edu>

[-- Attachment #1: Type: text/plain, Size: 12173 bytes --]

On Wed, Jul 2, 2025 at 12:23 PM Dean Marx <dmarx@iol.unh.edu> wrote:

> Add a physical function NIC capability that checks
> if the test run is using PFs. Add PF capability
> requirement to all suites/cases that do not
> run without error on virtual functions.
>
> Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
> ---
>  dts/framework/remote_session/testpmd_shell.py | 22 +++++++++++++++++++
>  dts/tests/TestSuite_dynamic_config.py         |  3 ++-
>  dts/tests/TestSuite_dynamic_queue_conf.py     |  1 +
>  dts/tests/TestSuite_l2fwd.py                  |  3 ++-
>  dts/tests/TestSuite_mac_filter.py             |  1 +
>  dts/tests/TestSuite_mtu.py                    |  4 +++-
>  dts/tests/TestSuite_pmd_buffer_scatter.py     |  1 +
>  dts/tests/TestSuite_port_control.py           |  3 ++-
>  dts/tests/TestSuite_port_stats.py             |  2 ++
>  dts/tests/TestSuite_promisc_support.py        |  4 +++-
>  dts/tests/TestSuite_rte_flow.py               |  1 +
>  dts/tests/TestSuite_softnic.py                |  3 ++-
>  dts/tests/TestSuite_uni_pkt.py                |  2 ++
>  13 files changed, 44 insertions(+), 6 deletions(-)
>
> diff --git a/dts/framework/remote_session/testpmd_shell.py
> b/dts/framework/remote_session/testpmd_shell.py
> index 6d75f89969..ad8cb273dc 100644
> --- a/dts/framework/remote_session/testpmd_shell.py
> +++ b/dts/framework/remote_session/testpmd_shell.py
> @@ -2655,6 +2655,23 @@ def get_capabilities_flow_ctrl(
>          else:
>              unsupported_capabilities.add(NicCapability.FLOW_CTRL)
>
> +    def get_capabilities_physical_function(
> +        self,
> +        supported_capabilities: MutableSet["NicCapability"],
> +        unsupported_capabilities: MutableSet["NicCapability"],
> +    ) -> None:
> +        """Store capability representing a physical function test run.
> +
> +        Args:
> +            supported_capabilities: Supported capabilities will be added
> to this set.
> +            unsupported_capabilities: Unsupported capabilities will be
> added to this set.
> +        """
> +        ctx = get_ctx()
> +        if ctx.topology.vf_ports == []:
> +            supported_capabilities.add(NicCapability.PHYSICAL_FUNCTION)
> +        else:
> +            unsupported_capabilities.add(NicCapability.PHYSICAL_FUNCTION)
> +
>

Another option would be to read directly from
config.virtual_functions_testrun. But, it's the same thing at the end of
the day.


>
>  class NicCapability(NoAliasEnum):
>      """A mapping between capability names and the associated
> :class:`TestPmdShell` methods.
> @@ -2803,6 +2820,11 @@ class NicCapability(NoAliasEnum):
>      )
>      #: Device supports flow ctrl.
>      FLOW_CTRL: TestPmdShellNicCapability =
> (TestPmdShell.get_capabilities_flow_ctrl, None)
> +    #: Device is running on a physical function.
> +    PHYSICAL_FUNCTION: TestPmdShellNicCapability = (
> +        TestPmdShell.get_capabilities_physical_function,
> +        None,
> +    )
>
>      def __call__(
>          self,
> diff --git a/dts/tests/TestSuite_dynamic_config.py
> b/dts/tests/TestSuite_dynamic_config.py
> index 1fce31a0b5..49f295a39a 100644
> --- a/dts/tests/TestSuite_dynamic_config.py
> +++ b/dts/tests/TestSuite_dynamic_config.py
> @@ -20,11 +20,12 @@
>  from scapy.packet import Raw
>
>  from framework.params.testpmd import SimpleForwardingModes
> -from framework.remote_session.testpmd_shell import TestPmdShell
> +from framework.remote_session.testpmd_shell import NicCapability,
> TestPmdShell
>  from framework.test_suite import TestSuite, func_test
>  from framework.testbed_model.capability import TopologyType, requires
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  @requires(topology_type=TopologyType.two_links)
>  class TestDynamicConfig(TestSuite):
>      """Dynamic config suite.
> diff --git a/dts/tests/TestSuite_dynamic_queue_conf.py
> b/dts/tests/TestSuite_dynamic_queue_conf.py
> index 344dd540eb..f8c7dbfb71 100644
> --- a/dts/tests/TestSuite_dynamic_queue_conf.py
> +++ b/dts/tests/TestSuite_dynamic_queue_conf.py
> @@ -117,6 +117,7 @@ def wrap(self: "TestDynamicQueueConf", is_rx_testing:
> bool) -> None:
>      return wrap
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  class TestDynamicQueueConf(TestSuite):
>      """DPDK dynamic queue configuration test suite.
>
> diff --git a/dts/tests/TestSuite_l2fwd.py b/dts/tests/TestSuite_l2fwd.py
> index 0555d75ed8..5ffa2dcd19 100644
> --- a/dts/tests/TestSuite_l2fwd.py
> +++ b/dts/tests/TestSuite_l2fwd.py
> @@ -9,7 +9,7 @@
>
>  from framework.context import filter_cores
>  from framework.params.testpmd import EthPeer, SimpleForwardingModes
> -from framework.remote_session.testpmd_shell import TestPmdShell
> +from framework.remote_session.testpmd_shell import NicCapability,
> TestPmdShell
>  from framework.test_suite import TestSuite, func_test
>  from framework.testbed_model.capability import requires
>  from framework.testbed_model.cpu import LogicalCoreCount
> @@ -17,6 +17,7 @@
>  from framework.utils import generate_random_packets
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  @requires(topology_type=TopologyType.two_links)
>  class TestL2fwd(TestSuite):
>      """L2 forwarding test suite."""
> diff --git a/dts/tests/TestSuite_mac_filter.py
> b/dts/tests/TestSuite_mac_filter.py
> index 9dbfec5da2..2387fdfac2 100644
> --- a/dts/tests/TestSuite_mac_filter.py
> +++ b/dts/tests/TestSuite_mac_filter.py
> @@ -25,6 +25,7 @@
>  from framework.testbed_model.capability import requires
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  class TestMacFilter(TestSuite):
>      """Mac address allowlist filtering test suite.
>
> diff --git a/dts/tests/TestSuite_mtu.py b/dts/tests/TestSuite_mtu.py
> index af6ab88501..d5b3fe02af 100644
> --- a/dts/tests/TestSuite_mtu.py
> +++ b/dts/tests/TestSuite_mtu.py
> @@ -17,8 +17,9 @@
>  from scapy.layers.l2 import Ether
>  from scapy.packet import Raw
>
> -from framework.remote_session.testpmd_shell import TestPmdShell
> +from framework.remote_session.testpmd_shell import NicCapability,
> TestPmdShell
>  from framework.test_suite import TestSuite, func_test
> +from framework.testbed_model.capability import requires
>
>  STANDARD_FRAME = 1518  # --max-pkt-len will subtract l2 information at a
> minimum of 18 bytes.
>  JUMBO_FRAME = 9018
> @@ -30,6 +31,7 @@
>  VENDOR_AGNOSTIC_PADDING = 9  # Used as a work around for varying MTU
> definitions between vendors.
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  class TestMtu(TestSuite):
>      """DPDK PMD jumbo frames and MTU update test suite.
>
> diff --git a/dts/tests/TestSuite_pmd_buffer_scatter.py
> b/dts/tests/TestSuite_pmd_buffer_scatter.py
> index 5e23f28bc6..015163dd11 100644
> --- a/dts/tests/TestSuite_pmd_buffer_scatter.py
> +++ b/dts/tests/TestSuite_pmd_buffer_scatter.py
> @@ -28,6 +28,7 @@
>  from framework.testbed_model.capability import NicCapability, requires
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  @requires(NicCapability.RX_OFFLOAD_SCATTER)
>  class TestPmdBufferScatter(TestSuite):
>      """DPDK PMD packet scattering test suite.
> diff --git a/dts/tests/TestSuite_port_control.py
> b/dts/tests/TestSuite_port_control.py
> index ad5a09c58e..58783f1d18 100644
> --- a/dts/tests/TestSuite_port_control.py
> +++ b/dts/tests/TestSuite_port_control.py
> @@ -13,11 +13,12 @@
>  from scapy.packet import Packet, Raw
>
>  from framework.params.testpmd import SimpleForwardingModes
> -from framework.remote_session.testpmd_shell import TestPmdShell
> +from framework.remote_session.testpmd_shell import NicCapability,
> TestPmdShell
>  from framework.test_suite import TestSuite, func_test
>  from framework.testbed_model.capability import TopologyType, requires
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  @requires(topology_type=TopologyType.two_links)
>  class TestPortControl(TestSuite):
>      """DPDK Port Control Testing Suite."""
> diff --git a/dts/tests/TestSuite_port_stats.py
> b/dts/tests/TestSuite_port_stats.py
> index 2bb8747399..ddd28623b3 100644
> --- a/dts/tests/TestSuite_port_stats.py
> +++ b/dts/tests/TestSuite_port_stats.py
> @@ -19,6 +19,7 @@
>
>  from framework.params.testpmd import SimpleForwardingModes
>  from framework.remote_session.testpmd_shell import (
> +    NicCapability,
>      RtePTypes,
>      TestPmdShell,
>      TestPmdVerbosePacket,
> @@ -27,6 +28,7 @@
>  from framework.testbed_model.capability import TopologyType, requires
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  @requires(topology_type=TopologyType.two_links)
>  class TestPortStats(TestSuite):
>      """DPDK Port statistics testing suite.
> diff --git a/dts/tests/TestSuite_promisc_support.py
> b/dts/tests/TestSuite_promisc_support.py
> index 445f6e1d69..8a7a7efb57 100644
> --- a/dts/tests/TestSuite_promisc_support.py
> +++ b/dts/tests/TestSuite_promisc_support.py
> @@ -11,10 +11,12 @@
>  from scapy.layers.l2 import Ether
>  from scapy.packet import Raw
>
> -from framework.remote_session.testpmd_shell import TestPmdShell
> +from framework.remote_session.testpmd_shell import NicCapability,
> TestPmdShell
>  from framework.test_suite import TestSuite, func_test
> +from framework.testbed_model.capability import requires
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  class TestPromiscSupport(TestSuite):
>      """Promiscuous mode support test suite."""
>
> diff --git a/dts/tests/TestSuite_rte_flow.py
> b/dts/tests/TestSuite_rte_flow.py
> index e70f7ea8d1..4855e4261d 100644
> --- a/dts/tests/TestSuite_rte_flow.py
> +++ b/dts/tests/TestSuite_rte_flow.py
> @@ -316,6 +316,7 @@ def test_queue_action_IP(self) -> None:
>              test_queue=2,
>          )
>
> +    @requires(NicCapability.PHYSICAL_FUNCTION)
>      @func_test
>      def test_queue_action_L4(self) -> None:
>          """Validate flow rules with queue actions and TCP/UDP patterns.
> diff --git a/dts/tests/TestSuite_softnic.py
> b/dts/tests/TestSuite_softnic.py
> index c1873dca4c..27754c08e7 100644
> --- a/dts/tests/TestSuite_softnic.py
> +++ b/dts/tests/TestSuite_softnic.py
> @@ -9,7 +9,7 @@
>  from pathlib import Path, PurePath
>
>  from framework.params.testpmd import EthPeer
> -from framework.remote_session.testpmd_shell import TestPmdShell
> +from framework.remote_session.testpmd_shell import NicCapability,
> TestPmdShell
>  from framework.test_suite import TestSuite, func_test
>  from framework.testbed_model.capability import requires
>  from framework.testbed_model.topology import TopologyType
> @@ -17,6 +17,7 @@
>  from framework.utils import generate_random_packets
>
>
> +@requires(NicCapability.PHYSICAL_FUNCTION)
>  @requires(topology_type=TopologyType.two_links)
>  class TestSoftnic(TestSuite):
>      """Softnic test suite."""
> diff --git a/dts/tests/TestSuite_uni_pkt.py
> b/dts/tests/TestSuite_uni_pkt.py
> index fdb9c29059..690c5d4fd1 100644
> --- a/dts/tests/TestSuite_uni_pkt.py
> +++ b/dts/tests/TestSuite_uni_pkt.py
> @@ -20,6 +20,7 @@
>  from scapy.packet import Packet, Raw
>
>  from framework.remote_session.testpmd_shell import (
> +    NicCapability,
>      RtePTypes,
>      SimpleForwardingModes,
>      TestPmdShell,
> @@ -258,6 +259,7 @@ def test_nsh_packet_detect(self) -> None:
>          with TestPmdShell() as testpmd:
>              self.setup_session(testpmd=testpmd, expected_flags=flag_list,
> packet_list=packet_list)
>
> +    @requires(NicCapability.PHYSICAL_FUNCTION)
>      @func_test
>      def test_vxlan_tunnel_packet_detect(self) -> None:
>          """Ensure the correct flags are shown in the verbose output when
> sending VXLAN packets.
> --
> 2.49.0
>
>
In principle some of the functions performed in these testsuites should be
possible via VFs.

As a follow up task in 25.11 we should assess this and see if the total
list of VF compatible testsuites can be extended.

Reviewed-by: Patrick Robb <probb@iol.unh.edu>
Tested-by: Patrick Robb <probb@iol.unh.edu>

[-- Attachment #2: Type: text/html, Size: 14143 bytes --]

  reply	other threads:[~2025-07-04  4:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 20:13 [PATCH v1] dts: add virtual functions to framework Dean Marx
2025-06-26 15:27 ` [PATCH v2 1/4] " Dean Marx
2025-06-26 15:27   ` [PATCH v2 2/4] dts: remove unnecessary testpmd verification Dean Marx
2025-06-26 15:27   ` [PATCH v2 3/4] dts: modify existing suites to work with VFs Dean Marx
2025-07-02 16:23     ` [PATCH v3 1/4] dts: add virtual functions to framework Dean Marx
2025-07-02 16:23       ` [PATCH v3 2/4] dts: remove unnecessary testpmd verification Dean Marx
2025-07-04  4:23         ` Patrick Robb
2025-07-02 16:23       ` [PATCH v3 3/4] dts: add physical function capability check Dean Marx
2025-07-04  4:23         ` Patrick Robb [this message]
2025-07-02 16:23       ` [PATCH v3 4/4] dts: add sr-iov section to docs Dean Marx
2025-07-04  4:23         ` Patrick Robb
2025-07-02 16:48       ` [PATCH v3 1/4] dts: add virtual functions to framework Dean Marx
2025-07-04  4:22       ` Patrick Robb
2025-07-04  4:25         ` Patrick Robb
2025-06-26 15:27   ` [PATCH v2 4/4] dts: add physical function capability check Dean Marx

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=CAJvnSUDR-T_u-PTy1jovzusZzoQ9znkQVFza9VACNAa65gY3fg@mail.gmail.com \
    --to=probb@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=dmarx@iol.unh.edu \
    --cc=luca.vizzarro@arm.com \
    --cc=paul.szczepanek@arm.com \
    --cc=yoan.picchi@foss.arm.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).