All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: "Panneman, J.J. (Jeffrey)" <jeffrey.panneman@tno.nl>
Cc: "xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>
Subject: Re: UDP checksum calculation
Date: Wed, 28 Jun 2017 11:18:11 +0200	[thread overview]
Message-ID: <59537453.6080407@iogearbox.net> (raw)
In-Reply-To: <7784F3C775469047B0E8C3B494DB28BEB1B143@EXC-MBX03.tsn.tno.nl>

On 06/28/2017 10:46 AM, Panneman, J.J. (Jeffrey) wrote:
> Hi All,
>
> I posted this question in the Cillium Slack too, but I figured posting it here might help other people too.
> I checked out the Cillium source(from what I see makes use of the provided tc-helpers: https://github.com/cilium/cilium/blob/master/bpf/lib/csum.h), but is there an appropriate way to do checksum (re)calculation for UDP with XDP ? Since it does not really like long loops that much and the payload possibly being quite long. I don't really see a way to loop over the payload to recalculate the checksum, would anyone perhaps have a code snippet for this ?

Depends on the use-case, are you rewriting also UDP payload
in XDP? If not, why is [1] not sufficient resp. a variant of
that which calcs the diff? csum_diff() could be an option, but
why not doing it in BPF itself?

   [1] http://lingrok.org/xref/linux-net-next/tools/testing/selftests/bpf/test_xdp.c#141

      reply	other threads:[~2017-06-28  9:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7784F3C775469047B0E8C3B494DB28BEB1B126@EXC-MBX03.tsn.tno.nl>
2017-06-28  8:46 ` UDP checksum calculation Panneman, J.J. (Jeffrey)
2017-06-28  9:18   ` Daniel Borkmann [this message]

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=59537453.6080407@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=jeffrey.panneman@tno.nl \
    --cc=xdp-newbies@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.