Skip to content

Commit

Permalink
net: Always allocate at least 16 skb frags regardless of page size
Browse files Browse the repository at this point in the history
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

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Anton Blanchard authored and David S. Miller committed Mar 29, 2011
1 parent 4910ac6 commit a715dea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a715dea

Please sign in to comment.