aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2005-08-09 22:24:19 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:31:04 -0400
commit6869c4d8e066e21623c812c448a05f1ed931c9c6 (patch)
treece18efc459e121e3a0b1bf5f85615567cdb30f68 /net/core/skbuff.c
parentbf3a46aa9b96f6eb3a49a568f72a2801c3e830c0 (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 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7eab867ede59..096991cb09d9 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -361,7 +361,6 @@ struct sk_buff *skb_clone(struct sk_buff *skb, unsigned int __nocast gfp_mask)
361 n->destructor = NULL; 361 n->destructor = NULL;
362#ifdef CONFIG_NETFILTER 362#ifdef CONFIG_NETFILTER
363 C(nfmark); 363 C(nfmark);
364 C(nfcache);
365 C(nfct); 364 C(nfct);
366 nf_conntrack_get(skb->nfct); 365 nf_conntrack_get(skb->nfct);
367 C(nfctinfo); 366 C(nfctinfo);
@@ -424,7 +423,6 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
424 new->destructor = NULL; 423 new->destructor = NULL;
425#ifdef CONFIG_NETFILTER 424#ifdef CONFIG_NETFILTER
426 new->nfmark = old->nfmark; 425 new->nfmark = old->nfmark;
427 new->nfcache = old->nfcache;
428 new->nfct = old->nfct; 426 new->nfct = old->nfct;
429 nf_conntrack_get(old->nfct); 427 nf_conntrack_get(old->nfct);
430 new->nfctinfo = old->nfctinfo; 428 new->nfctinfo = old->nfctinfo;