From: Eric Dumazet <eric.dumazet@gmail.com>
To: Tom Herbert <tom@herbertland.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
torvalds@linux-foundation.org, tglx@linutronix.de,
mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
kernel-team@fb.com
Subject: Re: [PATCH v4 net-next] net: Implement fast csum_partial for x86_64
Date: Sun, 28 Feb 2016 12:35:30 -0800 [thread overview]
Message-ID: <1456691730.648.51.camel@edumazet-ThinkPad-T530> (raw)
In-Reply-To: <1456516995-3471163-1-git-send-email-tom@herbertland.com>
On ven., 2016-02-26 at 12:03 -0800, Tom Herbert wrote:
> +
> + /*
> + * Length is greater than 64. Sum to eight byte alignment before
> + * proceeding with main loop.
> + */
> + aligned = !!((unsigned long)buff & 0x1);
> + if (aligned) {
> + unsigned int align = 7 & -(unsigned long)buff;
> +
> + result = csum_partial_lt8_head(*(unsigned long *)buff, align);
> + buff += align;
> + len -= align;
> + result = rotate_by8_if_odd(result, align);
> + }
> +
This looks like you wanted to test 3 low order bits, not only the 1 low
order.
aligned = !((unsigned long)buff & 0x7);
if (!aligned) {
...
}
Or rename the variable to notaligned
next prev parent reply other threads:[~2016-02-28 20:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 20:03 [PATCH v4 net-next] net: Implement fast csum_partial for x86_64 Tom Herbert
2016-02-26 20:29 ` Linus Torvalds
2016-02-26 20:41 ` Tom Herbert
2016-02-26 22:52 ` Alexander Duyck
2016-02-27 3:11 ` Tom Herbert
2016-02-27 3:40 ` Alexander Duyck
2016-02-27 5:25 ` Linus Torvalds
2016-02-27 8:30 ` Alexander Duyck
2016-02-28 18:56 ` Alexander Duyck
2016-02-28 19:15 ` Tom Herbert
2016-02-29 1:33 ` Alexander Duyck
2016-02-29 1:39 ` Maciej W. Rozycki
2016-02-28 20:35 ` Eric Dumazet [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-02-28 21:43 George Spelvin
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=1456691730.648.51.camel@edumazet-ThinkPad-T530 \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=hpa@zytor.com \
--cc=kernel-team@fb.com \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tom@herbertland.com \
--cc=torvalds@linux-foundation.org \
--cc=x86@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