From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] ipv4: IP defragmentation must be ECN aware
Date: Wed, 05 Jan 2011 18:41:01 +0100 [thread overview]
Message-ID: <1294249261.10633.54.camel@edumazet-laptop> (raw)
In-Reply-To: <20110105091340.3f8833ef@nehalam>
Le mercredi 05 janvier 2011 à 09:13 -0800, Stephen Hemminger a écrit :
> On Wed, 05 Jan 2011 14:59:02 +0100
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> > +
> > +static inline int ip4_frag_ecn(int tos)
>
> Since tos is only a byte, this should be:
>
> static inline u8 ip4_frag_ecn(u8 tos)
>
>
In fact, generated code is the same on x86, but some arches have faster
arithmetic on WORD units.
And I added the 'inline' because on x86_64 gcc, compiler chose _not_ to
inline this 6 instruction sequence ! Code was much larger.
31 d2 xor %edx,%edx
0f b6 40 01 movzbl 0x1(%rax),%eax
83 e0 03 and $0x3,%eax
ff c0 inc %eax
a8 02 test $0x2,%al
0f 44 d0 cmove %eax,%edx
We do roughly the same (working on WORD arith) in
static inline int IP_ECN_set_ce(struct iphdr *iph)
{
u32 ecn = (iph->tos + 1) & INET_ECN_MASK;
...
}
What others think ? I have no real strong opinion.
next prev parent reply other threads:[~2011-01-05 17:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 0:13 [RFC] ECN and IP defragmentation Eric Dumazet
2011-01-05 2:53 ` David Miller
2011-01-05 13:59 ` [PATCH] ipv4: IP defragmentation must be ECN aware Eric Dumazet
2011-01-05 17:13 ` Stephen Hemminger
2011-01-05 17:41 ` Eric Dumazet [this message]
2011-01-05 17:48 ` Stephen Hemminger
2011-01-05 17:52 ` Eric Dumazet
2011-01-06 19:21 ` David Miller
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=1294249261.10633.54.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox