diff options
author | Ian Campbell <Ian.Campbell@citrix.com> | 2011-12-22 23:39:14 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-23 16:51:18 -0500 |
commit | 9d4dde5215779f4099730194ad30624fdba3d8b2 (patch) | |
tree | 5f0faa91f3359f3335f9063ebb1246db29c8289a /include/linux/skbuff.h | |
parent | f87ce5b254d4eb5b5ec2bfcc78d714fa0e249288 (diff) |
net: only use a single page of slop in MAX_SKB_FRAGS
In order to accommodate a 64K buffer we need 64K/PAGE_SIZE plus one more page
in order to allow for a buffer which does not start on a page boundary.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 12e6fed73f8..f47f0c3939f 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -128,13 +128,17 @@ struct sk_buff_head { struct sk_buff; -/* 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. +/* To allow 64K frame to be packed as single skb without frag_list we + * require 64K/PAGE_SIZE pages plus 1 additional page to allow for + * buffers which do not start on a page boundary. + * + * Since GRO uses frags we allocate at least 16 regardless of page + * size. */ -#if (65536/PAGE_SIZE + 2) < 16 +#if (65536/PAGE_SIZE + 1) < 16 #define MAX_SKB_FRAGS 16UL #else -#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2) +#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 1) #endif typedef struct skb_frag_struct skb_frag_t; |