Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1682217 > unrolled thread

[PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()

Started byLin Zhang <xiaolou4617@gmail.com>
First post2017-07-06 11:10 +0200
Last post2017-07-06 11:50 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail() Lin Zhang <xiaolou4617@gmail.com> - 2017-07-06 11:10 +0200
    Re: [PATCH net-next] skbuff: optimize the pull_pages code in  __pskb_pull_tail() Eric Dumazet <eric.dumazet@gmail.com> - 2017-07-06 11:20 +0200
      Re: [PATCH net-next] skbuff: optimize the pull_pages code in  __pskb_pull_tail() Eric Dumazet <eric.dumazet@gmail.com> - 2017-07-06 11:30 +0200
        Re: [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail() lin zhang <xiaolou4617@gmail.com> - 2017-07-06 11:40 +0200
          Re: [PATCH net-next] skbuff: optimize the pull_pages code in  __pskb_pull_tail() Eric Dumazet <eric.dumazet@gmail.com> - 2017-07-06 11:50 +0200

#1682217 — [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()

FromLin Zhang <xiaolou4617@gmail.com>
Date2017-07-06 11:10 +0200
Subject[PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()
Message-ID<u0aXo-2hr-27@gated-at.bofh.it>
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.8.3.1

[toc] | [next] | [standalone]


#1682236 — Re: [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()

FromEric Dumazet <eric.dumazet@gmail.com>
Date2017-07-06 11:20 +0200
SubjectRe: [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()
Message-ID<u0b74-2ls-39@gated-at.bofh.it>
In reply to#1682217
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 ???

[toc] | [prev] | [next] | [standalone]


#1682244 — Re: [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()

FromEric Dumazet <eric.dumazet@gmail.com>
Date2017-07-06 11:30 +0200
SubjectRe: [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()
Message-ID<u0bgK-2oC-9@gated-at.bofh.it>
In reply to#1682236
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 ;)

[toc] | [prev] | [next] | [standalone]


#1682247

Fromlin zhang <xiaolou4617@gmail.com>
Date2017-07-06 11:40 +0200
Message-ID<u0bqp-2sh-1@gated-at.bofh.it>
In reply to#1682244
2017-07-06 17:23 GMT+08:00 Eric Dumazet <eric.dumazet@gmail.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 ;)
>
>
>
>
thanks, i am a newer, "net-next is closed" it means i need repost it
after net-next reopened?

regards
-- 
Lin Zhang

[toc] | [prev] | [next] | [standalone]


#1682275 — Re: [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()

FromEric Dumazet <eric.dumazet@gmail.com>
Date2017-07-06 11:50 +0200
SubjectRe: [PATCH net-next] skbuff: optimize the pull_pages code in __pskb_pull_tail()
Message-ID<u0bA7-2xi-39@gated-at.bofh.it>
In reply to#1682247
On Thu, 2017-07-06 at 17:35 +0800, lin zhang wrote:

> thanks, i am a newer, "net-next is closed" it means i need repost it
> after net-next reopened?

Yes, please read Documentation/networking/netdev-FAQ.txt for details.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web