Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-21 Thread Jeff Garzik
David Miller wrote: From: Jeff Garzik <[EMAIL PROTECTED]> Date: Fri, 21 Dec 2007 06:26:48 -0500 YOSHIFUJI Hideaki / 吉藤英明 wrote: In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: Because tot_len is signed in tcp_v6_send_ack(), tot_len

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-21 Thread David Miller
From: Jeff Garzik <[EMAIL PROTECTED]> Date: Fri, 21 Dec 2007 06:26:48 -0500 > YOSHIFUJI Hideaki / 吉藤英明 wrote: > > In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric > > Dumazet <[EMAIL PROTECTED]> says: > > > >> Because tot_len is signed in tcp_v6_send_ack(), tot_len/4 for

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-21 Thread Jeff Garzik
YOSHIFUJI Hideaki / 吉藤英明 wrote: In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: Because tot_len is signed in tcp_v6_send_ack(), tot_len/4 forces compiler to emit an integer divide, while we can help it to use a right shift, less expen

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-21 Thread David Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Fri, 21 Dec 2007 08:39:24 +0100 > I didnt chose this path, because David was against changing some > fields from 'int' to 'unsigned'. If you look in other parts of > networking, we have many >> 1 or >> 2 already there. I don't remember making this stat

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-21 Thread Eric Dumazet
YOSHIFUJI Hideaki / 吉藤英明 a écrit : In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 08:06:32 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: YOSHIFUJI Hideaki / 吉藤英明 a écrit : In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: Beca

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-20 Thread Eric Dumazet
YOSHIFUJI Hideaki / 吉藤英明 a écrit : In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 08:39:24 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: Okay, anyway, I'll convert them to unsigned int, which is more appropriate. I didnt chose this path, because David was against changing some fields fro

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-20 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 08:39:24 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: > > Okay, anyway, I'll convert them to unsigned int, which is more > > appropriate. > > I didnt chose this path, because David was against changing some fields from > 'int' to 'unsigned'.

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-20 Thread Eric Dumazet
YOSHIFUJI Hideaki / 吉藤英明 a écrit : In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 08:06:32 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: YOSHIFUJI Hideaki / 吉藤英明 a écrit : In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: Beca

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-20 Thread Ilpo Järvinen
On Fri, 21 Dec 2007, Eric Dumazet wrote: Because tot_len is signed in tcp_v6_send_ack(), tot_len/4 forces compiler to emit an integer divide, while we can help it to use a right shift, less expensive. Can't you just change tot_len to unsigned here? It's just sizeof and some positive constants

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-20 Thread Eric Dumazet
YOSHIFUJI Hideaki / 吉藤英明 a écrit : In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: Because tot_len is signed in tcp_v6_send_ack(), tot_len/4 forces compiler to emit an integer divide, while we can help it to use a right shift, less ex

Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-20 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric Dumazet <[EMAIL PROTECTED]> says: > Because tot_len is signed in tcp_v6_send_ack(), tot_len/4 forces compiler > to emit an integer divide, while we can help it to use a right shift, > less expensive. Are you really sure? A

[TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()

2007-12-20 Thread Eric Dumazet
Because tot_len is signed in tcp_v6_send_ack(), tot_len/4 forces compiler to emit an integer divide, while we can help it to use a right shift, less expensive. Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0268e11..92f0fda 100644 ---