Commit 9d4dde52 authored by Ian Campbell's avatar Ian Campbell Committed by David S. Miller

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: default avatarIan Campbell <ian.campbell@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f87ce5b2
...@@ -128,13 +128,17 @@ struct sk_buff_head { ...@@ -128,13 +128,17 @@ struct sk_buff_head {
struct sk_buff; struct sk_buff;
/* To allow 64K frame to be packed as single skb without frag_list. Since /* To allow 64K frame to be packed as single skb without frag_list we
* GRO uses frags we allocate at least 16 regardless of page size. * 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 #define MAX_SKB_FRAGS 16UL
#else #else
#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2) #define MAX_SKB_FRAGS (65536/PAGE_SIZE + 1)
#endif #endif
typedef struct skb_frag_struct skb_frag_t; typedef struct skb_frag_struct skb_frag_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment