All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libiptc.c blob parser
@ 2006-06-24  4:52 Paul C. Diem
  2006-06-24 12:06 ` Jesper Dangaard Brouer
  0 siblings, 1 reply; 6+ messages in thread
From: Paul C. Diem @ 2006-06-24  4:52 UTC (permalink / raw)
  To: netfilter-devel

We have about 30,000 mangle table rules in about 8,000 chains. iptc_init
takes about 10 seconds just to load and parse the table. The problem is the
second parse phase that iterates through every chain and every rule
searching for the offset of the target for every jump rule.

I've applied the following small patch that loads the offset of the chain
entry into the comefrom field of the first rule ipt entry in each
user-defined chain in the first pass. This comefrom field is then used in
the second pass to easily locate the target chain. This minor change has
reduced the load time of our mangle table to 1 second.

Paul C. Diem
PCDiem@FoxValley.net

309a310,314
> /*+PCD
> * Modification to use the offset to the chain entry in the ipt
> * entry comefrom field as loaded by iptcc_find_chain_by_offset.
> */
> #if 0
319a325,329
> #else
> 	STRUCT_ENTRY * e = ((STRUCT_ENTRY *)((char *)handle->entries->entrytable
+ offset));
> 	return (struct chain_head *)((char *)e + e->comefrom);
> #endif
> /*-PCD*/
496a507,512
> /*+PCD
> * Load the offset to the chain entry relative to the
> * ipt entry into the ipt entry comefrom field.
> */
> 		e->comefrom = (char *)h->chains.prev - (char *)e;
> /*-PCD*/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-07-15 20:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-24  4:52 [PATCH] libiptc.c blob parser Paul C. Diem
2006-06-24 12:06 ` Jesper Dangaard Brouer
2006-06-24 15:57   ` Paul C. Diem
2006-06-24 21:09   ` Paul C. Diem
2006-07-07  4:21     ` Patrick McHardy
2006-07-15 20:11       ` Paul C. Diem

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.