DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jeremy Spewock <jspewock@iol.unh.edu>
To: Dean Marx <dmarx@iol.unh.edu>
Cc: 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, juraj.linkes@pantheon.tech,
	dev@dpdk.org
Subject: Re: [PATCH v2 1/2] dts: add VXLAN port method to testpmd shell
Date: Wed, 4 Sep 2024 15:23:41 -0400	[thread overview]
Message-ID: <CAAA20UTvvvTNcUc-FEe3SFkz0AuULNQKRPX5bvMprT1zWT8nHg@mail.gmail.com> (raw)
In-Reply-To: <20240823202244.9184-2-dmarx@iol.unh.edu>

Just a few comments on doc-strings, otherwise:

Reviewed-by: Jeremy Spewock <jspewock@iol.unh.edu>

On Fri, Aug 23, 2024 at 4:22 PM Dean Marx <dmarx@iol.unh.edu> wrote:
>
> 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>
> ---
>  dts/framework/remote_session/testpmd_shell.py | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
> index 43e9f56517..00b75954ef 100644
> --- a/dts/framework/remote_session/testpmd_shell.py
> +++ b/dts/framework/remote_session/testpmd_shell.py
> @@ -806,6 +806,29 @@ def show_port_stats(self, port_id: int) -> TestPmdPortStats:
>
>          return TestPmdPortStats.parse(output)
>
> +    def rx_vxlan(self, vxlan_id: int, port_id: int, add: bool, verify: bool = True) -> None:
> +        """Add or remove vxlan id to filter list.

It might read better if you replaced "to" here with "to/from".

> +
> +        Args:
> +            vxlan_id: Number of VXLAN ID to add to port filter list.

This is a little nit-picky, but it might be worth removing "Number of"
here and replacing "add to" with "add to/remove from" so it is "VXLAN
ID to add to/remove from port filter list." just so that it reflects
that you can both add and remove using this method.

> +            port_id: Number of port to add VXLAN ID to.

For this line I might be in favor of simplifying it down to something
like "ID of the port to modify VXLAN filter of." That way it doesn't
need all the slashes to account for both adding and removing.

> +            add: 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 add 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-09-04 19:23 UTC|newest]

Thread overview: 8+ 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 [this message]
2024-08-23 20:22   ` [PATCH v2 2/2] dts: port over unified packet suite Dean Marx
2024-09-04 19:23     ` Jeremy Spewock

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=CAAA20UTvvvTNcUc-FEe3SFkz0AuULNQKRPX5bvMprT1zWT8nHg@mail.gmail.com \
    --to=jspewock@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=dmarx@iol.unh.edu \
    --cc=juraj.linkes@pantheon.tech \
    --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).