DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dean Marx <dmarx@iol.unh.edu>
To: probb@iol.unh.edu, npratte@iol.unh.edu, luca.vizzarro@arm.com,
	yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com,
	paul.szczepanek@arm.com
Cc: dev@dpdk.org, Dean Marx <dmarx@iol.unh.edu>,
	Jeremy Spewock <jspewock@iol.unh.edu>
Subject: [PATCH v3 1/2] dts: add VXLAN port method to testpmd shell
Date: Mon, 14 Oct 2024 17:08:56 -0400	[thread overview]
Message-ID: <20241014210857.31436-2-dmarx@iol.unh.edu> (raw)
In-Reply-To: <20241014210857.31436-1-dmarx@iol.unh.edu>

Add rx_vxlan_port add/rm method to testpmd shell for adding
or removing a vxlan id to the specified port filter list.

Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
Reviewed-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
 dts/framework/remote_session/testpmd_shell.py | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index 16b41a7814..f3238e6b6d 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -1943,6 +1943,27 @@ def set_verbose(self, level: int, verify: bool = True) -> None:
                     f"Testpmd failed to set verbose level to {level}."
                 )
 
+    def rx_vxlan(self, vxlan_id: int, port_id: int, enable: bool, verify: bool = True) -> None:
+        """Add or remove vxlan id to/from filter list.
+
+        Args:
+            vxlan_id: VXLAN ID to add to port filter list.
+            port_id: ID of the port to modify VXLAN filter of.
+            enable: If :data:`True`, adds specified VXLAN ID, otherwise removes it.
+            verify: If :data:`True`, the output of the command is checked to verify
+                the VXLAN ID was successfully added/removed from the port.
+
+        Raises:
+            InteractiveCommandExecutionError: If `verify` is :data:`True` and VXLAN ID
+                is not successfully added or removed.
+        """
+        action = "add" if enable else "rm"
+        vxlan_output = self.send_command(f"rx_vxlan_port {action} {vxlan_id} {port_id}")
+        if verify:
+            if "udp tunneling add error" in vxlan_output:
+                self._logger.debug(f"Failed to set VXLAN:\n{vxlan_output}")
+                raise InteractiveCommandExecutionError(f"Failed to set VXLAN:\n{vxlan_output}")
+
     def _close(self) -> None:
         """Overrides :meth:`~.interactive_shell.close`."""
         self.stop()
-- 
2.44.0


  reply	other threads:[~2024-10-14 21:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23 19:34 [PATCH v1 0/2] dts: port over unified packet type suite Dean Marx
2024-08-23 19:34 ` [PATCH v1 1/2] dts: add VXLAN port method to testpmd shell Dean Marx
2024-08-23 19:34 ` [PATCH v1 2/2] dts: port over unified packet suite Dean Marx
2024-08-23 20:22 ` [PATCH v2 0/2] dts: port over unified packet type suite Dean Marx
2024-08-23 20:22   ` [PATCH v2 1/2] dts: add VXLAN port method to testpmd shell Dean Marx
2024-09-04 19:23     ` Jeremy Spewock
2024-08-23 20:22   ` [PATCH v2 2/2] dts: port over unified packet suite Dean Marx
2024-09-04 19:23     ` Jeremy Spewock
2024-10-14 21:08   ` [PATCH v3 0/2] dts: port over unified packet type suite Dean Marx
2024-10-14 21:08     ` Dean Marx [this message]
2024-10-14 21:08     ` [PATCH v3 2/2] dts: port over unified packet suite Dean Marx

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241014210857.31436-2-dmarx@iol.unh.edu \
    --to=dmarx@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=jspewock@iol.unh.edu \
    --cc=luca.vizzarro@arm.com \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=yoan.picchi@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).