From: David Miller <davem@davemloft.net>
To: abbotti@mev.co.uk
Cc: ian.abbott@mev.co.uk, netdev@vger.kernel.org, arnd@arndb.de,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib/checksum.c: optimize do_csum a bit
Date: Thu, 07 Jul 2011 04:52:34 -0700 (PDT) [thread overview]
Message-ID: <20110707.045234.2227056347170192540.davem@davemloft.net> (raw)
In-Reply-To: <20110707.043625.856190521365086318.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Thu, 07 Jul 2011 04:36:25 -0700 (PDT)
> From: Ian Abbott <abbotti@mev.co.uk>
> Date: Thu, 7 Jul 2011 12:32:45 +0100
>
>> On 07/07/11 12:29, David Miller wrote:
>>> From: Ian Abbott <abbotti@mev.co.uk>
>>> Date: Thu, 7 Jul 2011 12:18:49 +0100
>>>
>>>> Reduce the number of variables modified by the loop in do_csum() by 1,
>>>> which seems like a good idea. On Nios II (a RISC CPU with 3-operand
>>>> instruction set) it reduces the loop from 7 to 6 instructions, including
>>>> the conditional branch.
>>>>
>>>> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
>>>
>>> I think you'll overshoot past the end of the buffer when there are
>>> trailing bytes to handle.
>>>
>>> The whole reason we need the count variable is to handle those
>>> kinds of cases.
>>
>> I don't think it does. That's what the & ~3 was for.
>
> Aha, yes that indeed makes it work.
I've applied this to net-next-2.6, thanks.
prev parent reply other threads:[~2011-07-07 11:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-07 11:18 [PATCH] lib/checksum.c: optimize do_csum a bit Ian Abbott
2011-07-07 11:29 ` David Miller
2011-07-07 11:32 ` Ian Abbott
2011-07-07 11:36 ` David Miller
2011-07-07 11:52 ` David Miller [this message]
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=20110707.045234.2227056347170192540.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=abbotti@mev.co.uk \
--cc=arnd@arndb.de \
--cc=ian.abbott@mev.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).