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 1/3] dts: fix adjust L2/L3 addresses behavior
Date: Fri, 8 Nov 2024 17:01:36 +0000 [thread overview]
Message-ID: <20241108170138.203096-2-luca.vizzarro@arm.com> (raw)
In-Reply-To: <20241108170138.203096-1-luca.vizzarro@arm.com>
The _adjust_addresses function has been updated to both modify the
original packets and return new updated copies of them. Having a double
behavior even if documented is not intuitive and can lead to bugs.
This changes the behavior to solely act on copies, leaving the original
packet untouched.
Fixes: 1a1825962777 ("dts: rework packet addressing")
Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
dts/framework/test_suite.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
index fb5d646ce3..5b3e7c205e 100644
--- a/dts/framework/test_suite.py
+++ b/dts/framework/test_suite.py
@@ -324,8 +324,7 @@ def get_expected_packet(self, packet: Packet) -> Packet:
def _adjust_addresses(self, packets: list[Packet], expected: bool = False) -> list[Packet]:
"""L2 and L3 address additions in both directions.
- Packets in `packets` will be directly modified in this method. The returned list of packets
- however will be copies of the modified packets.
+ Copies of `packets` will be made, modified and returned in this method.
Only missing addresses are added to packets, existing addresses will not be overridden. If
any packet in `packets` has multiple IP layers (using GRE, for example) only the inner-most
@@ -343,7 +342,9 @@ def _adjust_addresses(self, packets: list[Packet], expected: bool = False) -> li
A list containing copies of all packets in `packets` after modification.
"""
ret_packets = []
- for packet in packets:
+ for original_packet in packets:
+ packet = original_packet.copy()
+
# update l2 addresses
# If `expected` is :data:`True`, the packet enters the TG from SUT, otherwise the
# packet leaves the TG towards the SUT.
--
2.43.0
next prev parent reply other threads:[~2024-11-08 17:01 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 ` Luca Vizzarro [this message]
2024-11-08 17:01 ` [PATCH v3 2/3] dts: allow to get multiple expected packets Luca Vizzarro
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-2-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).