From: Anton Blanchard <anton@samba.org>
To: davem@davemloft.net, eric.dumazet@gmail.com, herbert@gondor.apana.org.au
Cc: netdev@vger.kernel.org
Subject: [PATCH] net: Always allocate at least 16 skb frags regardless of page size
Date: Mon, 28 Mar 2011 11:57:26 +1100 [thread overview]
Message-ID: <20110328115726.4cca214d@kryten> (raw)
When analysing performance of the cxgb3 on a ppc64 box I noticed that
we weren't doing much GRO merging. It turns out we are limited by the
number of SKB frags:
#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2)
With a 4kB page size we have 18 frags, but with a 64kB page size we
only have 3 frags.
I ran a single stream TCP bandwidth test to compare the performance of
different values of MAX_SKB_FRAGS on the receiver:
MAX_SKB_FRAGS Mbps
3 7080
8 7931 (+12%)
16 8335 (+17%)
32 8349 (+17%)
Performance continues to increase up to 16 frags then levels off so
the patch below puts a lower bound of 16 on MAX_SKB_FRAGS.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: powerpc.git/include/linux/skbuff.h
===================================================================
--- powerpc.git.orig/include/linux/skbuff.h 2011-03-28 09:41:25.392124844 +1100
+++ powerpc.git/include/linux/skbuff.h 2011-03-28 10:18:58.253050000 +1100
@@ -122,8 +122,14 @@ struct sk_buff_head {
struct sk_buff;
-/* To allow 64K frame to be packed as single skb without frag_list */
+/* To allow 64K frame to be packed as single skb without frag_list. Since
+ * GRO uses frags we allocate at least 16 regardless of page size.
+ */
+#if (65536/PAGE_SIZE + 2) < 16
+#define MAX_SKB_FRAGS 16
+#else
#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2)
+#endif
typedef struct skb_frag_struct skb_frag_t;
next reply other threads:[~2011-03-28 0:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-28 0:57 Anton Blanchard [this message]
2011-03-29 5:27 ` [PATCH] net: Always allocate at least 16 skb frags regardless of page size 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=20110328115726.4cca214d@kryten \
--to=anton@samba.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=herbert@gondor.apana.org.au \
--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