Re: [PATCH nf-next-2.6] netfilter: add xt_cpu match

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Thursday, July 22, 2010 - 9:24 am

Le jeudi 22 juillet 2010 à 17:39 +0200, Jan Engelhardt a écrit :


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 :)



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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH nf-next-2.6] netfilter: add xt_cpu match, Eric Dumazet, (Thu Jul 22, 7:03 am)
Re: [PATCH nf-next-2.6] netfilter: add xt_cpu match, Jan Engelhardt, (Thu Jul 22, 7:19 am)
Re: [PATCH nf-next-2.6] netfilter: add xt_cpu match, Eric Dumazet, (Thu Jul 22, 8:18 am)
Re: [PATCH nf-next-2.6] netfilter: add xt_cpu match, Jan Engelhardt, (Thu Jul 22, 8:39 am)
Re: [PATCH nf-next-2.6] netfilter: add xt_cpu match, Eric Dumazet, (Thu Jul 22, 9:24 am)
Re: [PATCH nf-next-2.6] netfilter: add xt_cpu match, Patrick McHardy, (Fri Jul 23, 4:00 am)
[PATCH iptables] extension: add xt_cpu match, Eric Dumazet, (Fri Jul 23, 6:43 am)
Re: [PATCH iptables] extension: add xt_cpu match, Patrick McHardy, (Fri Jul 23, 7:13 am)
Re: [PATCH iptables] extension: add xt_cpu match, Jan Engelhardt, (Fri Jul 23, 9:46 am)
Re: [PATCH iptables] extension: add xt_cpu match, Eric Dumazet, (Fri Jul 23, 10:30 am)
Re: [PATCH iptables] extension: add xt_cpu match, Jan Engelhardt, (Fri Jul 23, 10:53 am)