Message ID | 20090401091801.GA5970@ff.dom.local |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
On Wed, Apr 01, 2009 at 09:18:01AM +0000, Jarek Poplawski wrote: > > gso: Fix support for linear packets 2 > > The previous fix removed a check, which should be useful, only a bit > later, by skipping at least two similar checks and three useless > assignments in case a header is (still) copied. > > Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> > --- > > net/core/skbuff.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > index ce6356c..2123a92 100644 > --- a/net/core/skbuff.c > +++ b/net/core/skbuff.c > @@ -2594,6 +2594,8 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) > > skb_copy_from_linear_data_offset(skb, offset, > skb_put(nskb, hsize), hsize); > + if (pos >= offset + len) > + continue; > > while (pos < offset + len && i < nfrags) { > *frag = skb_shinfo(skb)->frags[i]; The common case (non-linear skb) is going to fail that check so I'm no sure if it's warranted. Thanks,
On Wed, Apr 01, 2009 at 05:24:57PM +0800, Herbert Xu wrote: > On Wed, Apr 01, 2009 at 09:18:01AM +0000, Jarek Poplawski wrote: > > > > gso: Fix support for linear packets 2 > > > > The previous fix removed a check, which should be useful, only a bit > > later, by skipping at least two similar checks and three useless > > assignments in case a header is (still) copied. > > > > Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> > > --- > > > > net/core/skbuff.c | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > > index ce6356c..2123a92 100644 > > --- a/net/core/skbuff.c > > +++ b/net/core/skbuff.c > > @@ -2594,6 +2594,8 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) > > > > skb_copy_from_linear_data_offset(skb, offset, > > skb_put(nskb, hsize), hsize); > > + if (pos >= offset + len) > > + continue; > > > > while (pos < offset + len && i < nfrags) { > > *frag = skb_shinfo(skb)->frags[i]; > > The common case (non-linear skb) is going to fail that check so > I'm no sure if it's warranted. I guess you mean non-linear skb with a header smaller than mtu? Well, if it's the most common case now, I agree. Thanks, Jarek P. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Apr 01, 2009 at 09:50:50AM +0000, Jarek Poplawski wrote: > > I guess you mean non-linear skb with a header smaller than mtu? Well, > if it's the most common case now, I agree. The common case is the path stemming from the TCP stack, where we always construct skb's with the entire payload in page frags, and only the header is placed in skb->data. Cheers,
On Wed, Apr 01, 2009 at 05:53:52PM +0800, Herbert Xu wrote: > On Wed, Apr 01, 2009 at 09:50:50AM +0000, Jarek Poplawski wrote: > > > > I guess you mean non-linear skb with a header smaller than mtu? Well, > > if it's the most common case now, I agree. > > The common case is the path stemming from the TCP stack, where > we always construct skb's with the entire payload in page frags, > and only the header is placed in skb->data. OK, then let's forget about this patch. Thanks for the explanation, Jarek P. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ce6356c..2123a92 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -2594,6 +2594,8 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) skb_copy_from_linear_data_offset(skb, offset, skb_put(nskb, hsize), hsize); + if (pos >= offset + len) + continue; while (pos < offset + len && i < nfrags) { *frag = skb_shinfo(skb)->frags[i];