[v4,11/11] dts: add NIC capabilities from show port info
Checks
Commit Message
Add the capabilities advertised by the testpmd command "show port info"
so that test cases may be marked as requiring those capabilities:
RUNTIME_RX_QUEUE_SETUP
RUNTIME_TX_QUEUE_SETUP
RXQ_SHARE
FLOW_RULE_KEEP
FLOW_SHARED_OBJECT_KEEP
These names are copy pasted from the existing DeviceCapabilitiesFlag
class. Dynamic addition of Enum members runs into problems with typing
(mypy doesn't know about the members) and documentation generation
(Sphinx doesn't know about the members).
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Jeremy Spewock <jspewock@iol.unh.edu>
Reviewed-by: Dean Marx <dmarx@iol.unh.edu>
---
dts/framework/remote_session/testpmd_shell.py | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
Comments
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
@@ -1279,6 +1279,24 @@ def get_capabilities_rxq_info(
else:
unsupported_capabilities.add(NicCapability.SCATTERED_RX_ENABLED)
+ def get_capabilities_show_port_info(
+ self,
+ supported_capabilities: MutableSet["NicCapability"],
+ unsupported_capabilities: MutableSet["NicCapability"],
+ ) -> None:
+ """Get all capabilities from show port info and divide them into supported and unsupported.
+
+ Args:
+ supported_capabilities: Supported capabilities will be added to this set.
+ unsupported_capabilities: Unsupported capabilities will be added to this set.
+ """
+ self._update_capabilities_from_flag(
+ supported_capabilities,
+ unsupported_capabilities,
+ DeviceCapabilitiesFlag,
+ self.ports[0].device_capabilities,
+ )
+
class NicCapability(NoAliasEnum):
"""A mapping between capability names and the associated :class:`TestPmdShell` methods.
@@ -1390,6 +1408,26 @@ class NicCapability(NoAliasEnum):
RX_OFFLOAD_VLAN: TestPmdShellCapabilityMethod = functools.partial(
TestPmdShell.get_capabilities_rx_offload
)
+ #: Device supports Rx queue setup after device started.
+ RUNTIME_RX_QUEUE_SETUP: TestPmdShellCapabilityMethod = functools.partial(
+ TestPmdShell.get_capabilities_show_port_info
+ )
+ #: Device supports Tx queue setup after device started.
+ RUNTIME_TX_QUEUE_SETUP: TestPmdShellCapabilityMethod = functools.partial(
+ TestPmdShell.get_capabilities_show_port_info
+ )
+ #: Device supports shared Rx queue among ports within Rx domain and switch domain.
+ RXQ_SHARE: TestPmdShellCapabilityMethod = functools.partial(
+ TestPmdShell.get_capabilities_show_port_info
+ )
+ #: Device supports keeping flow rules across restart.
+ FLOW_RULE_KEEP: TestPmdShellCapabilityMethod = functools.partial(
+ TestPmdShell.get_capabilities_show_port_info
+ )
+ #: Device supports keeping shared flow objects across restart.
+ FLOW_SHARED_OBJECT_KEEP: TestPmdShellCapabilityMethod = functools.partial(
+ TestPmdShell.get_capabilities_show_port_info
+ )
def __call__(
self,