[lkml]   [2003]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: skb_padto and small fragmented transmits
On Thu, 2003-02-06 at 03:58, David S. Miller wrote:

> skb_padto() only works on linear skb.

The result is always a linear skb. Given that skb_padto() takes into
account data_len (incorrectly, but still) and skb_pad() contains a
comment about non-linear skb always having zero tailroom, it certainly
looks like these were written with the attempt to work for non-linear

I fail to see how the statement "skb->len + skb->data_len" has any
usable meaning, or how it can be anything other than a bug.

The checksum issue I mentioned is not as clear. I haven't looked at all
the callers of skb_copy_expand() and copy_skb_header() to see what
effect copying ip_summed in one of those calls might have elsewhere.

> And if you look at all the drivers where it is used, they
> do not enable things like scatter-gather.

So because the problem is not currently exposed, it's acceptable for the
code to be incorrect?

-- Chris

diff -aur a/include/linux/skbuff.h b/include/linux/skbuff.h
--- a/include/linux/skbuff.h 2003-01-13 12:45:20.000000000 -0800
+++ b/include/linux/skbuff.h 2003-02-05 12:25:38.000000000 -0800
@@ -1102,7 +1102,7 @@

static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len)
- unsigned int size = skb->len + skb->data_len;
+ unsigned int size = skb->len;
if (likely(size >= len))
return skb;
return skb_pad(skb, len-size);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:33    [W:0.038 / U:8.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site