[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1279815854.2467.112.camel@edumazet-laptop>
Date: Thu, 22 Jul 2010 18:24:14 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jan Engelhardt <jengelh@...ozas.de>
Cc: Patrick McHardy <kaber@...sh.net>,
Netfilter Development Mailinglist
<netfilter-devel@...r.kernel.org>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH nf-next-2.6] netfilter: add xt_cpu match
Le jeudi 22 juillet 2010 à 17:39 +0200, Jan Engelhardt a écrit :
> Never say never. "long" already bit people in the past, and now we
> have that CONFIG_COMPAT stuff.
>
I know pretty well the "long" problem, I received one of the first alpha
machine ever built in the world (DEC 3000 AXP, with a fast 133 MHz
cpu ;) ), before I began to use Linux :)
> If invert is the only flag, perhaps it makes sense to use __u8
> for it.
>
Quite frankly it brings more problems than plain u32
- Possible security problems (padding bytes). Not applicable to
iptables.
- Some arches have slow byte/short accesses (21064 for example :) )
"int" is the natural type, fast on all arches.
- Given alignment requirements of iptables rules, using less than 32bits
here saves no ram.
But I dont care that much.
I even see compiler doesnt want to use a XOR instruction :
00000018 <cpu_mt>:
18: 55 push %ebp
19: 8b 42 04 mov 0x4(%edx),%eax
1c: 64 8b 15 00 00 00 00 mov %fs:0x0,%edx
23: 89 e5 mov %esp,%ebp
25: 5d pop %ebp
26: 39 10 cmp %edx,(%eax)
28: 0f 94 c2 sete %dl
2b: 0f b6 d2 movzbl %dl,%edx
2e: 3b 50 04 cmp 0x4(%eax),%edx
31: 0f 95 c0 setne %al
34: c3 ret
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists