netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: blaschka@linux.vnet.ibm.com
Cc: netdev@vger.kernel.org
Subject: Re: TX pre-headers...
Date: Sat, 07 Feb 2009 00:10:41 -0800 (PST)	[thread overview]
Message-ID: <20090207.001041.146584084.davem@davemloft.net> (raw)
In-Reply-To: <498C26C5.7010003@linux.vnet.ibm.com>

From: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Date: Fri, 06 Feb 2009 13:02:13 +0100

> Absolutely yes, this would help the s/390 qeth drivers too

Well, I did some research and it seems all of the cases we could
actually solve with such a scheme need at a maximum 32 bytes.

We already ensure 16 bytes, via NET_SKB_PAD.

So instead of all of this complex "who has the largest TX header size
and what is it" code, we can simply increase NET_SKB_PAD to 32.

You still need that headroom check there, simply because tunneling and
other device stacking situations can cause the headroom to be depleted
before your device sees the packet.

Any objections? :-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 08670d0..5eba400 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1287,7 +1287,7 @@ static inline int skb_network_offset(const struct sk_buff *skb)
  * The networking layer reserves some headroom in skb data (via
  * dev_alloc_skb). This is used to avoid having to reallocate skb data when
  * the header has to grow. In the default case, if the header has to grow
- * 16 bytes or less we avoid the reallocation.
+ * 32 bytes or less we avoid the reallocation.
  *
  * Unfortunately this headroom changes the DMA alignment of the resulting
  * network packet. As for NET_IP_ALIGN, this unaligned DMA is expensive
@@ -1295,11 +1295,11 @@ static inline int skb_network_offset(const struct sk_buff *skb)
  * perhaps setting it to a cacheline in size (since that will maintain
  * cacheline alignment of the DMA). It must be a power of 2.
  *
- * Various parts of the networking layer expect at least 16 bytes of
+ * Various parts of the networking layer expect at least 32 bytes of
  * headroom, you should not reduce this.
  */
 #ifndef NET_SKB_PAD
-#define NET_SKB_PAD	16
+#define NET_SKB_PAD	32
 #endif
 
 extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);

  reply	other threads:[~2009-02-07  8:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06  9:41 TX pre-headers David Miller
2009-02-06 10:46 ` Steve.Glendinning
2009-02-06 11:11   ` David Miller
2009-02-06 18:53   ` Inaky Perez-Gonzalez
2009-02-06 12:02 ` Frank Blaschka
2009-02-07  8:10   ` David Miller [this message]
2009-02-09  3:34     ` David Miller
2009-02-09 10:07 ` Herbert Xu
2009-02-09 10:14   ` David Miller
2009-02-09 10:19     ` Herbert Xu
2009-02-09 15:39       ` Krzysztof Halasa
2009-02-10  8:15         ` David 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=20090207.001041.146584084.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=blaschka@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    /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).