DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: Jeremy Spewock <jspewock@iol.unh.edu>
Cc: paul.szczepanek@arm.com, Honnappa.Nagarahalli@arm.com,
	probb@iol.unh.edu,  alex.chapman@arm.com, thomas@monjalon.net,
	Luca.Vizzarro@arm.com, npratte@iol.unh.edu,
	yoan.picchi@foss.arm.com, wathsala.vithanage@arm.com,
	dev@dpdk.org
Subject: Re: [PATCH v2 1/1] dts: add send_packets to test suites and rework packet addressing
Date: Thu, 26 Sep 2024 12:13:15 +0200	[thread overview]
Message-ID: <c5771964-1ff1-46e7-b4be-db55684efc61@pantheon.tech> (raw)
In-Reply-To: <CAAA20UShw9ESNUG6dj1bH6LuLj459dwHQLQsme-Q3ApQJb8jEw@mail.gmail.com>


>>> diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py
>>
>>> @@ -243,41 +255,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.
>>>
>>> +        Packets in `packets` will be directly modified in this method. The returned list of packets
>>> +        however will be copies of the modified packets in order to keep the two lists distinct.
>>> +
>>
>> Do we need to do this? I guess you needed this in a test suite - what is
>> the reason?
> 
> This is actually just me documenting something that was already
> happening behind the scenes in this method that I thought would be
> helpful for people to know. Right now this method ends in
> `Ether(packet.build())` which essentially just copies the packet, but
> it does so after the modifications were made. I think there is some
> logical reason to do this

Ah, ok, this only documents what already existed. I think this was here 
because packet.build() doesn't return a Packet so a conversion is 
needed. The intention is not to keep the two lists distinct.

> which is this method is called internally in
> the framework, so it allows the send methods where these packets are
> used to essentially modify the list and do whatever they want to/need
> to to get the packets sent

There are two usages for this method:
1. To update the packet before it's sent out (so that the proper 
addresses are used),
2. To update a packet, constructed in a test case, that we expect to 
receive, so as to compare with actual received packets. This is used in 
the OS UDP test case which checks that the MAC addresses are updated 
properly (and IP addresses stay the same).

> and the only change that is reflected on
> the user is the addresses are added.
> 


  parent reply	other threads:[~2024-09-26 10:13 UTC|newest]

Thread overview: 22+ 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
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š [this message]
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

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=c5771964-1ff1-46e7-b4be-db55684efc61@pantheon.tech \
    --to=juraj.linkes@pantheon.tech \
    --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=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --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).