DPDK patches and discussions
 help / color / mirror / Atom feed
From: Patrick Robb <probb@iol.unh.edu>
To: jspewock@iol.unh.edu
Cc: wathsala.vithanage@arm.com, paul.szczepanek@arm.com,
	thomas@monjalon.net,  yoan.picchi@foss.arm.com,
	Luca.Vizzarro@arm.com, npratte@iol.unh.edu,
	 Honnappa.Nagarahalli@arm.com, alex.chapman@arm.com,
	 juraj.linkes@pantheon.tech, dev@dpdk.org
Subject: Re: [PATCH v1 1/1] dts: add send_packets to test suites and rework packet addressing
Date: Thu, 12 Sep 2024 08:35:29 -0400	[thread overview]
Message-ID: <CAJvnSUD3RDPQ0Xkwm+3psHt61DqQbTvBikcxuq3Gxf+8OyDDuQ@mail.gmail.com> (raw)
In-Reply-To: <20240904152827.11914-2-jspewock@iol.unh.edu>

This looks good, except for the fact that a method for sending a list
of packets has been added since you submitted this patch (which does
return the packet list, not that it matters for your application).

So, this will need to be resubmitted with your patch reformatted for
_adjust_addresses() to be used by luca's send_packet_and_capture ->
send_packets_and_capture approach which is now in the framework.

On Wed, Sep 4, 2024 at 11:28 AM <jspewock@iol.unh.edu> wrote:
>
> From: Jeremy Spewock <jspewock@iol.unh.edu>
>
> Currently the only method provided in the test suite class for sending
> packets sends a single packet and then captures the results. There is,
> in some cases, a need to send multiple packets at once while not really
> needing to capture any traffic received back. The method to do this
> exists in the traffic generator already, but this patch exposes the
> method to test suites.
>
> This patch also updates the _adjust_addresses method of test suites so
> that addresses of packets are only modified if the developer did not
> configure them beforehand. This allows for developers to have more
> control over the content of their packets when sending them through the
> framework.
>
> Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
> ---
>  dts/framework/test_suite.py            | 87 +++++++++++++++++++-------
>  dts/framework/testbed_model/tg_node.py |  9 +++
>  2 files changed, 75 insertions(+), 21 deletions(-)
>
> diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
> index 694b2eba65..11aaa0a93a 100644
> --- a/dts/framework/test_suite.py
> +++ b/dts/framework/test_suite.py
> @@ -199,7 +199,7 @@ def send_packet_and_capture(
>          Returns:
>              A list of received packets.
>          """
> -        packet = self._adjust_addresses(packet)
> +        packet = self._adjust_addresses([packet])[0]
>          return self.tg_node.send_packet_and_capture(
>              packet,
>              self._tg_port_egress,
> @@ -208,6 +208,18 @@ def send_packet_and_capture(
>              duration,
>          )
>
> +    def send_packets(
> +        self,
> +        packets: list[Packet],
> +    ) -> None:
> +        """Send packets using the traffic generator and do not capture received traffic.
> +
> +        Args:
> +            packets: Packets to send.
> +        """
> +        packets = self._adjust_addresses(packets)
> +        self.tg_node.send_packets(packets, self._tg_port_egress)
> +
>      def get_expected_packet(self, packet: Packet) -> Packet:
>          """Inject the proper L2/L3 addresses into `packet`.
>
> @@ -217,41 +229,74 @@ def get_expected_packet(self, packet: Packet) -> Packet:
>          Returns:
>              `packet` with injected L2/L3 addresses.
>          """
> -        return self._adjust_addresses(packet, expected=True)
> +        return self._adjust_addresses([packet], expected=True)[0]
>
> -    def _adjust_addresses(self, packet: Packet, expected: bool = False) -> Packet:
> +    def _adjust_addresses(self, packets: list[Packet], expected: bool = False) -> list[Packet]:
>          """L2 and L3 address additions in both directions.

^Just confirming again I think this implementation is fine, the patch
just needs to be reformatted to work on top of the new
testsuite/tgnode pktgen methods. Cheers.

  parent reply	other threads:[~2024-09-12 12:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04 15:28 [PATCH v1 0/1] dts: adjust packet addressing and sending jspewock
2024-09-04 15:28 ` [PATCH v1 1/1] dts: add send_packets to test suites and rework packet addressing jspewock
2024-09-09 19:43   ` Dean Marx
2024-09-12 12:35   ` Patrick Robb [this message]
2024-09-20 18:08 ` [PATCH v2 0/1] dts: adjust packet addressing and sending jspewock
2024-09-20 18:08   ` [PATCH v2 1/1] dts: add send_packets to test suites and rework packet addressing jspewock
2024-09-24 14:30     ` Juraj Linkeš
2024-09-25 16:09       ` Jeremy Spewock
2024-09-26  7:52         ` Juraj Linkeš
2024-09-26 10:13         ` Juraj Linkeš
2024-09-25 18:21 ` [PATCH v3 0/1] dts: adjust " jspewock
2024-09-25 18:21   ` [PATCH v3 1/1] dts: rework " jspewock
2024-09-26 12:30     ` Juraj Linkeš
2024-09-26 17:02       ` Jeremy Spewock
2024-09-26 18:06 ` [PATCH v4 0/1] dts: adjust " jspewock
2024-09-26 18:06   ` [PATCH v4 1/1] dts: rework " jspewock
2024-09-26 18:18 ` [PATCH v5 0/2] dts: adjust packet addressing and add send_packets to test_suite jspewock
2024-09-26 18:18   ` [PATCH v5 1/2] dts: rework packet addressing jspewock
2024-09-27  9:46     ` Juraj Linkeš
2024-09-27 11:46     ` Luca Vizzarro
2024-09-26 18:18   ` [PATCH v5 2/2] dts: add send_packets to test_suite jspewock
2024-09-27 11:46     ` Luca Vizzarro
2024-09-30 13:40   ` [PATCH v5 0/2] dts: adjust packet addressing and " Juraj Linkeš

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=CAJvnSUD3RDPQ0Xkwm+3psHt61DqQbTvBikcxuq3Gxf+8OyDDuQ@mail.gmail.com \
    --to=probb@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=alex.chapman@arm.com \
    --cc=dev@dpdk.org \
    --cc=jspewock@iol.unh.edu \
    --cc=juraj.linkes@pantheon.tech \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=thomas@monjalon.net \
    --cc=wathsala.vithanage@arm.com \
    --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).