| To: | "YOSHIFUJI Hideaki / ?$B5HF#1QL@" <yoshfuji@xxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [INET] Optimise away a branch in IP_ECN_set_ce |
| From: | Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> |
| Date: | Thu, 9 Sep 2004 11:54:42 +1000 |
| Cc: | davem@xxxxxxxxxx, netdev@xxxxxxxxxxx |
| In-reply-to: | <20040909.102736.94408944.yoshfuji@linux-ipv6.org> |
| References: | <20040909000330.GA5581@gondor.apana.org.au> <20040909.092428.125540781.yoshfuji@linux-ipv6.org> <20040909011016.GA9238@gondor.apana.org.au> <20040909.102736.94408944.yoshfuji@linux-ipv6.org> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mutt/1.5.6+20040722i |
On Thu, Sep 09, 2004 at 10:27:36AM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > > > > And, I think > > > u16 ecn = (iph->tos + 1) & INET_ECN_MASK; > > > check += (u32)htons(0xfffb) + (u32)htons(ecn); > > > > The second htons is less optimal than the shift because htons doesn't > > know that ecn is only a byte. So it'll end up doing a full swap. > > Not true; gcc is clever enough to produces same code, and my code looks > better. Sorry, you're right. Here is an updated patch. Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Bad: scheduling while atomic! in 2.6.8.1, Wolfgang Walter |
|---|---|
| Next by Date: | Re: [INET] Optimise away a branch in IP_ECN_set_ce, YOSHIFUJI Hideaki / 吉藤英明 |
| Previous by Thread: | Re: [INET] Optimise away a branch in IP_ECN_set_ce, YOSHIFUJI Hideaki / 吉藤英明 |
| Next by Thread: | Re: [INET] Optimise away a branch in IP_ECN_set_ce, YOSHIFUJI Hideaki / 吉藤英明 |
| Indexes: | [Date] [Thread] [Top] [All Lists] |