From: Eric Dumazet Date: Mon, 4 Oct 2010 18:56:05 +0000 (+0200) Subject: netfilter: ipt_LOG: add bufferisation to call printk() once X-Git-Tag: v2.6.37-rc1~147^2~3^2~27 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8defca048fd11eb2d1a17ab61a60a856292dd4e;p=pandora-kernel.git netfilter: ipt_LOG: add bufferisation to call printk() once ipt_LOG & ip6t_LOG use lot of calls to printk() and use a lock in a hope several cpus wont mix their output in syslog. printk() being very expensive [1], its better to call it once, on a prebuilt and complete line. Also, with mixed IPv4 and IPv6 trafic, separate IPv4/IPv6 locks dont avoid garbage. I used an allocation of a 1024 bytes structure, sort of seq_printf() but with a fixed size limit. Use a static buffer if dynamic allocation failed. Emit a once time alert if buffer size happens to be too short. [1]: printk() has various features like printk_delay()... Signed-off-by: Eric Dumazet Signed-off-by: Patrick McHardy --- Reading git-diff-tree failed