On 9/9/25 4:14 PM, David Marchand wrote:
> On Tue, 9 Sept 2025 at 15:52, Mike Pattrick <[email protected]> wrote:
>>
>> On Fri, Aug 29, 2025 at 5:37 AM David Marchand <[email protected]> 
>> wrote:
>>>
>>> TSO packets were incorrectly treated as too big by the check_pkt_len
>>> action with the userspace datapath.
>>> Adjust the check by looking at the requested segment size.
>>>
>>> Fixes: 29cf9c1b3b9c ("userspace: Add TCP Segmentation Offload support")
>>> Reported-at: https://issues.redhat.com/browse/FDP-1631
>>> Signed-off-by: David Marchand <[email protected]>
>>> ---
>>>  lib/odp-execute.c    | 17 ++++++++++++++
>>>  tests/dpif-netdev.at | 56 ++++++++++++++++++++++++++++++++++++++++++++
>>>  2 files changed, 73 insertions(+)
>>>
>>> diff --git a/lib/odp-execute.c b/lib/odp-execute.c
>>> index 649f8e99a5..486b70c039 100644
>>> --- a/lib/odp-execute.c
>>> +++ b/lib/odp-execute.c
>>> @@ -797,6 +797,23 @@ odp_execute_check_pkt_len(void *dp, struct dp_packet 
>>> *packet, bool steal,
>>>      uint32_t size = dp_packet_get_send_len(packet)
>>>                      - dp_packet_l2_pad_size(packet);
>>>
>>> +    if (dp_packet_get_tso_segsz(packet)) {
>>> +        const void *payload;
>>> +        uint32_t segsize;
>>> +
>>> +        if (dp_packet_tunnel(packet)) {
>>> +            payload = dp_packet_get_inner_tcp_payload(packet);
>>> +        } else {
>>> +            payload = dp_packet_get_tcp_payload(packet);
>>> +        }
>>> +        /* Evaluate a segment maximum length for this TSO packet. */
>>> +        segsize = (char *)payload - (char *)dp_packet_data(packet)
>>> +                  + dp_packet_get_tso_segsz(packet);
>>>
>>> +        if (segsize < size) {
>>> +            size = segsize;
>>> +        }
>>> +    }
>>
>>
>> Should this be moved to dp_packet_get_send_len?
> 
> I don't think it is a good idea, or at least this would need more changes.
> Reporting a correct sending length is one thing, but the caller needs
> to be aware that (sw) segmentation is needed.

It's a little questionable if the cutlen should be accounted in this
action at all, the behavior seems inconsistent across implementations.
So, I guess, keeping the code where it is in this patch should be fine
for now.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to