netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Leech <christopher.leech@intel.com>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: skb_padto and small fragmented transmits
Date: 06 Feb 2003 11:22:51 -0800	[thread overview]
Message-ID: <1044559370.4620.36.camel@localhost.localdomain> (raw)
In-Reply-To: <BD9B60A108C4D511AAA10002A50708F20BA2AAD1@orsmsx118.jf.intel.com>

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
buffers.

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);

       reply	other threads:[~2003-02-06 19:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BD9B60A108C4D511AAA10002A50708F20BA2AAD1@orsmsx118.jf.intel.com>
2003-02-06 19:22 ` Chris Leech [this message]
2003-02-06 18:44   ` skb_padto and small fragmented transmits David S. Miller
     [not found] <BD9B60A108C4D511AAA10002A50708F20BA2AAE3@orsmsx118.jf.intel.com>
2003-02-06 19:22 ` Chris Leech
2003-02-06 22:43   ` David S. Miller
2003-02-07 13:33     ` Alan Cox
2003-02-08  8:53       ` David S. Miller
2003-02-05 21:39 Chris Leech
2003-02-06 11:58 ` David S. Miller

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=1044559370.4620.36.camel@localhost.localdomain \
    --to=christopher.leech@intel.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).