On 10/20/2018 7:30 AM, Shyam Shrivastav wrote: > Yes you are right, I misread, following code (ipv4 case) assumes no ip > options while calculating pseudo hdr length field > > psd_hdr.len = rte_cpu_to_be_16( > (uint16_t)(rte_be_to_cpu_16(ipv4_hdr->total_length) > - sizeof(struct ipv4_hdr))); > > should be > > psd_hdr.len = rte_cpu_to_be_16( > (uint16_t)(rte_be_to_cpu_16(ipv4_hdr->total_length) > - (ipv4_hdr->version_ihl & 0x0f)*4)));
cc'ed maintainer of the that part, Olivier. > > On Sat, Oct 20, 2018 at 11:44 AM lidejun <[email protected]> wrote: > >> I mean DPDK APIs do not exclude ipv4 options or ipv6 extension headers, it >> is bug? >> >> >> >> *发件人:* Shyam Shrivastav [mailto:[email protected]] >> *发送时间:* 2018年10月20日 13:23 >> *收件人:* lidejun <[email protected]> >> *抄送:* users <[email protected]>; [email protected]; Lichunhe (Cloud Networking) < >> [email protected]>; Wangliefeng <[email protected]> >> *主题:* Re: [dpdk-dev] IPV4/IPV6 TCP/UDP Pseudo Header Checksum APIs >> >> >> >> Realized my answer is confusing, I meant to say that code is correct as >> pseudo ipv4/ipv6 headers for the purpose of checksum calculations doesn't >> include options or extension headers, see udp wiki or corresponding rfcs >> >> >> >> https://en.wikipedia.org/wiki/User_Datagram_Protocol >> >> >> >> On Sat, Oct 20, 2018 at 10:42 AM Shyam Shrivastav < >> [email protected]> wrote: >> >> that is correct , pseudo header doesn't include ipv4 options or ipv6 >> extension headers .. >> >> >> >> On Sat, Oct 20, 2018 at 9:02 AM lidejun <[email protected]> wrote: >> >> Has anybody used the following two APIs calculating ipv4&ipv6 tcp/udp >> pseudo header checksum? >> >> 1. rte_ipv4_phdr_cksum >> >> 2. rte_ipv6_phdr_cksum >> The ipv4 version does not exclude ip options and ipv6 version does not >> exclude extersion headers. >> >>

