[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110105094830.63a68230@nehalam>
Date: Wed, 5 Jan 2011 09:48:30 -0800
From: Stephen Hemminger <shemminger@...tta.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] ipv4: IP defragmentation must be ECN aware
On Wed, 05 Jan 2011 18:41:01 +0100
Eric Dumazet <eric.dumazet@...il.com> wrote:
> 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@...il.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
>
At least make it unsigned int?
--
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists