Skip to content

Commit

Permalink
net: skb_frag_t can be smaller on small arches
Browse files Browse the repository at this point in the history
On 32bit arches, if PAGE_SIZE is smaller than 65536, we can use 16bit
offset and size fields. This patch saves 72 bytes per skb on i386, or
128 bytes after rounding.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 27, 2010
1 parent c5256c5 commit cb4dfe5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,13 @@ typedef struct skb_frag_struct skb_frag_t;

struct skb_frag_struct {
struct page *page;
#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
__u32 page_offset;
__u32 size;
#else
__u16 page_offset;
__u16 size;
#endif
};

#define HAVE_HW_TIME_STAMP
Expand Down

0 comments on commit cb4dfe5

Please sign in to comment.