summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-09-23 07:06:54 +0200
committerDavid S. Miller <davem@davemloft.net>2010-09-27 03:31:13 +0200
commitcb4dfe562cac6fcb544df752e40c1d78000d0712 (patch)
treea256abb0ecbfb4c1909563274ee9e7d0138b1b16
parentnet: propagate NETIF_F_HIGHDMA to vlans (diff)
downloadlinux-cb4dfe562cac6fcb544df752e40c1d78000d0712.tar.xz
linux-cb4dfe562cac6fcb544df752e40c1d78000d0712.zip
net: skb_frag_t can be smaller on small arches
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>
-rw-r--r--include/linux/skbuff.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index b2c41d19735c..0b53c43ac92e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -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