diff options
author | Harald Welte <laforge@netfilter.org> | 2005-08-09 22:24:19 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:31:04 -0400 |
commit | 6869c4d8e066e21623c812c448a05f1ed931c9c6 (patch) | |
tree | ce18efc459e121e3a0b1bf5f85615567cdb30f68 /include/linux/skbuff.h | |
parent | bf3a46aa9b96f6eb3a49a568f72a2801c3e830c0 (diff) |
[NETFILTER]: reduce netfilter sk_buff enlargement
As discussed at netconf'05, we're trying to save every bit in sk_buff.
The patch below makes sk_buff 8 bytes smaller. I did some basic
testing on my notebook and it seems to work.
The only real in-tree user of nfcache was IPVS, who only needs a
single bit. Unfortunately I couldn't find some other free bit in
sk_buff to stuff that bit into, so I introduced a separate field for
them. Maybe the IPVS guys can resolve that to further save space.
Initially I wanted to shrink pkt_type to three bits (PACKET_HOST and
alike are only 6 values defined), but unfortunately the bluetooth code
overloads pkt_type :(
The conntrack-event-api (out-of-tree) uses nfcache, but Rusty just
came up with a way how to do it without any skb fields, so it's safe
to remove it.
- remove all never-implemented 'nfcache' code
- don't have ipvs code abuse 'nfcache' field. currently get's their own
compile-conditional skb->ipvs_property field. IPVS maintainers can
decide to move this bit elswhere, but nfcache needs to die.
- remove skb->nfcache field to save 4 bytes
- move skb->nfctinfo into three unused bits to save further 4 bytes
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2e40f4c9f7a6..4b929c3c1a98 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -190,7 +190,6 @@ struct skb_shared_info { | |||
190 | * @end: End pointer | 190 | * @end: End pointer |
191 | * @destructor: Destruct function | 191 | * @destructor: Destruct function |
192 | * @nfmark: Can be used for communication between hooks | 192 | * @nfmark: Can be used for communication between hooks |
193 | * @nfcache: Cache info | ||
194 | * @nfct: Associated connection, if any | 193 | * @nfct: Associated connection, if any |
195 | * @nfctinfo: Relationship of this skb to the connection | 194 | * @nfctinfo: Relationship of this skb to the connection |
196 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 195 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
@@ -252,17 +251,18 @@ struct sk_buff { | |||
252 | __u8 local_df:1, | 251 | __u8 local_df:1, |
253 | cloned:1, | 252 | cloned:1, |
254 | ip_summed:2, | 253 | ip_summed:2, |
255 | nohdr:1; | 254 | nohdr:1, |
256 | /* 3 bits spare */ | 255 | nfctinfo:3; |
257 | __u8 pkt_type; | 256 | __u8 pkt_type; |
258 | __be16 protocol; | 257 | __be16 protocol; |
259 | 258 | ||
260 | void (*destructor)(struct sk_buff *skb); | 259 | void (*destructor)(struct sk_buff *skb); |
261 | #ifdef CONFIG_NETFILTER | 260 | #ifdef CONFIG_NETFILTER |
262 | __u32 nfmark; | 261 | __u32 nfmark; |
263 | __u32 nfcache; | ||
264 | __u32 nfctinfo; | ||
265 | struct nf_conntrack *nfct; | 262 | struct nf_conntrack *nfct; |
263 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) | ||
264 | __u8 ipvs_property:1; | ||
265 | #endif | ||
266 | #ifdef CONFIG_BRIDGE_NETFILTER | 266 | #ifdef CONFIG_BRIDGE_NETFILTER |
267 | struct nf_bridge_info *nf_bridge; | 267 | struct nf_bridge_info *nf_bridge; |
268 | #endif | 268 | #endif |