Thread (42 messages) 42 messages, 5 authors, 2009-02-20

Re: [PATCH] netfilter: unfold two critical loops in ip_packet_match()

From: Patrick McHardy <hidden>
Date: 2009-02-18 16:52:26
Also in: netfilter-devel

Eric Dumazet wrote:
Patrick McHardy a écrit :
quoted
In case of IPv4 and IPv6 they are already suitable aligned, it
simply performing the comparison in unsigned long quantities.
struct arpt_arp unfortunately doesn't properly align the interface
names, so we need to continue to do byte-wise comparisons.
I see, but #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS can help here ;)
get_unaligned() would work as well I guess. But we don't seem to
have a get_unaligned_long().
ifname_compare() should be static in three files (ipv4_ip_tables, ipv6_ip_tables and arp_tables),
since only arp_tables variant has the alignement problem.

[PATCH] netfilter: unfold two critical loops in arp_packet_match()

x86 and powerpc can perform long word accesses in an efficient maner.
We can use this to unroll two loops in arp_packet_match(), to
perform arithmetic on long words instead of bytes. This is a win
on x86_64 for example.
This looks good to me. Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help