From: Ben Greear <greearb@candelatech.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
Steve deRosier <derosier@cal-sierra.com>
Subject: Re: [PATCH v2] crypto: aesni - add ccm(aes) algorithm implementation
Date: Thu, 10 Dec 2020 06:40:35 -0800 [thread overview]
Message-ID: <737f75a8-0709-c0ac-c98c-ccbe1b3e5ece@candelatech.com> (raw)
In-Reply-To: <CAMj1kXF05XZtyakdpLixpP9Lroy0D3_gEcY2SFbSshD8ERUU7w@mail.gmail.com>
On 12/9/20 11:30 PM, Ard Biesheuvel wrote:
> On Thu, 10 Dec 2020 at 04:01, Ben Greear <greearb@candelatech.com> wrote:
>>
>> On 12/9/20 6:43 PM, Herbert Xu wrote:
>>> On Thu, Dec 10, 2020 at 01:18:12AM +0100, Ard Biesheuvel wrote:
>>>>
>>>> One thing I realized just now is that in the current situation, all
>>>> the synchronous skciphers already degrade like this.
>>>>
>>>> I.e., in Ben's case, without the special ccm implementation, ccm(aes)
>>>> will resolve to ccm(ctr(aesni),cbcmac(aesni)), which is instantiated
>>>> as a sync skcipher using the ctr and ccm/cbcmac templates built on top
>>>> of the AES-NI cipher (not skcipher). This cipher will also fall back
>>>> to suboptimal scalar code if the SIMD is in use in process context.
>>>
>>> Sure, your patch is not making it any worse. But I don't think
>>> the extra code is worth it considering that you're still going to
>>> be running into that slow fallback path all the time.
>>
>> How can we test this assumption? I see 3x performance gain, so it is not hitting
>> the fallback path much in my case. What traffic pattern and protocol do you think
>> will cause the slow fallback path to happen often enough to make this patch not
>> helpful?
>>
>
> Is there a way to verify Herbert's assertion that TX and RX tend to be
> handled by the same core? I am not a networking guy, but that seems
> dubious to me.
>
> You could add a pr_warn_ratelimited() inside the fallback path and see
> if it ever gets called at all under various loads.
Even if it does sometimes use the same core, if performance is better and
CPU usage is lower, why would it even matter?
Anyway, looks like Herbert is dead set against this code in hopes that he
can force other subsystems to re-write their code. If you come up with
some other variant that Herbert will accept, let me know and I'll test it.
Otherwise, I will just add your patch to my kernel and carry on.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2020-12-10 15:34 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-01 19:45 [PATCH v2] crypto: aesni - add ccm(aes) algorithm implementation Ard Biesheuvel
2020-12-01 21:40 ` Ben Greear
2020-12-01 21:57 ` Herbert Xu
2020-12-01 22:00 ` Ben Greear
2020-12-01 22:01 ` Herbert Xu
2020-12-01 22:01 ` Ard Biesheuvel
2020-12-01 22:04 ` Herbert Xu
2020-12-01 22:12 ` Ard Biesheuvel
2020-12-01 22:16 ` Herbert Xu
2020-12-01 22:27 ` Ard Biesheuvel
2020-12-01 23:11 ` Herbert Xu
2020-12-01 23:24 ` Ard Biesheuvel
2020-12-01 23:30 ` Herbert Xu
2020-12-01 23:41 ` Ard Biesheuvel
2020-12-01 23:48 ` Herbert Xu
2020-12-02 0:01 ` Ben Greear
2020-12-10 0:18 ` Ard Biesheuvel
2020-12-10 2:43 ` Herbert Xu
2020-12-10 3:01 ` Ben Greear
2020-12-10 7:30 ` Ard Biesheuvel
2020-12-10 11:14 ` Herbert Xu
2020-12-10 12:03 ` Ard Biesheuvel
2020-12-10 12:16 ` Herbert Xu
2020-12-10 12:19 ` Ard Biesheuvel
2020-12-15 8:55 ` Ard Biesheuvel
2020-12-15 9:19 ` Herbert Xu
2022-11-08 18:50 ` Ben Greear
2022-11-09 3:52 ` Herbert Xu
2022-11-09 10:05 ` Ard Biesheuvel
2022-11-09 14:12 ` Ben Greear
2022-11-11 22:29 ` Ben Greear
2022-11-12 14:59 ` Ard Biesheuvel
2023-10-16 20:50 ` Ben Greear
2023-10-17 3:16 ` Eric Biggers
2023-10-17 6:43 ` Ard Biesheuvel
2023-10-18 1:24 ` Herbert Xu
2024-08-03 17:20 ` Ben Greear
2024-08-28 16:04 ` Ard Biesheuvel
2020-12-10 14:40 ` Ben Greear [this message]
2020-12-01 22:12 ` Ben Greear
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=737f75a8-0709-c0ac-c98c-ccbe1b3e5ece@candelatech.com \
--to=greearb@candelatech.com \
--cc=ardb@kernel.org \
--cc=derosier@cal-sierra.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@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).