All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: "herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	David Laight <David.Laight@aculab.com>
Subject: Re: [PATCH v2] xfrm: branchless addr4_match() on 64-bit
Date: Mon, 27 Mar 2017 16:11:32 +0300	[thread overview]
Message-ID: <CACVxJT9NJtqpteJ5hVX8FnBYo00_-NokuB2zgq_tuK2b_qA51A@mail.gmail.com> (raw)
In-Reply-To: <20170327103719.GI23004@secunet.com>

On Mon, Mar 27, 2017 at 1:37 PM, Steffen Klassert
<steffen.klassert@secunet.com> wrote:
> On Sat, Mar 25, 2017 at 07:41:17PM +0300, Alexey Dobriyan wrote:
>> After (no branches):
>>
>>       mov    r8d,0x20
>>       mov    rdx,0xffffffffffffffff
>>       mov    esi,DWORD PTR [rsi+0x2c]
>>       mov    ecx,r8d
>>       sub    cl,BYTE PTR [rdi+0x2a]
>>       xor    esi,DWORD PTR [rbx]
>>       mov    rdi,rdx
>>       xor    eax,eax
>>       shl    rdi,cl
>>       bswap  edi
>>
>> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>
> Also applied to ipsec-next, thanks for the patches Alexey!

Speaking of optimizations.
1) All those ntohl() invocations inside hashes are likely
unnecessary (hashing is hashing after all).

2) I din't look closely but it can be further optimized by storing
32 - prefixlen (or 128 - prefixlen) but I don't know if you'll accept
such horror. :-)

      reply	other threads:[~2017-03-27 13:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 23:32 [PATCH] xfrm: branchless addr4_match() on 64-bit Alexey Dobriyan
2017-03-24 17:16 ` David Laight
2017-03-25 16:37   ` Alexey Dobriyan
2017-03-25 16:41     ` [PATCH v2] " Alexey Dobriyan
2017-03-27 10:37       ` Steffen Klassert
2017-03-27 13:11         ` Alexey Dobriyan [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=CACVxJT9NJtqpteJ5hVX8FnBYo00_-NokuB2zgq_tuK2b_qA51A@mail.gmail.com \
    --to=adobriyan@gmail.com \
    --cc=David.Laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.