On 20 Jan 2026, at 21:55, Ilya Maximets wrote:

> On 1/20/26 11:17 AM, Eelco Chaudron wrote:
>> Add the '--len' option to 'ovs-ofctl compose-packet', which
>> allows extension of the generated packet.
>>
>> Fixes: 90b6e83beb60 ("tests: Fix NSH decap header test for real Ethernet 
>> devices.")
>> Signed-off-by: Eelco Chaudron <[email protected]>
>> ---
>> v2: Use packet_expand() so packet length and checksums get
>>     updated.
>>
>>  tests/system-traffic.at |  4 ++--
>>  utilities/ovs-ofctl.c   | 30 +++++++++++++++++++++++++++---
>>  2 files changed, 29 insertions(+), 5 deletions(-)
>>
>> diff --git a/tests/system-traffic.at b/tests/system-traffic.at
>> index 8f4fdf8b1..71a8afff2 100644
>> --- a/tests/system-traffic.at
>> +++ b/tests/system-traffic.at
>> @@ -9996,12 +9996,12 @@ dnl Send the NSH packet with TCP SYN payload from 
>> p0(at_ns0) interface directed
>>  dnl to p1(at_ns1) interface.
>>  NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \
>>      "$(ovs-ofctl compose-packet --bare 'NSH_HEADER')" \
>> -    "$(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT')"],
>> +    "$(ovs-ofctl compose-packet --len 64 --bare 'TCP_SYN_PKT')"],
>>    [0], [ignore])
>>
>>  dnl Check the expected de-capsulated TCP packet on the egress interface
>>  OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q \
>> -    "^$(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT')0*\$"])
>> +    "^$(ovs-ofctl compose-packet --len 64 --bare 'TCP_SYN_PKT')\$"])
>
> Hrm.  More I look at this, more I think we don't need the new option.
> The 'compose-packet' already adds 64 bytes of payload to normal packets,
> having an extra --len option feels a little awkward.  It doesn't add them
> here, because it's a SYN packet that is not supposed to carry extra data.
> The hardware returns some l2 padding, which is not part of the actual
> packet, so it is fine.
>
> What we can do is either:
>
> 1. Keep everything as is - maybe add a comment that there is a possibility
>    for extra l2 padding in case of running with a real hardware.
>
> 2. Remove the SYN flag and let the TCP packet have the 64 bytes of payload
>    this way.

I do not really have a preference. Maybe 1 and add a comment? For two, people 
might wonder why we do not simulate using a tcp setup packet?

Let me know, and I’ll send a patch adding the comment (although the commit 
message already has it).

//Eelco

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to