DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] net: calculate checksums for packets with IPv4 options
Date: Tue, 6 Oct 2020 10:10:13 +0200	[thread overview]
Message-ID: <20201006081013.GE21395@platinum> (raw)
In-Reply-To: <20201005193945.19aebfb5@hermes.local>

On Mon, Oct 05, 2020 at 07:39:45PM -0700, Stephen Hemminger wrote:
> On Tue, 06 Oct 2020 00:55:19 +0200
> Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > On 9/1/20 12:47 PM, Michael Pfeiffer wrote:
> > > Currently, rte_ipv4_cksum() and rte_ipv4_udptcp_cksum() assume all IPv4
> > > headers have sizeof(struct rte_ipv4_hdr) bytes. This is not true for
> > > those (rare) packets with IPv4 options. Thus, both IPv4 and TCP/UDP
> > > checksums are calculated wrong.
> > >
> > > This patch fixes the issue by using the actual IPv4 header length from
> > > the packet's IHL field.
> > >
> > > Signed-off-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

> > > -       cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr));
> > > +       cksum = rte_raw_cksum(ipv4_hdr, (ipv4_hdr->version_ihl & 0xf) * 4);
> >
> > Truly naive questions:
> > - doesn't it deserve a static inline function rte_ipv4_hdr_len()?
>
> Makes sense to have that.

+1

However it could be in another patch: there are ~15 places where it
could be replaced in dpdk.

  reply	other threads:[~2020-10-06  8:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 11:32 [dpdk-dev] [PATCH] " Michael Pfeiffer
2020-08-29 11:43 ` Andrew Rybchenko
2020-09-01  9:47 ` [dpdk-dev] [PATCH v2] " Michael Pfeiffer
2020-09-07  7:48   ` Andrew Rybchenko
2020-10-05 22:55   ` Thomas Monjalon
2020-10-06  2:39     ` Stephen Hemminger
2020-10-06  8:10       ` Olivier Matz [this message]
2020-10-06  9:51         ` Michael Pfeiffer
2020-10-06 15:10         ` Thomas Monjalon

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=20201006081013.GE21395@platinum \
    --to=olivier.matz@6wind.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=michael.pfeiffer@tu-ilmenau.de \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).