On 02/04/2023 19:18, Willem de Bruijn wrote: > On Fri, Mar 31, 2023 at 10:31 PM Fei Cheng <chenwei.0515@xxxxxxxxxxxxx> wrote: >> >> From: "chenwei.0515" <chenwei.0515@xxxxxxxxxxxxx> >> >> If vxlan-dev enable tx csum offload, there are two case of CHECKSUM_PARTIAL, >> but udp->check donot have the both meanings. >> >> 1. vxlan-dev disable tx csum offload, udp->check is just pseudo hdr. >> 2. vxlan-dev enable tx csum offload, udp->check is pseudo hdr and >> csum from outter l4 to innner l4. >> >> Unfortunately if there is a nat process after vxlan tx,udp_manip_pkt just use >> CSUM_PARTIAL to re csum PKT, which is just right on vxlan tx csum disable offload. In case 1 csum_start should point to the (outer) UDP header, whereas in case 2 csum_start should point to the inner L4 header (because in the normal TX path w/o NAT, nothing else will ever need to touch the outer csum after this point). > The issue is that for encapsulated traffic with local checksum offload, > netfilter incorrectly recomputes the outer UDP checksum as if it is an > unencapsulated CHECKSUM_PARTIAL packet, correct? So if netfilter sees a packet with CHECKSUM_PARTIAL whose csum_start doesn't point to the header nf NAT is editing, that's exactly the case where it needs to use lco_csum to calculate the new outer sum. No? -ed PS. Fei, your emails aren't reaching the netdev mailing list, probably because you're sending as HTML. Please switch to plain text.