Devicetree
 help / color / mirror / Atom feed
From: Vincent Jardin <vjardin@free.fr>
To: Eric Biggers <ebiggers@kernel.org>
Cc: "Horia Geanta" <horia.geanta@nxp.com>,
	"Pankaj Gupta" <pankaj.gupta@nxp.com>,
	"Sahil Malhotra" <sahil.malhotra@nxp.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Gaurav Jain" <gaurav.jain@nxp.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 0/3] crypto: caam/qi2 - algorithm priority configurable
Date: Tue, 29 Sep 2026 18:45:43 +0200	[thread overview]
Message-ID: <arvrN8-o__juAfsk@L15923.iliad.fr> (raw)
In-Reply-To: <20260928224143.GA21235@google.com>

Hi Eric,

On Mon, Sep 28, 2026 at 10:41:43PM +0000, Eric Biggers wrote:
> Is there *any* real-world use case in which these caamalg_qi2.c
> algorithms are worth using?  This looks like another one of those
> problematic drivers pushed by the hardware vendor as a checkbox feature.
> Just doing the crypto on the CPU is almost always much faster and more
> reliable.

It is not black and white, and I am working on some optimizations.
Today, with one key, one A72 core with the Crypto Extensions is about
2x better than the SEC, at every buffer size. However, that core is
then at its limit: 6 to 9 Gbps of AES-128-GCM, fully busy.

With many keys and many buffers in flight, it changes. With 16 KiB
buffers, 16 keys and some WIP fixes (MC firmware configuration mosty, maybe
few kernel fixes), one A72 core feeding the SEC reaches 47.1 Gbps, while
the same core does 9.3 Gbps with the Crypto Extensions. At 4 KiB it is
14.4 against 8.5 Gbps. At low network packet size (WIP about 1400 octet) the
A72 wins.

For single flows, the SEC should not be used: with the current kernel code,
one key cannot go past about 4 Gbps.

So, even if it is tempting to drop caamalg_qi2.c, I believe some users
still have a use for it. Note: I only focused on AES-128-GCM.

> As shown by your other patch
> (https://lore.kernel.org/linux-crypto/20260928-for-upstream-caam-qi-plain-keylen-v1-1-6edb56649cf9@free.fr/)
> it also seems that this driver has been critically broken for the last
> year, with it being unable to set keys.  Evidently, no one has tested or
> used it in the last year until now.

Agreed. CONFIG_CRYPTO_SELFTESTS caught it on the first boot.

> It also has the usual anti-patterns like supporting MD5 and DES.

I cannot argue with that, but I would rather not be the one who drops
them from caamalg_qi2.c.

> I really don't see the point.  Why do people put themselves through
> these issues at all?  It seems this functionality should just be
> disabled everywhere, without putting policy in the device tree which as
> has been noted many times isn't the right place for it.

Definitely, the device tree is not the right place, I get the point.
v2 will move away from it.

My first goal is to get these features working again on the
LX2160A, and to be able to select the crypto backend.

Best regards,
  Vincent

      reply	other threads:[~2026-09-29 16:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 14:01 [PATCH 0/3] crypto: caam/qi2 - algorithm priority configurable Vincent Jardin via B4 Relay
2026-09-28 14:01 ` [PATCH 1/3] crypto: caam/qi2 - algorithm priority be a parameter Vincent Jardin via B4 Relay
2026-09-29 12:29   ` Herbert Xu
2026-09-29 12:57     ` Vincent Jardin
2026-09-28 14:01 ` [PATCH 2/3] dt-bindings: crypto: fsl,sec-v4.0: add fsl,qi2-crypto-priority Vincent Jardin via B4 Relay
2026-09-28 14:07   ` sashiko-bot
2026-09-29  9:08   ` Krzysztof Kozlowski
2026-09-29 12:58     ` Vincent Jardin
2026-09-28 14:01 ` [PATCH 3/3] crypto: caam/qi2 - priority from the DTS Vincent Jardin via B4 Relay
2026-09-28 22:41 ` [PATCH 0/3] crypto: caam/qi2 - algorithm priority configurable Eric Biggers
2026-09-29 16:45   ` Vincent Jardin [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=arvrN8-o__juAfsk@L15923.iliad.fr \
    --to=vjardin@free.fr \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=gaurav.jain@nxp.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pankaj.gupta@nxp.com \
    --cc=robh@kernel.org \
    --cc=sahil.malhotra@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox