DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] dts: fix multicast set function in testpmd shell
@ 2025-01-16 19:33 Dean Marx
  2025-01-24 12:00 ` Paul Szczepanek
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* Re: [PATCH v1] dts: fix multicast set function in testpmd shell
  2025-01-16 19:33 [PATCH v1] dts: fix multicast set function in testpmd shell Dean Marx
@ 2025-01-24 12:00 ` Paul Szczepanek
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Szczepanek @ 2025-01-24 12:00 UTC (permalink / raw)
  To: Dean Marx, probb, npratte, luca.vizzarro, yoan.picchi,
	Honnappa.Nagarahalli
  Cc: nd, dev



On 16/01/2025 19:33, Dean Marx wrote:
> 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}"
>                  )

Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-24 12:00 UTC | newest]

Thread overview: 2+ messages (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
2025-01-24 12:00 ` Paul Szczepanek

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).