All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: David Laight <David.Laight@aculab.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 2/2] net: optimize skb_postpull_rcsum()
Date: Thu, 25 Nov 2021 05:32:23 -0800	[thread overview]
Message-ID: <CANn89i+HmN3DbfAtH+Uq_pBWYHXp5ioH8LyhGRAiHZhRLbs1nw@mail.gmail.com> (raw)
In-Reply-To: <06864387ba644a58816ab3a82a8b5f82@AcuMS.aculab.com>

On Thu, Nov 25, 2021 at 1:41 AM David Laight <David.Laight@aculab.com> wrote:
>
> From: Eric Dumazet
> > Sent: 24 November 2021 20:25
> >
> > From: Eric Dumazet <edumazet@google.com>
> >
> > Remove one pair of add/adc instructions and their dependency
> > against carry flag.
> >
> > We can leverage third argument to csum_partial():
> >
> >   X = csum_block_sub(X, csum_partial(start, len, 0), 0);
> >
> >   -->
> >
> >   X = csum_block_add(X, ~csum_partial(start, len, 0), 0);
> >
> >   -->
> >
> >   X = ~csum_partial(start, len, ~X);
>
> That doesn't seem to refer to the change in this file.
>

It is describing the change.

The first step, of copying first the __skb_postpull_rcsum(skb, start,
len, 0) content
into __skb_postpull_rcsum() was kind of obvious.



>         David
>
> >
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > ---
> >  include/linux/skbuff.h | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> > index eba256af64a577b458998845f2dc01a5ec80745a..eae4bd3237a41cc1b60b44c91fbfe21dfdd8f117 100644
> > --- a/include/linux/skbuff.h
> > +++ b/include/linux/skbuff.h
> > @@ -3485,7 +3485,11 @@ __skb_postpull_rcsum(struct sk_buff *skb, const void *start, unsigned int len,
> >  static inline void skb_postpull_rcsum(struct sk_buff *skb,
> >                                     const void *start, unsigned int len)
> >  {
> > -     __skb_postpull_rcsum(skb, start, len, 0);
> > +     if (skb->ip_summed == CHECKSUM_COMPLETE)
> > +             skb->csum = ~csum_partial(start, len, ~skb->csum);
> > +     else if (skb->ip_summed == CHECKSUM_PARTIAL &&
> > +              skb_checksum_start_offset(skb) < 0)
> > +             skb->ip_summed = CHECKSUM_NONE;
> >  }
> >
> >  static __always_inline void
> > --
> > 2.34.0.rc2.393.gf8c9666880-goog
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>

  reply	other threads:[~2021-11-25 13:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 20:24 [PATCH net-next 0/2] net: small csum optimizations Eric Dumazet
2021-11-24 20:24 ` [PATCH net-next 1/2] gro: optimize skb_gro_postpull_rcsum() Eric Dumazet
2021-11-24 20:24 ` [PATCH net-next 2/2] net: optimize skb_postpull_rcsum() Eric Dumazet
2021-11-25  9:41   ` David Laight
2021-11-25 13:32     ` Eric Dumazet [this message]
2021-11-25 14:29       ` David Laight
2021-12-02 13:10   ` Vladimir Oltean
2021-12-02 14:51     ` Eric Dumazet
2021-12-02 16:29       ` Vladimir Oltean
2021-12-02 19:32         ` Eric Dumazet
2021-12-02 20:37           ` Eric Dumazet
2021-12-02 21:07             ` Vladimir Oltean
2021-12-02 20:40           ` Vladimir Oltean
2021-12-02 20:58             ` Vladimir Oltean
2021-12-02 20:58             ` David Laight
2021-12-02 21:40               ` Vladimir Oltean
2021-12-03 14:51                 ` David Laight
2021-12-03 14:57                 ` David Laight
2021-12-03 16:14                   ` Vladimir Oltean
2021-12-03 16:30                     ` Eric Dumazet
2021-12-03 16:47                       ` David Laight
2021-12-03 16:58                         ` Eric Dumazet
2021-12-03 17:41                           ` David Laight
2021-12-02 15:06     ` David Laight
2021-12-02 15:22       ` Eric Dumazet
2021-11-26  5:20 ` [PATCH net-next 0/2] net: small csum optimizations patchwork-bot+netdevbpf

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=CANn89i+HmN3DbfAtH+Uq_pBWYHXp5ioH8LyhGRAiHZhRLbs1nw@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=David.Laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.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.