From: Paul Szczepanek <paul.szczepanek@arm.com>
To: dev@dpdk.org
Cc: probb@iol.unh.edu, Paul Szczepanek <paul.szczepanek@arm.com>,
Thomas Wilks <thomas.wilks@arm.com>
Subject: [PATCH v2 1/2] dts: allow expected packets to come from the TG
Date: Tue, 31 Dec 2024 11:31:15 +0000 [thread overview]
Message-ID: <20241231113116.1510537-1-paul.szczepanek@arm.com> (raw)
In-Reply-To: <20241231112413.1509989-1-paul.szczepanek@arm.com>
Add sent_from_tg variable to get_expected_packets
for when packets are sent from the TG.
Signed-off-by: Thomas Wilks <thomas.wilks@arm.com>
Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
dts/framework/test_suite.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
index adee01f031..69b24fd126 100644
--- a/dts/framework/test_suite.py
+++ b/dts/framework/test_suite.py
@@ -274,31 +274,41 @@ 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]:
+ def get_expected_packets(
+ self,
+ packets: list[Packet],
+ sent_from_tg: bool = False,
+ ) -> 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.
+ sent_from_tg: True if packet was sent from the TG.
Returns:
`packets` with injected L2/L3 addresses.
"""
- return self._adjust_addresses(packets, expected=True)
+ return self._adjust_addresses(packets, not sent_from_tg)
- def get_expected_packet(self, packet: Packet) -> Packet:
+ def get_expected_packet(
+ self,
+ packet: Packet,
+ sent_from_tg: bool = False,
+ ) -> 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.
+ sent_from_tg: True if packet was sent from the TG.
Returns:
`packet` with injected L2/L3 addresses.
"""
- return self.get_expected_packets([packet])[0]
+ return self.get_expected_packets([packet], sent_from_tg)[0]
def _adjust_addresses(self, packets: list[Packet], expected: bool = False) -> list[Packet]:
"""L2 and L3 address additions in both directions.
--
2.39.2
next prev parent reply other threads:[~2024-12-31 11:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-31 11:24 [PATCH v1 " Paul Szczepanek
2024-12-31 11:24 ` [PATCH v1 2/2] dts: add softnic test Paul Szczepanek
2024-12-31 11:31 ` Paul Szczepanek [this message]
2024-12-31 11:31 ` [PATCH v2 " Paul Szczepanek
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=20241231113116.1510537-1-paul.szczepanek@arm.com \
--to=paul.szczepanek@arm.com \
--cc=dev@dpdk.org \
--cc=probb@iol.unh.edu \
--cc=thomas.wilks@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).