public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, jamal <hadi@cyberus.ca>,
	Tom Herbert <therbert@google.com>
Subject: [PATCH net-next-2.6] net: Increase NET_SKB_PAD to 64 bytes
Date: Wed, 05 May 2010 07:24:09 +0200	[thread overview]
Message-ID: <1273037049.2304.7.camel@edumazet-laptop> (raw)

eth_type_trans() & get_rps_cpus() currently need two 64bytes cache lines
in packet to compute rxhash.

Increasing NET_SKB_PAD from 32 to 64 reduces the need to one cache line
only, and makes RPS faster.

NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 746a652..fe5798b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1356,9 +1356,12 @@ static inline int skb_network_offset(const struct sk_buff *skb)
  *
  * Various parts of the networking layer expect at least 32 bytes of
  * headroom, you should not reduce this.
+ * With RPS, we raised NET_SKB_PAD to 64 so that get_rps_cpus() fetches span
+ * a 64 bytes aligned block to fit modern (>= 64 bytes) cache line sizes
+ * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
  */
 #ifndef NET_SKB_PAD
-#define NET_SKB_PAD	32
+#define NET_SKB_PAD	64
 #endif
 
 extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);



             reply	other threads:[~2010-05-05  5:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05  5:24 Eric Dumazet [this message]
2010-05-07  5:02 ` [PATCH net-next-2.6] net: Increase NET_SKB_PAD to 64 bytes David Miller
2010-05-07  5:15   ` Eric Dumazet
2010-05-07  5:28     ` [microblaze-uclinux] " John Williams
2010-05-07  6:29       ` David Miller
2010-05-07  7:53     ` Michal Simek
2010-05-07  8:32       ` David Miller
2010-05-07  9:02         ` Michal Simek
2010-05-07  9:48         ` Michal Simek
2010-05-07  9:55           ` Eric Dumazet
2010-05-07 10:09             ` Michal Simek
2010-05-07 10:27               ` Eric Dumazet
2010-05-07  9:56           ` 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=1273037049.2304.7.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=hadi@cyberus.ca \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.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