From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shyam Shrivastav Subject: Re: IPV4/IPV6 TCP/UDP Pseudo Header Checksum APIs Date: Sat, 20 Oct 2018 12:00:30 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: users , dev@dpdk.org, lichunhe@huawei.com, zhangxufeng4@huawei.com To: lidejun1@huawei.com Return-path: In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Yes you are right, I misread, following code (ipv4 case) assumes no ip options while calculating pseudo hdr length field psd_hdr.len =3D 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 =3D rte_cpu_to_be_16( (uint16_t)(rte_be_to_cpu_16(ipv4_hdr->total_length) - (ipv4_hdr->version_ihl & 0x0f)*4))); On Sat, Oct 20, 2018 at 11:44 AM lidejun wrote: > I mean DPDK APIs do not exclude ipv4 options or ipv6 extension headers, i= t > is bug? > > > > *=E5=8F=91=E4=BB=B6=E4=BA=BA:* Shyam Shrivastav [mailto:shrivastav.shyam@= gmail.com] > *=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4:* 2018=E5=B9=B410=E6=9C=8820=E6=97= =A5 13:23 > *=E6=94=B6=E4=BB=B6=E4=BA=BA:* lidejun > *=E6=8A=84=E9=80=81:* users ; dev@dpdk.org; Lichunhe (Clo= ud Networking) < > lichunhe@huawei.com>; Wangliefeng > *=E4=B8=BB=E9=A2=98:* Re: [dpdk-dev] IPV4/IPV6 TCP/UDP Pseudo Header Chec= ksum 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 < > shrivastav.shyam@gmail.com> 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 wrote: > > Has anybody used the following two APIs calculating ipv4&ipv6 tcp/udp > pseudo header checksum=EF=BC=9F > > 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. > >