From: Peter Zijlstra <peterz@infradead.org>
To: Eric Dumazet <edumazet@google.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
Eric Dumazet <eric.dumazet@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [PATCH v1] x86/csum: rewrite csum_partial()
Date: Fri, 12 Nov 2021 10:13:34 +0100 [thread overview]
Message-ID: <YY4wPgyt65Q6WOdK@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CANn89iJAakUCC6UuUHSozT9wz7_rrgrRq3dv+hXJ1FL_DCZHyA@mail.gmail.com>
On Thu, Nov 11, 2021 at 02:30:50PM -0800, Eric Dumazet wrote:
> > For values 7 through 1 I wonder if you wouldn't be better served by
> > just doing a single QWORD read and a pair of shifts. Something along
> > the lines of:
> > if (len) {
> > shift = (8 - len) * 8;
> > temp64 = (*(unsigned long)buff << shift) >> shift;
> > result += temp64;
> > result += result < temp64;
> > }
>
> Again, KASAN will not be happy.
If you do it in asm, kasan will not know, so who cares :-) as long as
the load is aligned, loading beyond @len shouldn't be a problem,
otherwise there's load_unaligned_zeropad().
next prev parent reply other threads:[~2021-11-12 9:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 18:10 [PATCH v1] x86/csum: rewrite csum_partial() Eric Dumazet
2021-11-11 21:56 ` Alexander Duyck
2021-11-11 22:30 ` Eric Dumazet
2021-11-12 9:13 ` Peter Zijlstra [this message]
2021-11-12 14:21 ` Eric Dumazet
2021-11-12 15:25 ` Peter Zijlstra
2021-11-12 15:37 ` Eric Dumazet
2021-11-14 14:44 ` David Laight
2021-11-14 15:03 ` Eric Dumazet
2021-11-14 19:09 ` David Laight
2021-11-14 19:23 ` Eric Dumazet
2021-11-14 14:21 ` David Laight
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=YY4wPgyt65Q6WOdK@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).