From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Ayuso Subject: Re: Chain Sorting Date: Sun, 16 Jul 2006 15:43:32 +0200 Message-ID: <44BA4284.9010604@netfilter.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: netfilter-devel@lists.netfilter.org Return-path: To: "Paul C. Diem" In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org Paul C. Diem wrote: > In my quest to speed up the TC_INIT, I found that the libiptc.c searches the > chain list for the alphabetically correct place to insert chains as it > converts from the blob to the chain list. However, when adding a new chain > in TC_CREATE_CHAIN, it simply adds the new chain to the end of the list. > > This leaves the chains unsorted when written back to the kernel and uses > lots of cycles when loading. I patched libiptc.c to simply add chains to the > end of the list when loading and use iptc_insert_chain in TC_CREATE_CHAIN to > insert newly created chains into the proper order. My > TC_INIT time with 4106 chains went from about 1.09 real seconds to about > 0.05 real seconds. This seems interesting, please, could send post the patch? -- The dawn of the fourth age of Linux firewalling is coming; a time of great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris