From: Marat Khalili <marat.khalili@huawei.com>
To: Su Sai <susai.ss@bytedance.com>,
"jasvinder.singh@intel.com" <jasvinder.singh@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [External] RE: [PATCH] net/cksum: compute raw cksum for several segments
Date: Thu, 31 Jul 2025 11:43:02 +0000 [thread overview]
Message-ID: <72a691f5888e4fcfa0d30769404fdef5@huawei.com> (raw)
In-Reply-To: <CABsP7wPvp1VFJ2+5VVp5o+Ne38CGbTX6-ftFWJG1N6kH0-sr3w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2622 bytes --]
> -----Original Message-----
> From: Su Sai <susai.ss@bytedance.com>
> Sent: Thursday 31 July 2025 12:32
> To: Marat Khalili <marat.khalili@huawei.com>; jasvinder.singh@intel.com
> Cc: dev@dpdk.org
> Subject: Re: [External] RE: [PATCH] net/cksum: compute raw cksum for several segments
>
> Hi Marat Khalili,
>
> Thanks for your comments.
>
> We found small TCP checksum errors pkts online, then were traced to issues within the rte_raw_cksum_mbuf function.
>
> This error can be reproduced as follows:
> 1. In the client ECS with an MTU of 1500, initiate traffic using the command "iperf3 -c {dst ip} -b 1m -M 125 -t 8000".
> 2. In the destination ECS, the InCsumErrors statistic can be viewed using the command "netstat -st | grep -i csum". The erroneous packets can also be confirmed via the tcpdump command.
>
> The following is a detailed description of a captured erroneous packet. The hex stream of the packet is as follows:
> 00163e0b6bd2eeffffffffff0800450000a50d7a40004006b94bc0a8f91dc0a8f91ed5d2145146f9d990e10d6a2d8010020040a200000101080a95ac86ba091145d3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
>
> This is a packet in the format of eth + ipv4 + tcp + payload.
>
> The process leading to the error is as follows:
> 1. Due to the small MSS, TSO fragmentation was triggered, generating 3 mbufs.
> 2. The data_len of the first mbuf is 66 bytes, containing the Ethernet header, IPv4 header, and TCP header.
> 3. The data_len of the second mbuf is 61 bytes.
> 4. The data_len of the third mbuf is 52 bytes.
> 5. When calculating the checksum of the TCP header for such an mbuf chain using the rte_raw_cksum_mbuf function, the tmp value obtained during the calculation of the third mbuf is 0x19FFE6.
> 6. After applying rte_bswap16, tmp becomes 0xE6FF, with 0x19 discarded. This results in an incorrect final checksum.
>
> Meanwhile, we have also found that when enable jumbo frame, the payload becomes longer. In the process of rte_raw_cksum_mbuf handling an mbuf chain,due to the relatively large value of tmp, overflow will occur in the accumulated sum.
Thanks for the detailed description. I think both the bug and the fix are valid. Adding automated tests reproducing scenarios you described to app/test would help a lot, but I don’t know if you have cycles for this (I heard that AI is moderately good in generating test cases these days). I will ack your patch and let’s see what others say.
[-- Attachment #2: Type: text/html, Size: 5594 bytes --]
next prev parent reply other threads:[~2025-07-31 11:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 9:55 苏赛
2025-07-31 10:51 ` Marat Khalili
2025-07-31 11:03 ` Marat Khalili
2025-07-31 11:31 ` [External] " Su Sai
2025-07-31 11:43 ` Marat Khalili [this message]
2025-07-31 11:46 ` Marat Khalili
2025-07-31 12:22 ` zhoumin
2025-08-01 7:26 ` Su Sai
2025-08-01 15:28 ` [v2] " Su Sai
2025-08-01 16:39 ` Marat Khalili
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=72a691f5888e4fcfa0d30769404fdef5@huawei.com \
--to=marat.khalili@huawei.com \
--cc=dev@dpdk.org \
--cc=jasvinder.singh@intel.com \
--cc=susai.ss@bytedance.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).