Skip to content

Commit

Permalink
[NET]: Reduce size of sk_buff by 4 bytes
Browse files Browse the repository at this point in the history
Reduce local_df to a bit field and ip_summed to a 2 bits
field thus saving 13 bits. Move bit fields, packet type,
and protocol into the spare area between the priority
and the destructor. Saves 4 bytes on both, 32bit and
64bit architectures.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Graf authored and David S. Miller committed Jul 5, 2005
1 parent e176fe8 commit 1cbb338
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,18 @@ struct sk_buff {
data_len,
mac_len,
csum;
unsigned char local_df,
cloned:1,
nohdr:1,
pkt_type,
ip_summed;
__u32 priority;
unsigned short protocol;
__u8 local_df:1,
cloned:1,
ip_summed:2,
nohdr:1;
/* 3 bits spare */
__u8 pkt_type;
__u16 protocol;

void (*destructor)(struct sk_buff *skb);
#ifdef CONFIG_NETFILTER
unsigned long nfmark;
unsigned long nfmark;
__u32 nfcache;
__u32 nfctinfo;
struct nf_conntrack *nfct;
Expand Down

0 comments on commit 1cbb338

Please sign in to comment.