All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>, davem@davemloft.net
Cc: alexei.starovoitov@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] bpf: add skb_postpush_rcsum and fix dev_forward_skb occasions
Date: Thu, 07 Jan 2016 11:02:11 +0100	[thread overview]
Message-ID: <568E37A3.5070104@iogearbox.net> (raw)
In-Reply-To: <568DC506.6020200@stressinduktion.org>

On 01/07/2016 02:53 AM, Hannes Frederic Sowa wrote:
> On 07.01.2016 02:01, Daniel Borkmann wrote:
>> +static inline void skb_postpush_rcsum(struct sk_buff *skb,
>> +                      const void *start, unsigned int len)
>> +{
>> +    if (skb->ip_summed == CHECKSUM_COMPLETE)
>> +        skb->csum = csum_add(skb->csum, csum_partial(start, len, 0));
>
> skb->csum = csum_partial(start, len, skb->csum);
>
> should work without calling carry-add twice, no?

Hmm, indeed, seems you're right. Since the csum_partial() only covers
this particular fragment with feeding initial csum as 0, the result
from the do_csum() stays as is for the first part, and the csum_add()
does effectively the same as if we've fed skb->csum already into
csum_partial().

There are btw couple of other places where this generic helper could be
used as well.

  reply	other threads:[~2016-01-07 10:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07  1:01 [PATCH net-next] bpf: add skb_postpush_rcsum and fix dev_forward_skb occasions Daniel Borkmann
2016-01-07  1:53 ` Hannes Frederic Sowa
2016-01-07 10:02   ` Daniel Borkmann [this message]
2016-01-07  3:22 ` kbuild test robot
2016-01-07  9:05   ` Daniel Borkmann

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=568E37A3.5070104@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=alexei.starovoitov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@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.