DPDK patches and discussions
 help / color / mirror / Atom feed
From: Luca Vizzarro <luca.vizzarro@arm.com>
To: dev@dpdk.org
Cc: Paul Szczepanek <paul.szczepanek@arm.com>,
	Patrick Robb <probb@iol.unh.edu>,
	Luca Vizzarro <luca.vizzarro@arm.com>
Subject: [PATCH v3 2/3] dts: allow to get multiple expected packets
Date: Fri,  8 Nov 2024 17:01:37 +0000	[thread overview]
Message-ID: <20241108170138.203096-3-luca.vizzarro@arm.com> (raw)
In-Reply-To: <20241108170138.203096-1-luca.vizzarro@arm.com>

At the moment there is only one facility that allows to prepare a packet
as it is expected to be received on the traffic generator end. Extend
this to allow to prepare multiple packets at the same time.

Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
 dts/framework/test_suite.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
index 5b3e7c205e..23fe41a10e 100644
--- a/dts/framework/test_suite.py
+++ b/dts/framework/test_suite.py
@@ -310,16 +310,31 @@ def send_packets(
         packets = self._adjust_addresses(packets)
         self.tg_node.send_packets(packets, self._tg_port_egress)
 
+    def get_expected_packets(self, packets: list[Packet]) -> list[Packet]:
+        """Inject the proper L2/L3 addresses into `packets`.
+
+        Inject the L2/L3 addresses expected at the receiving end of the traffic generator.
+
+        Args:
+            packets: The packets to modify.
+
+        Returns:
+            `packets` with injected L2/L3 addresses.
+        """
+        return self._adjust_addresses(packets, expected=True)
+
     def get_expected_packet(self, packet: Packet) -> Packet:
         """Inject the proper L2/L3 addresses into `packet`.
 
+        Inject the L2/L3 addresses expected at the receiving end of the traffic generator.
+
         Args:
             packet: The packet to modify.
 
         Returns:
             `packet` with injected L2/L3 addresses.
         """
-        return self._adjust_addresses([packet], expected=True)[0]
+        return self.get_expected_packet([packet])[0]
 
     def _adjust_addresses(self, packets: list[Packet], expected: bool = False) -> list[Packet]:
         """L2 and L3 address additions in both directions.
-- 
2.43.0


  parent reply	other threads:[~2024-11-08 17:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06 12:51 [PATCH] dts: add l2fwd test suite Luca Vizzarro
2024-08-09 15:27 ` Jeremy Spewock
2024-09-09 10:44   ` Luca Vizzarro
2024-09-04 18:11 ` Dean Marx
2024-09-09 15:05 ` Patrick Robb
2024-09-09 17:54 ` Nicholas Pratte
2024-10-30 15:03 ` [PATCH v2] " Thomas Wilks
2024-11-08 17:01 ` [PATCH v3 0/3] " Luca Vizzarro
2024-11-08 17:01   ` [PATCH v3 1/3] dts: fix adjust L2/L3 addresses behavior Luca Vizzarro
2024-11-08 17:01   ` Luca Vizzarro [this message]
2024-11-08 17:01   ` [PATCH v3 3/3] dts: add l2fwd test suite Luca Vizzarro

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=20241108170138.203096-3-luca.vizzarro@arm.com \
    --to=luca.vizzarro@arm.com \
    --cc=dev@dpdk.org \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    /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).