Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1426847rdb; Sat, 18 Nov 2023 16:33:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYrzaqMYtYL1cg/gK2+wi5HVUQqeihoGiLv94zRvgG7HN1UpY+wtZdnkyEKaYedDZrnHLA X-Received: by 2002:a17:906:f106:b0:9cf:18ce:95e6 with SMTP id gv6-20020a170906f10600b009cf18ce95e6mr2287149ejb.62.1700353999451; Sat, 18 Nov 2023 16:33:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700353999; cv=none; d=google.com; s=arc-20160816; b=cL9h3jcrxYMTFJ7RFGeIiWJ9Gv3P1jcPs7tFZ9jCLXQ2mq1y5A4/Nay/uwnAfNTnqY /e+qVkyNPnosU0//Sjw0tMicucnBeYGROpkDJ7Oa/Uu/L72UrZ/hv1GgK63RG420fRmS teKOxB8SaQz26qSUgy5CP2rzpepWLhqs0m1khhOLzMSs2RUFWhJiI8WnhN2GeXqBtwc5 Qecq1zj7+zpJO0qMje40Xb0mHx1EdZ0dT9tQECnFBdDmzHyagWq8Wr4x2t2+Iu677kUv kUfulZPZpqps8DrRTncdNnHUs++qpfXmGGQ5yx6ul158DLvUA+cCZnaUWKGDcA/hHTnl 9Jlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=NJq+8rInXFQz0lQ5RedVfwAKfNaq1CdVOdaBUu0zwDc=; fh=GCKca7lyEYfcHE+E3YlL2CUtdvfUG0EbdshEJ35M0L0=; b=oGsYSB9fULOBGNgycxiMGRHHl0danjjY4qpikuD0cLqseFlJ5ZDmejH7bPi4LTZRdI uPOHzdJWQIINih0GIUnfJEl6yqNe7Dw2gMvB8drfOcnWvMIVUb5ufKVg4QMxumF7lQ7d pz+uLK9Rf2KuVD0MdSAcRQLLkA4jiT0GcOhsigzLx/SoFcAdZ9JF1jJviPX97q0yRHbt 8rFkktWQj9NED3gPKK4mX4mRMXILICQs3IZE0YfKB/Lu+IsqyOSpMR1HfMwv8Y83iJVh jJzJvhq163eblL/HMOTnmWDs0XqcnZyQynhUjKViqSy7yXIvgLzwPcjDmRLgLkcsre5K 6WkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=eOunu6o9; spf=pass (google.com: domain of linux-crypto+bounces-184-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o9-20020a17090637c900b009fc6b2dfb78si403213ejc.697.2023.11.18.16.33.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 16:33:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-184-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=eOunu6o9; spf=pass (google.com: domain of linux-crypto+bounces-184-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2F17B1F2250C for ; Sun, 19 Nov 2023 00:33:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A19E01847 for ; Sun, 19 Nov 2023 00:33:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="eOunu6o9" X-Original-To: linux-crypto@vger.kernel.org X-Greylist: delayed 120100 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 18 Nov 2023 15:32:45 PST Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [IPv6:2001:41d0:203:375::ad]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBB90196 for ; Sat, 18 Nov 2023 15:32:45 -0800 (PST) Message-ID: <862c832a-da98-4bef-80ef-8294be1d4601@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700350363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NJq+8rInXFQz0lQ5RedVfwAKfNaq1CdVOdaBUu0zwDc=; b=eOunu6o9eh2HAOVwUzToUPbtngfYq9c7o0HHrg6B4Htko0qMJuZoS/1SkvWcZtrIPMvycF Csj3NAmyZpkZbvyZwk4nTk3dkxgIVXVYZ0/IRcG2SnTdWzR+mwb1LKhi6UcuD9jBqKK6IG 7Xg9+CFaQ2eWPGj6xVdhGfcuQQvVrXA= Date: Sat, 18 Nov 2023 23:32:39 +0000 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v5 1/2] bpf: add skcipher API support to TC/XDP programs Content-Language: en-US To: Alexei Starovoitov , Vadim Fedorenko Cc: Jakub Kicinski , Martin KaFai Lau , Andrii Nakryiko , Alexei Starovoitov , Mykola Lysenko , Herbert Xu , Network Development , Linux Crypto Mailing List , bpf References: <20231118225451.2132137-1-vadfed@meta.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 18/11/2023 18:23, Alexei Starovoitov wrote: > On Sat, Nov 18, 2023 at 2:55 PM Vadim Fedorenko 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?