From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by dpdk.org (Postfix) with ESMTP id DD21A239; Sat, 20 Oct 2018 08:30:48 +0200 (CEST) Received: by mail-wm1-f43.google.com with SMTP id o17-v6so4796406wmh.0; Fri, 19 Oct 2018 23:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aNbBiluigiNGvE/se5EPn6B9d+/kJ7+9HWyCcUQ4kRM=; b=TB1gB2k/HeuhaBPKxTn/iYHdVP6fteKuZ2raIkOD4CTIW84+q/Km/xvyhnH73WucIg nkq1vdKGEnPho99f9T2XP8z7+nvKxqmBLQZFby3GYHEEYiLQ4a2CXHdJjOybUL7ncgez GdtOwgejSQYmlXjDKXrpTXMGEyor5RtNKPJ2SzX2o3itlZ9o2VyeFCiLW+h7Ing09tbG XGZF2daqDnGmsqI+/lCxSoARYhxP/SQcdFHE6lhCt9FqNWc4pxghvSkhEyL2jTSQdwyi IOMdqPA8XdHjXqNBrAoV2BV47WaesE4fILtMY5cws60SyoCGRWHn8//hhl4wU7qrzBT8 DU/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aNbBiluigiNGvE/se5EPn6B9d+/kJ7+9HWyCcUQ4kRM=; b=GOperx3e2bKMZoHyCo68RTb781fKwADQ2GYrE+rXre+7qqpPYhuB3QeGQjK9CcENzP i9PqY6jy30ctCUwX0C12eLTTKlZHpkSTzlcryxysa0RikFoh0/UQqvmMXb/cOypyJc/J WBku2BoulAA52kz2ndu07zxTuvpNFlQpUo5bkxTsKyk6k0yOa2olosVmPjaWrHrOsDo1 sBFnkBdb0YIe85QEYNfoB7Hbx9Cw+3m3oE9HpySJecJxlqiJx64uqq2ZEwm39y4/INMi Zd0AD9asCQ+i8NILxgWaMl88JxvYyiau9JajXcAn4aReTmV6dM58qHpUI4EABu5PrszT qe+A== X-Gm-Message-State: ABuFfohjDNqY3aCBQJza9F9t/IO7h4omqKUmgDb90Hf5aBCYo6Y6onWm R2Z/c/Ol85erFAdlBpQWQmsxyfWIMrJPtXRsY/s= X-Google-Smtp-Source: AJdET5ciFflkzRhf7EfMrR9YEIq7u/ApVxfg3KAY0qJyVOArpqRbdO1VNKNiIZDQMOeKnfPPlFoTiFA5lELBMi7ld+E= X-Received: by 2002:a1c:7dce:: with SMTP id y197-v6mr8058749wmc.78.1540017048354; Fri, 19 Oct 2018 23:30:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shyam Shrivastav Date: Sat, 20 Oct 2018 12:00:30 +0530 Message-ID: To: lidejun1@huawei.com Cc: users , dev@dpdk.org, lichunhe@huawei.com, zhangxufeng4@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] IPV4/IPV6 TCP/UDP Pseudo Header Checksum APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2018 06:30:49 -0000 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. > >