* [PATCH v1] dts: fix multicast set function in testpmd shell
@ 2025-01-16 19:33 Dean Marx
0 siblings, 0 replies; only message in thread
From: Dean Marx @ 2025-01-16 19:33 UTC (permalink / raw)
To: probb, npratte, luca.vizzarro, yoan.picchi, Honnappa.Nagarahalli,
paul.szczepanek
Cc: dev, Dean Marx
Fixes verification method in multicast set function by changing
the stats capture to use show_port_info_all(). This way, the
method will continue to work even after DTS lifts the restriction
on port topologies.
Fixes: abf8a3bc793b ("dts: add multicast set function to shell")
Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
dts/framework/remote_session/testpmd_shell.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index d25952e2fa..37cd981264 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -1795,7 +1795,7 @@ def show_port_stats(self, port_id: int) -> TestPmdPortStats:
return TestPmdPortStats.parse(output)
- def set_multicast_all(self, on: bool, verify: bool = True):
+ def set_multicast_all(self, on: bool, verify: bool = True) -> None:
"""Turns multicast mode on/off for the specified port.
Args:
@@ -1809,9 +1809,8 @@ def set_multicast_all(self, on: bool, verify: bool = True):
"""
multicast_cmd_output = self.send_command(f"set allmulti all {'on' if on else 'off'}")
if verify:
- stats0 = self.show_port_info(port_id=0)
- stats1 = self.show_port_info(port_id=1)
- if on ^ (stats0.is_allmulticast_mode_enabled and stats1.is_allmulticast_mode_enabled):
+ port_stats = self.show_port_info_all()
+ if on ^ all(stats.is_allmulticast_mode_enabled for stats in port_stats):
self._logger.debug(
f"Failed to set multicast mode on all ports.: \n{multicast_cmd_output}"
)
--
2.44.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-01-16 19:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-16 19:33 [PATCH v1] dts: fix multicast set function in testpmd shell Dean Marx
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).