Hi,

On 9/9/25 3:10 AM, chenyongchang via discuss wrote:
Hello, Thank you for your reply.
On Mon, 8 Sept 2025 at 10:43, chenyongchang via discuss
<[email protected]> wrote:
 >>
 >>   Hi all,
>>  I noticed an issue when recalculating UDP checksums in dp_packet_ol_send_prepare -> packet_udp_complete_csum -> csum_finish.
 > Avoid sending the same mail multiple times.

Sorry about the mistake, I’ll make sure to avoid it in the future.
 >>
>>   If the packet is the first fragment of a UDP fragmented packet, the checksum can be wrong.
 >> Example:
 >> UDP payload 2000 bytes, fragmented with MTU 1500.
 >> First fragment payload 1480 bytes, but udp->udp_len = 2008.
 >> Checksum calculation cannot access later fragments, so it’s incorrect.
 >>
>>  Has anyone seen this before or have a recommended solution for handling UDP checksum on fragmented packets?
 > This report is a bit low on details.
 > I'll assume you are talking about the main branch.
 > There was a fix recently, you can have a look at: 3ffb1c4012b7 ("ipf:
 > Complete l4 checksum before frag out.").
 > If this does not help, does reverting e36793e11fe8 ("dp-packet:
 > Resolve unknown checksums.") fix your issue?
 > And we will need a reproducer.

Yes, we are debugging based on the main branch.
These two fixes are not related to this issue.

We are using OVS-DPDK with Intel 82599 or X710 NICs (neither of which supports NETDEV_TX_OFFLOAD_OUTER_UDP_CKSUM). The packet flow is as follows: a packet enters through a physical NIC managed by OVS-DPDK, then OVS-DPDK performs NAT (only modifying the destination address), encapsulates it into a Geneve tunnel, and finally sends it out through another physical NIC managed by OVS-DPDK.

If OVS-DPDK receives a fragmented UDP packet, after performing NAT it needs to recalculate the UDP checksum. The issue described above occurs during this checksum recalculation.

I'll just throw it out there since Erlon has been working on another UDP fragmentation issue involving stateful ACLs, but not sure if it will help in your case.

https://patchwork.ozlabs.org/project/ovn/patch/[email protected]/

-Brian


The detailed debugging steps are as follows:
gdb) bt
#0  packet_udp_complete_csum (p=0x7fa8db453900, inner=true) at lib/ packets.c:2092 #1  0x00000000016ce823 in dp_packet_ol_send_prepare (p=0x7fa8db453900, flags=128) at lib/dp-packet.c:618 #2  0x0000000001734933 in netdev_send (netdev=0x17f3e7840, qid=23, batch=0x7fa8db43b030, concurrent_txq=false) at lib/netdev.c:940 #3  0x00000000016dcbb8 in dp_netdev_pmd_flush_output_on_port (pmd=0x7fa8dc3ff680, p=0x7fa8db43b000) at lib/dpif-netdev.c:5578 #4  0x00000000016dcdb2 in dp_netdev_pmd_flush_output_packets (pmd=0x7fa8dc3ff680, force=false) at lib/dpif-netdev.c:5619 #5  0x00000000016dd044 in dp_netdev_process_rxq_port (pmd=0x7fa8dc3ff680, rxq=0x7fa911b15790, port_no=5) at lib/dpif- netdev.c:5678 #6  0x00000000016e16ca in pmd_thread_main (f_=0x7fa8dc3ff680) at lib/ dpif-netdev.c:7306 #7  0x00000000017ba1e1 in ovsthread_wrapper (aux_=0x7fa911a30fa0) at lib/ovs-thread.c:429
#8  0x00007fa91288e802 in start_thread () from /lib64/libc.so.6
#9  0x00007fa91282e450 in clone3 () from /lib64/libc.so.6
(gdb) p udp_sz
$7 = 1480
(gdb) p /x *udp
$8 = {udp_src = 0xe803, udp_dst = 0xe803, udp_len = 0xd807, udp_csum = 0xd1f6}
(gdb) p /x udp->udp_csum
$9 = 0xd1f6
(gdb) c
Continuing.


Best regards

    *From:* David Marchand <mailto:[email protected]>
    *Date:* 2025-09-08 17:03
    *To:* chenyongchang <mailto:[email protected]>
    *CC:* ovs-discuss <mailto:[email protected]>
    *Subject:* Re: [ovs-discuss] UDP checksum issue on first fragment of
    fragmented packets


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

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

Reply via email to