Message ID | 1324632922.7877.103.camel@zakaz.uk.xensource.com |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
> -#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 Wouldn't it be better to only have the expression once? Either using a MAX() define or maybe: #define MAX_SKB_FRAGS (65536UL/PAGE_SIZE + 1) #if MAX_SKB_FRAGS < 16UL #undef MAX_SKB_FRAGS #define MAX_SKB_FRAGS 16UL #endif Although that replicates the 16 instead :-( David -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fe86488..0592b3d 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;