All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack()
Date: Fri, 21 Dec 2007 08:39:24 +0100	[thread overview]
Message-ID: <476B6DAC.2030102@cosmosbay.com> (raw)
In-Reply-To: <20071221.162833.82587283.yoshfuji@linux-ipv6.org>

YOSHIFUJI Hideaki / 吉藤英明 a écrit :
> In article <476B65F8.10201@cosmosbay.com> (at Fri, 21 Dec 2007 08:06:32 +0100), Eric Dumazet <dada1@cosmosbay.com> says:
> 
>> YOSHIFUJI Hideaki / 吉藤英明 a écrit :
>>> In article <476B574E.80601@cosmosbay.com> (at Fri, 21 Dec 2007 07:03:58 +0100), Eric Dumazet <dada1@cosmosbay.com> 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?
>>> At least, gcc-4.1.2-20061115 (debian) does not make any difference.
>>>
>>> And, IMHO, because shift for signed variable is fragile, so we should
>>> avoid using it.
>>>
>> Yes I am sure, but maybe you are on x86_64 ?
>>
>> gcc-4.2.2 on x86
> 
> I'm on gcc-4.1.2 20061115 (prerelease) (Debian 4.1.1-21), on x86 (i686).
> Maybe compiler difference?!
> 
>> If you think tot_len can be negative, I understand you can be against this 
>> patch. But I am sure it's allways > 0, even if I am a total ipv6 newbie :)
> 
> 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'. If you look in other parts of networking, we have many >> 
1 or >> 2 already there.



  parent reply	other threads:[~2007-12-21  7:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21  6:03 [TCP] IPV6 : Change a divide into a right shift in tcp_v6_send_ack() Eric Dumazet
2007-12-21  6:50 ` YOSHIFUJI Hideaki / 吉藤英明
2007-12-21  7:06   ` Eric Dumazet
     [not found]     ` <20071221.162833.82587283.yoshfuji@linux-ipv6.org>
2007-12-21  7:39       ` Eric Dumazet [this message]
2007-12-21  7:44         ` YOSHIFUJI Hideaki / 吉藤英明
2007-12-21  7:50           ` Eric Dumazet
2007-12-21  9:46         ` David Miller
2007-12-21  8:11       ` Eric Dumazet
2007-12-21 11:26   ` Jeff Garzik
2007-12-21 11:57     ` David Miller
2007-12-21 12:18       ` Jeff Garzik
2007-12-21  7:21 ` Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=476B6DAC.2030102@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.