Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp54058rdb; Wed, 1 Nov 2023 16:51:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlmeiAbL4dA2o331Hf0R4gOUY0gML5Md9T0Y1a3rYW8gHaAcNHtURvqpOvWG7tpQ0bBOmB X-Received: by 2002:a05:6a21:1494:b0:157:877a:5f5e with SMTP id od20-20020a056a21149400b00157877a5f5emr11143883pzb.61.1698882688729; Wed, 01 Nov 2023 16:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698882688; cv=none; d=google.com; s=arc-20160816; b=cw2+pkC8g12Sur4L/5z4H/xGuYhCUCYDorqWORdLSMi0MEgxB8UFoWwlSnbUAl4/7k oKfCcf4IuH5rr6qAiiMhSQL4Uv7gwl/LBblSEOZ8wKJoTyuYGjCm8eg55oJnWwyLSIDg 2QhR1kCk0vMtY7Vwxyr4y/YUcL6jFc9Cm5lApdd8KLoh2MOQpHqDpujZzPrCBix+m90A PZhElva4DPbzGfAlLbeCKfwKbf53P1Br1xNdhaIoTkHstreKf+R/1iQSBasZA/nxZDtb oBh6CEIvwwlMEZB/3TLNRPzSeINXkiCn8e0g+k7cEh1sloG80OpJdoTbSbBIQnUybzt7 jBjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=ZZMYinCK5nATTv27ermACPnZcPbsAMm/p92D7mhqgMY=; fh=TdZMYNnTdW87gOUJKCGEmiOjD4VCdlCFIwIs4xkwkBo=; b=db4j0gYyed+EhI9JQG1+ya97Oy9Eyavr+7Jw2De1D9CsM37yhdjJ0UiRKebBbiJpV0 L4ClO3cpGiHD8c2jDIXHLLWux5FHWA2ASiySQbY46U50CNqYR72kFtBHqP28nl5O1hqV BJnwUo4Z6RN4KRcmL9wQ4lqPP/Jo1eF21MXMlDZZ+Ywnmqbk6TdpH/VES8xG1CAjVavZ UbdBlJTN14Rpa43XwErGbUS+5YyDXE9yYAQFzMq4olCJsh7ni683GO0iOlLlS4xKcD4I SiO6BqICmsEqOKXfcFZ1fLasJh1Rm8za3pdtrhgoAEXpnMJaaU1/Mb8WKehv14xeUv7y 951A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QMui0MZx; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id d20-20020a170902c19400b001c72c258f82si3953876pld.99.2023.11.01.16.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 16:51:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QMui0MZx; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4B2CF8073853; Wed, 1 Nov 2023 16:50:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235922AbjKAXsr (ORCPT + 99 others); Wed, 1 Nov 2023 19:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345521AbjKAXsh (ORCPT ); Wed, 1 Nov 2023 19:48:37 -0400 X-Greylist: delayed 387 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 01 Nov 2023 16:48:31 PDT Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [IPv6:2001:41d0:1004:224b::b1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A333DFE for ; Wed, 1 Nov 2023 16:48:31 -0700 (PDT) Message-ID: <6947046d-27e3-90ee-3419-0b480af0abb0@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698882116; 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=ZZMYinCK5nATTv27ermACPnZcPbsAMm/p92D7mhqgMY=; b=QMui0MZxANiw45tOWolfc71QUZDgiJoHtouJaZjQWLYa+MzmIGw0J8Xv/PXToqbIA8mMV1 KVGXEo/hWM+zRBnI0s52u/UclkKdLwB4Uwc44bxg4rrTRRJg9UiKVBAMLSZuhCWM/kvG5K NjPfeErlG1Wy0w+hrt/C/phKmWXKVAg= Date: Wed, 1 Nov 2023 16:41:51 -0700 MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v3 1/2] bpf: add skcipher API support to TC/XDP programs Content-Language: en-US To: Vadim Fedorenko Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-crypto@vger.kernel.org, Jakub Kicinski , Andrii Nakryiko , Alexei Starovoitov , Mykola Lysenko , Vadim Fedorenko , "David S. Miller" , Herbert Xu References: <20231031134900.1432945-1-vadfed@meta.com> <91a6d5a7-7b18-48a2-9a74-7c00509467f8@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <91a6d5a7-7b18-48a2-9a74-7c00509467f8@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 16:50:44 -0700 (PDT) On 11/1/23 3:50 PM, Vadim Fedorenko wrote: >>> +static void *__bpf_dynptr_data_ptr(const struct bpf_dynptr_kern *ptr) >>> +{ >>> +    enum bpf_dynptr_type type; >>> + >>> +    if (!ptr->data) >>> +        return NULL; >>> + >>> +    type = bpf_dynptr_get_type(ptr); >>> + >>> +    switch (type) { >>> +    case BPF_DYNPTR_TYPE_LOCAL: >>> +    case BPF_DYNPTR_TYPE_RINGBUF: >>> +        return ptr->data + ptr->offset; >>> +    case BPF_DYNPTR_TYPE_SKB: >>> +        return skb_pointer_if_linear(ptr->data, ptr->offset, >>> __bpf_dynptr_size(ptr)); >>> +    case BPF_DYNPTR_TYPE_XDP: >>> +    { >>> +        void *xdp_ptr = bpf_xdp_pointer(ptr->data, ptr->offset, >>> __bpf_dynptr_size(ptr)); >> >> I suspect what it is doing here (for skb and xdp in particular) is very >> similar to bpf_dynptr_slice. Please check if bpf_dynptr_slice(ptr, 0, NULL, >> sz) will work. >> > > Well, yes, it's simplified version of bpf_dynptr_slice. The problem is > that bpf_dynptr_slice bpf_kfunc which cannot be used in another > bpf_kfunc. Should I refactor the code to use it in both places? Like Sorry, scrolled too fast in my earlier reply :( I am not aware of this limitation. What error does it have? The bpf_dynptr_slice_rdwr kfunc() is also calling the bpf_dynptr_slice() kfunc. > create __bpf_dynptr_slice() which will be internal part of bpf_kfunc?