[v4,1/2] dts: add stop ports decorator for VLAN functions

Message ID 20250109180124.1678253-1-paul.szczepanek@arm.com (mailing list archive)
State Accepted
Delegated to: Paul Szczepanek
Headers
Series [v4,1/2] dts: add stop ports decorator for VLAN functions |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Paul Szczepanek Jan. 9, 2025, 6:01 p.m. UTC
Testpmd functions manipulating the VLAN options require
the ports to be stopped when applying changes.

Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
 dts/framework/remote_session/testpmd_shell.py | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Luca Vizzarro Jan. 10, 2025, 11:26 a.m. UTC | #1
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
  

Patch

diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index c01ee74b21..aa55bd91d3 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -1909,6 +1909,7 @@  def extract_verbose_output(output: str) -> list[TestPmdVerbosePacket]:
             out.append(TestPmdVerbosePacket.parse(f"{prev_header}\n{match.group('PACKET')}"))
         return out
 
+    @requires_stopped_ports
     def set_vlan_filter(self, port: int, enable: bool, verify: bool = True) -> None:
         """Set vlan filter on.
 
@@ -1935,6 +1936,7 @@  def set_vlan_filter(self, port: int, enable: bool, verify: bool = True) -> None:
                     filter on port {port}"""
                 )
 
+    @requires_stopped_ports
     def rx_vlan(self, vlan: int, port: int, add: bool, verify: bool = True) -> None:
         """Add specified vlan tag to the filter list on a port. Requires vlan filter to be on.
 
@@ -1964,6 +1966,7 @@  def rx_vlan(self, vlan: int, port: int, add: bool, verify: bool = True) -> None:
                     f"Testpmd failed to {'add' if add else 'remove'} tag {vlan} on port {port}."
                 )
 
+    @requires_stopped_ports
     def set_vlan_strip(self, port: int, enable: bool, verify: bool = True) -> None:
         """Enable or disable vlan stripping on the specified port.