From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Vadim Fedorenko <vadfed@meta.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Andrii Nakryiko <andrii@kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Mykola Lysenko <mykolal@fb.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Network Development <netdev@vger.kernel.org>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v5 1/2] bpf: add skcipher API support to TC/XDP programs
Date: Sat, 18 Nov 2023 23:32:39 +0000 [thread overview]
Message-ID: <862c832a-da98-4bef-80ef-8294be1d4601@linux.dev> (raw)
In-Reply-To: <CAADnVQLBE1ex-B=F07R0xQKo-r22M0L6eiS8DjOAtsur-hEbFQ@mail.gmail.com>
On 18/11/2023 18:23, Alexei Starovoitov wrote:
> On Sat, Nov 18, 2023 at 2:55 PM Vadim Fedorenko <vadfed@meta.com> wrote:
>>
>> +/**
>> + * struct bpf_crypto_lskcipher_ctx - refcounted BPF sync skcipher context structure
>> + * @tfm: The pointer to crypto_sync_skcipher struct.
>> + * @rcu: The RCU head used to free the crypto context with RCU safety.
>> + * @usage: Object reference counter. When the refcount goes to 0, the
>> + * memory is released back to the BPF allocator, which provides
>> + * RCU safety.
>> + */
>> +struct bpf_crypto_lskcipher_ctx {
>> + struct crypto_lskcipher *tfm;
>> + struct rcu_head rcu;
>> + refcount_t usage;
>> +};
>> +
>> +__bpf_kfunc_start_defs();
>> +
>> +/**
>> + * bpf_crypto_lskcipher_ctx_create() - Create a mutable BPF crypto context.
>
> Let's drop 'lskcipher' from the kfunc names and ctx struct.
> bpf users don't need to know the internal implementation details.
> bpf_crypto_encrypt/decrypt() is clear enough.
The only reason I added it was the existence of AEAD subset of crypto
API. And this subset can also be implemented in bpf later, and there
will be inconsistency in naming then if we add aead in future names.
WDYT?
next prev parent reply other threads:[~2023-11-18 23:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-18 22:54 [PATCH bpf-next v5 1/2] bpf: add skcipher API support to TC/XDP programs Vadim Fedorenko
2023-11-18 22:54 ` [PATCH bpf-next v5 2/2] selftests: bpf: crypto skcipher algo selftests Vadim Fedorenko
2023-11-19 21:58 ` Alexei Starovoitov
2023-11-19 23:52 ` Vadim Fedorenko
2023-11-18 23:23 ` [PATCH bpf-next v5 1/2] bpf: add skcipher API support to TC/XDP programs Alexei Starovoitov
2023-11-18 23:32 ` Vadim Fedorenko [this message]
2023-11-18 23:35 ` Alexei Starovoitov
2023-11-18 23:46 ` Vadim Fedorenko
2023-11-19 16:56 ` Alexei Starovoitov
2023-11-20 0:22 ` Vadim Fedorenko
2023-11-20 1:13 ` Alexei Starovoitov
2023-11-20 18:08 ` Vadim Fedorenko
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=862c832a-da98-4bef-80ef-8294be1d4601@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=kuba@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=netdev@vger.kernel.org \
--cc=vadfed@meta.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;
as well as URLs for NNTP newsgroup(s).