[RFC,v1,2/5] dts: add a distinction between port and queue offload capabilities

Message ID 20240831000058.23009-3-jspewock@iol.unh.edu (mailing list archive)
State Superseded
Delegated to: Juraj Linkeš
Headers
Series dts: port over Rx/Tx offload suite |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jeremy Spewock Aug. 31, 2024, midnight UTC
From: Jeremy Spewock <jspewock@iol.unh.edu>

Currently in the framework offloading capabilities are collected at a
device-level meaning that, if a capability is supported on either an
entire port or individual queues on that port, it is marked as supported
for the device. In some cases there is a want for being able to get the
granularity of if an offload can be applied on queues rather than just
on the device in general since all capabilities that are supported on
queues are supported on ports, but not all capabilities that are
supported on ports are supported on queues.

This means that the less granular option of a combination of the two is
still achievable by simply specifying that you require a port to be
capable of an offload. This allows for granularity where needed, but
generalization elsewhere.

Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
 dts/framework/remote_session/testpmd_shell.py | 259 +++++++++++++++---
 dts/tests/TestSuite_pmd_buffer_scatter.py     |   2 +-
 2 files changed, 217 insertions(+), 44 deletions(-)
  

Patch

diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index cccc49ce9c..cfb51e3acb 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -1975,12 +1975,21 @@  def get_capabilities(
                 self.show_port_tx_offload_capabilities
             )
             offload_capabilities = offload_capabilities_func(self.ports[0].id)
+            # Any offload that can be set on an individual queue can also be set on the whole port,
+            # but not every capability that can be set on the port can be set on each queue.
             self._update_capabilities_from_flag(
                 supported_capabilities,
                 unsupported_capabilities,
                 capabilities_class,
-                offload_capabilities.per_port,
-                prefix=f"{offload_type}_OFFLOAD_"
+                offload_capabilities.per_port | offload_capabilities.per_queue,
+                prefix=f"PORT_{offload_type}_OFFLOAD_"
+            )
+            self._update_capabilities_from_flag(
+                supported_capabilities,
+                unsupported_capabilities,
+                capabilities_class,
+                offload_capabilities.per_queue,
+                prefix=f"QUEUE_{offload_type}_OFFLOAD_"
             )
         return get_capabilities
 
@@ -2089,167 +2098,331 @@  class NicCapability(NoAliasEnum):
         TestPmdShell.get_capabilities_rxq_info
     )
     #:
