| To: | YOSHIFUJI Hideaki / åèèæ <yoshfuji@xxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [INET] Optimise away a branch in IP_ECN_set_ce |
| From: | Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx> |
| Date: | Wed, 8 Sep 2004 21:27:57 -0300 |
| Cc: | herbert@xxxxxxxxxxxxxxxxxxx, davem@xxxxxxxxxx, netdev@xxxxxxxxxxx |
| In-reply-to: | <20040909.092428.125540781.yoshfuji@linux-ipv6.org> |
| Organization: | Conectiva S.A. |
| References: | <20040909000330.GA5581@gondor.apana.org.au> <20040909.092428.125540781.yoshfuji@linux-ipv6.org> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | KMail/1.7 |
Em Qua 08 Set 2004 21:24, YOSHIFUJI Hideaki / åèèæ escreveu: > In article <20040909000330.GA5581@xxxxxxxxxxxxxxxxxxx> (at Thu, 9 Sep 2004 10:03:31 +1000), Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> says: > > + u32 ecn = (iph->tos + 1) & INET_ECN_MASK; > > > > + /* > > + * The following gives us: > > + * INET_ECN_ECT_1 => check += __constant_htons(0xFFFD) > > + * INET_ECN_ECT_0 => check += __constant_htons(0xFFFE) > > + */ > > + if (__constant_htons(1) != 1) > > + ecn <<= 8; > > + check += __constant_htons(0xFFFB) + ecn; > > + > > iph->check = check + (check>=0xFFFF); > > iph->tos |= INET_ECN_CE; > > } > > s/__constant_htons/htons/g here, please. For Herbert understanding: the generated code is the same in this case. :) > > And, I think > u16 ecn = (iph->tos + 1) & INET_ECN_MASK; > > check += (u32)htons(0xfffb) + (u32)htons(ecn); > > or something like that? |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [INET] Optimise away a branch in IP_ECN_set_ce, YOSHIFUJI Hideaki / 吉藤英明 |
|---|---|
| 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] |