From: Jens Axboe <axboe@kernel.dk>
To: David Howells <dhowells@redhat.com>
Cc: io-uring@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: io_uring and crypto
Date: Tue, 7 Oct 2025 11:27:16 -0600 [thread overview]
Message-ID: <f1e0ef09-572e-4345-b601-b4aea2de1052@kernel.dk> (raw)
In-Reply-To: <4016104.1759857082@warthog.procyon.org.uk>
On 10/7/25 11:11 AM, David Howells wrote:
> Hi Jens,
>
> I was wondering if it might be possible to adapt io_uring to make
> crypto requests as io_uring primitives rather than just having
> io_uring call sendmsg and recvmsg on an AF_ALG socket.
>
> The reason I think this might make sense is that for the certain
> crypto ops we need to pass two buffers, one input and one output
> (encrypt, decrypt, sign) or two input (verify) and this could directly
> translate to an async crypto request.
>
> Or possibly we should have a sendrecv socket call (RPC sort of thing)
> and have io_uring drive that.
You could certainly wire it up via io_uring in either way. I don't know
the crypto API, but ideally you need something where you the issue and
completions ide split, rather than just a boring sync syscall type
thing. For the latter, io_uring can't really help you outside of punting
to a thread. Having a reliable way to do non-blocking issue and then
poll for readiness if non-blocking failed would suffice, ideally you
want a way to issue/start the operation and get a callback when it
completes.
> The tricky bit is that it would require two buffers and io_uring seems
> geared around one.
io_uring doesn't care, it's just a transport in that sense. You can
define what the SQE looks like entirely for your opcode, and have 3
buffers per operation if you like.
--
Jens Axboe
prev parent reply other threads:[~2025-10-07 17:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 17:11 io_uring and crypto David Howells
2025-10-07 17:13 ` Eric Biggers
2025-10-07 17:27 ` Jens Axboe [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=f1e0ef09-572e-4345-b601-b4aea2de1052@kernel.dk \
--to=axboe@kernel.dk \
--cc=dhowells@redhat.com \
--cc=io-uring@vger.kernel.org \
--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