-    RX_OFFLOAD_VLAN_STRIP: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_VLAN_STRIP: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports L3 checksum offload.
-    RX_OFFLOAD_IPV4_CKSUM: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_IPV4_CKSUM: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports L4 checksum offload.
-    RX_OFFLOAD_UDP_CKSUM: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_UDP_CKSUM: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports L4 checksum offload.
-    RX_OFFLOAD_TCP_CKSUM: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_TCP_CKSUM: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports Large Receive Offload.
-    RX_OFFLOAD_TCP_LRO: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_TCP_LRO: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports QinQ (queue in queue) offload.
-    RX_OFFLOAD_QINQ_STRIP: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_QINQ_STRIP: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports inner packet L3 checksum.
-    RX_OFFLOAD_OUTER_IPV4_CKSUM: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_OUTER_IPV4_CKSUM: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports MACsec.
-    RX_OFFLOAD_MACSEC_STRIP: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_MACSEC_STRIP: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports filtering of a VLAN Tag identifier.
-    RX_OFFLOAD_VLAN_FILTER: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_VLAN_FILTER: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports VLAN offload.
-    RX_OFFLOAD_VLAN_EXTEND: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_VLAN_EXTEND: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports receiving segmented mbufs.
-    RX_OFFLOAD_SCATTER: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_SCATTER: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports Timestamp.
-    RX_OFFLOAD_TIMESTAMP: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_TIMESTAMP: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports crypto processing while packet is received in NIC.
-    RX_OFFLOAD_SECURITY: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_SECURITY: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports CRC stripping.
-    RX_OFFLOAD_KEEP_CRC: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_KEEP_CRC: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports L4 checksum offload.
-    RX_OFFLOAD_SCTP_CKSUM: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_SCTP_CKSUM: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports inner packet L4 checksum.
-    RX_OFFLOAD_OUTER_UDP_CKSUM: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_OUTER_UDP_CKSUM: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports RSS hashing.
-    RX_OFFLOAD_RSS_HASH: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_RSS_HASH: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports scatter Rx packets to segmented mbufs.
-    RX_OFFLOAD_BUFFER_SPLIT: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_BUFFER_SPLIT: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports all checksum capabilities.
-    RX_OFFLOAD_CHECKSUM: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_CHECKSUM: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports all VLAN capabilities.
-    RX_OFFLOAD_VLAN: TestPmdShellCapabilityMethod = partial(
+    PORT_RX_OFFLOAD_VLAN: TestPmdShellCapabilityMethod = partial(
         TestPmdShell.get_offload_capabilities_func(True)
     )
     #: Device supports L3 checksum offload.
-    TX_OFFLOAD_IPV4_CKSUM = partial(
+    PORT_TX_OFFLOAD_IPV4_CKSUM = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports L4 checksum offload.
-    TX_OFFLOAD_UDP_CKSUM = partial(
+    PORT_TX_OFFLOAD_UDP_CKSUM = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports L4 checksum offload.
-    TX_OFFLOAD_TCP_CKSUM = partial(
+    PORT_TX_OFFLOAD_TCP_CKSUM = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports inner packet L3 checksum.
-    TX_OFFLOAD_OUTER_IPV4_CKSUM = partial(
+    PORT_TX_OFFLOAD_OUTER_IPV4_CKSUM = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports crypto processing while packet is received in NIC.
-    TX_OFFLOAD_SECURITY = partial(
+    PORT_TX_OFFLOAD_SECURITY = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #:
-    TX_OFFLOAD_VLAN_INSERT = partial(
+    PORT_TX_OFFLOAD_VLAN_INSERT = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #:
-    TX_OFFLOAD_QINQ_INSERT = partial(
+    PORT_TX_OFFLOAD_QINQ_INSERT = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #:
-    TX_OFFLOAD_SCTP_CKSUM = partial(
+    PORT_TX_OFFLOAD_SCTP_CKSUM = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports QinQ (queue in queue) stripping offload.
-    TX_OFFLOAD_QINQ_STRIP = partial(
+    PORT_TX_OFFLOAD_QINQ_STRIP = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports TCP Segmentation Offload.
-    TX_OFFLOAD_TCP_TSO = partial(
+    PORT_TX_OFFLOAD_TCP_TSO = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports TCP Segmentation Offload with UDP.
-    TX_OFFLOAD_UDP_TSO = partial(
+    PORT_TX_OFFLOAD_UDP_TSO = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports TCP Segmentation Offload with VXLAN tunnels.
-    TX_OFFLOAD_VXLAN_TNL_TSO = partial(
+    PORT_TX_OFFLOAD_VXLAN_TNL_TSO = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports TCP Segmentation Offload with GRE tunnels.
-    TX_OFFLOAD_GRE_TNL_TSO = partial(
+    PORT_TX_OFFLOAD_GRE_TNL_TSO = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports TCP Segmentation Offload with IPIP tunnels.
-    TX_OFFLOAD_IPIP_TNL_TSO = partial(
+    PORT_TX_OFFLOAD_IPIP_TNL_TSO = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports TCP Segmentation Offload with IP tunnels.
-    TX_OFFLOAD_IP_TNL_TSO = partial(
+    PORT_TX_OFFLOAD_IP_TNL_TSO = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports TCP Segmentation Offload with GENEVE tunnels.
-    TX_OFFLOAD_GENEVE_TNL_TSO = partial(
+    PORT_TX_OFFLOAD_GENEVE_TNL_TSO = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports TCP Segmentation Offload with UDP tunnels.
-    TX_OFFLOAD_UDP_TNL_TSO = partial(
+    PORT_TX_OFFLOAD_UDP_TNL_TSO = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #:
+    PORT_TX_OFFLOAD_MACSEC_INSERT = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #:
+    PORT_TX_OFFLOAD_MT_LOCKFREE = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #:
+    PORT_TX_OFFLOAD_MULTI_SEGS = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #:
+    PORT_TX_OFFLOAD_MBUF_FAST_FREE = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #:
+    QUEUE_RX_OFFLOAD_VLAN_STRIP: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports L3 checksum offload on queues.
+    QUEUE_RX_OFFLOAD_IPV4_CKSUM: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports L4 checksum offload on queues.
+    QUEUE_RX_OFFLOAD_UDP_CKSUM: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports L4 checksum offload on queues.
+    QUEUE_RX_OFFLOAD_TCP_CKSUM: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports Large Receive Offload on queues.
+    QUEUE_RX_OFFLOAD_TCP_LRO: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports QinQ (queue in queue) offload on queues.
+    QUEUE_RX_OFFLOAD_QINQ_STRIP: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports inner packet L3 checksum on queues.
+    QUEUE_RX_OFFLOAD_OUTER_IPV4_CKSUM: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports MACsec on queues.
+    QUEUE_RX_OFFLOAD_MACSEC_STRIP: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports filtering of a VLAN Tag identifier on queues.
+    QUEUE_RX_OFFLOAD_VLAN_FILTER: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports VLAN offload on queues.
+    QUEUE_RX_OFFLOAD_VLAN_EXTEND: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports receiving segmented mbufs on queues.
+    QUEUE_RX_OFFLOAD_SCATTER: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports Timestamp on queues.
+    QUEUE_RX_OFFLOAD_TIMESTAMP: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports crypto processing on queues while packet is received in NIC.
+    QUEUE_RX_OFFLOAD_SECURITY: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports CRC stripping on queues.
+    QUEUE_RX_OFFLOAD_KEEP_CRC: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports L4 checksum offload on queues.
+    QUEUE_RX_OFFLOAD_SCTP_CKSUM: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports inner packet L4 checksum o nqueues.
+    QUEUE_RX_OFFLOAD_OUTER_UDP_CKSUM: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports RSS hashing on queues.
+    QUEUE_RX_OFFLOAD_RSS_HASH: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports scatter Rx packets to segmented mbufs on queues.
+    QUEUE_RX_OFFLOAD_BUFFER_SPLIT: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports all checksum capabilities on queues.
+    QUEUE_RX_OFFLOAD_CHECKSUM: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports all VLAN capabilities on queues.
+    QUEUE_RX_OFFLOAD_VLAN: TestPmdShellCapabilityMethod = partial(
+        TestPmdShell.get_offload_capabilities_func(True)
+    )
+    #: Device supports L3 checksum offload on queues.
+    QUEUE_TX_OFFLOAD_IPV4_CKSUM = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports L4 checksum offload on queues.
+    QUEUE_TX_OFFLOAD_UDP_CKSUM = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports L4 checksum offload on queues.
+    QUEUE_TX_OFFLOAD_TCP_CKSUM = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports inner packet L3 checksum on queues.
+    QUEUE_TX_OFFLOAD_OUTER_IPV4_CKSUM = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports crypto processing on queues while packet is received in NIC.
+    QUEUE_TX_OFFLOAD_SECURITY = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #:
+    QUEUE_TX_OFFLOAD_VLAN_INSERT = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #:
+    QUEUE_TX_OFFLOAD_QINQ_INSERT = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #:
+    QUEUE_TX_OFFLOAD_SCTP_CKSUM = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports QinQ (queue in queue) stripping offload on queues.
+    QUEUE_TX_OFFLOAD_QINQ_STRIP = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports TCP Segmentation Offload on queues.
+    QUEUE_TX_OFFLOAD_TCP_TSO = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports TCP Segmentation Offload on queues with UDP.
+    QUEUE_TX_OFFLOAD_UDP_TSO = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports TCP Segmentation Offload on queues with VXLAN tunnels.
+    QUEUE_TX_OFFLOAD_VXLAN_TNL_TSO = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports TCP Segmentation Offload on queues with GRE tunnels.
+    QUEUE_TX_OFFLOAD_GRE_TNL_TSO = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports TCP Segmentation Offload on queues with IPIP tunnels.
+    QUEUE_TX_OFFLOAD_IPIP_TNL_TSO = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports TCP Segmentation Offload on queues with IP tunnels.
+    QUEUE_TX_OFFLOAD_IP_TNL_TSO = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: Device supports TCP Segmentation Offload on queues with GENEVE tunnels.
+    QUEUE_TX_OFFLOAD_GENEVE_TNL_TSO = partial(
+        TestPmdShell.get_offload_capabilities_func(False)
+    )
+    #: #: Device supports TCP Segmentation Offload on queues with UDP tunnels.
+    QUEUE_TX_OFFLOAD_UDP_TNL_TSO = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #:
-    TX_OFFLOAD_MACSEC_INSERT = partial(
+    QUEUE_TX_OFFLOAD_MACSEC_INSERT = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #:
-    TX_OFFLOAD_MT_LOCKFREE = partial(
+    QUEUE_TX_OFFLOAD_MT_LOCKFREE = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #:
-    TX_OFFLOAD_MULTI_SEGS = partial(
+    QUEUE_TX_OFFLOAD_MULTI_SEGS = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #:
-    TX_OFFLOAD_MBUF_FAST_FREE = partial(
+    QUEUE_TX_OFFLOAD_MBUF_FAST_FREE = partial(
         TestPmdShell.get_offload_capabilities_func(False)
     )
     #: Device supports Rx queue setup after device started.
diff --git a/dts/tests/TestSuite_pmd_buffer_scatter.py b/dts/tests/TestSuite_pmd_buffer_scatter.py
index 64c48b0793..a1803588da 100644
--- a/dts/tests/TestSuite_pmd_buffer_scatter.py
+++ b/dts/tests/TestSuite_pmd_buffer_scatter.py
@@ -28,7 +28,7 @@ 
 from framework.testbed_model.capability import NicCapability, requires
 
 
-@requires(NicCapability.RX_OFFLOAD_SCATTER)
+@requires(NicCapability.PORT_RX_OFFLOAD_SCATTER)
 class TestPmdBufferScatter(TestSuite):
     """DPDK PMD packet scattering test suite.