mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Lin Zhang <xiaolou4617@gmail.com>
Cc: davem@davemloft.net, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()
Date: Thu, 06 Jul 2017 02:23:23 -0700	[thread overview]
Message-ID: <1499333003.16045.15.camel@edumazet-glaptop3.roam.corp.google.com> (raw)
In-Reply-To: <1499332587.16045.13.camel@edumazet-glaptop3.roam.corp.google.com>

On Thu, 2017-07-06 at 02:16 -0700, Eric Dumazet wrote:
> On Thu, 2017-07-06 at 17:01 +0800, Lin Zhang wrote:
> > In the pull_pages code block, if the first frags size > eat,
> > we can end the loop in advance to avoid extra copy.
> > 
> > Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
> > ---
> >  net/core/skbuff.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > index f990eb8..c00a1df 100644
> > --- a/net/core/skbuff.c
> > +++ b/net/core/skbuff.c
> > @@ -1720,6 +1720,10 @@ void *__pskb_pull_tail(struct sk_buff *skb, int delta)
> >  				skb_shinfo(skb)->frags[k].page_offset += eat;
> >  				skb_frag_size_sub(&skb_shinfo(skb)->frags[k], eat);
> >  				eat = 0;
> > +				if (!i) {
> > +					k = skb_shinfo(skb)->nr_frags;
> > +					break;
> > +				}
> >  			}
> >  			k++;
> >  		}
> 
> 1) net-next is closed during merge window.
> 
> 2) This change is completely buggy.
>    How have you tested it exactly ???

Hmm... it looks like I was wrong, but 1) still applies ;)

  reply	other threads:[~2017-07-06  9:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06  9:01 Lin Zhang
2017-07-06  9:16 ` Eric Dumazet
2017-07-06  9:23   ` Eric Dumazet [this message]
2017-07-06  9:35     ` lin zhang
2017-07-06  9:48       ` Eric Dumazet

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=1499333003.16045.15.camel@edumazet-glaptop3.roam.corp.google.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xiaolou4617@gmail.com \
    /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

all inboxes | Powered by JetHome®