summaryrefslogtreecommitdiff
path: root/dts/framework
diff options
context:
space:
mode:
authorNicholas Pratte <[email protected]>2024-10-16 13:13:06 -0400
committerPaul Szczepanek <[email protected]>2024-11-15 15:00:18 +0100
commit474ce443f7fb8f316faa362ecaf3e6841b3ad6b1 (patch)
tree55b682cca2133b889fc066226baad1815d4693d8 /dts/framework
parente3b16f45cb17fe7dc4251e493fa5e9ef235bfd0d (diff)
dts: add capability check for multicast filtering
The multicast address filter component of the MAC filter test suite is not supported by all device drivers. So, a simple multicast filter capability check is added for the multicast filter testcase. Bugzilla ID: 1454 Signed-off-by: Nicholas Pratte <[email protected]>
Diffstat (limited to 'dts/framework')
-rw-r--r--dts/framework/remote_session/testpmd_shell.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index 4faf7b21c3..14fdd8e88e 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -2088,6 +2088,27 @@ class TestPmdShell(DPDKShell):
self.ports[0].device_capabilities,
)
+ def get_capabilities_mcast_filtering(
+ self,
+ supported_capabilities: MutableSet["NicCapability"],
+ unsupported_capabilities: MutableSet["NicCapability"],
+ ) -> None:
+ """Get multicast filtering capability from mcast_addr add and check for testpmd error code.
+
+ Args:
+ supported_capabilities: Supported capabilities will be added to this set.
+ unsupported_capabilities: Unsupported capabilities will be added to this set.
+ """
+ self._logger.debug("Getting mcast filter capabilities.")
+ command = f"mcast_addr add {self.ports[0].id} 01:00:5E:00:00:00"
+ output = self.send_command(command)
+ if "diag=-95" in output:
+ unsupported_capabilities.add(NicCapability.MCAST_FILTERING)
+ else:
+ supported_capabilities.add(NicCapability.MCAST_FILTERING)
+ command = str.replace(command, "add", "remove", 1)
+ self.send_command(command)
+
class NicCapability(NoAliasEnum):
"""A mapping between capability names and the associated :class:`TestPmdShell` methods.
@@ -2219,6 +2240,10 @@ class NicCapability(NoAliasEnum):
FLOW_SHARED_OBJECT_KEEP: TestPmdShellCapabilityMethod = functools.partial(
TestPmdShell.get_capabilities_show_port_info
)
+ #: Device supports multicast address filtering.
+ MCAST_FILTERING: TestPmdShellCapabilityMethod = functools.partial(
+ TestPmdShell.get_capabilities_mcast_filtering
+ )
def __call__(
self,