Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp548019rdb; Thu, 2 Nov 2023 10:48:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHE7VZDtYPyxj3WrONKVGishZ5JEna00z/j5TzrxVoZdRyKdq0P522R46VdRu2bbyvR3l0f X-Received: by 2002:a05:6a21:a101:b0:181:a1b0:c330 with SMTP id aq1-20020a056a21a10100b00181a1b0c330mr2380636pzc.60.1698947295372; Thu, 02 Nov 2023 10:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698947295; cv=none; d=google.com; s=arc-20160816; b=QTGFJDpMsvbHQIC43N1ViVf14kkz5IqMfx+R2f7Q+IYPaXfoE0cvXeUJnu27auQVz/ 7gXeSqKN2KeeCKDuYPb4wDL3FJp+zz43vWT1fQ/8gHn4iSbK15EUN6JYHP1T8FM3oUG1 /LKKmNOCosqaqPVDLkgiPnw3mDM7T4D13lDUwL0othuYMepsiF86Acp9spK1/pCJjSPr ueutrGwyHoJ7hwgm0m6WQvecn2Rv0QDEHjbv1fIZB2HZtcvf3yXj06WS1e2slLmgpxvc Imd6qxZ3NzymmlkFo7ED+iynZ4olmNiRz66taJoZoFfl4yzptEzDHst5pebmd2Dk45S2 H7dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8LZVQdmd+E8mUtJWBLZRWGzqUC4FZBj+7S3JJxwc7EY=; fh=O26EOECTfiaHJ4op2PBx9dFNQcqiDJLw2Gon0wDo2as=; b=sD/6VhPxFlMGnw3DG6wqm9uvejwqKsm+7vS0YTv77uC8g2evCwwWnvWDFl7tCIEtbF 0BlxN7hkt4tih3QpVcl6DBMDKP1cYhP4eFjg9sOon87uLdkvElMAZHjo7GnSiOKlWZfR tEHHrzTgiIRf4evMQEtOQ01OIdSU7zF/pxzl1qvDzamZlc5E1incx3cK9hai+JN+fx79 Yp6JP3jwYOzkJP0uRckNhQEYZgMihjHLErG+oJv8CXIxAJcHCeUbXfqFKhjwOmjWgie1 2DCPJ8H1TBw2MyVANoahzQ3pcXj+ULP9Y2yzH97aoC7h7rQ8zfB6uT0M/UwnqiaA1s36 yKgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="B/fNRAxw"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h29-20020a63121d000000b005b8f0c8ddbasi51451pgl.243.2023.11.02.10.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 10:48:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="B/fNRAxw"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B2202813550B; Thu, 2 Nov 2023 10:48:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234026AbjKBRrc (ORCPT + 99 others); Thu, 2 Nov 2023 13:47:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234112AbjKBRr2 (ORCPT ); Thu, 2 Nov 2023 13:47:28 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B82B137; Thu, 2 Nov 2023 10:47:22 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9d2c54482fbso199383866b.2; Thu, 02 Nov 2023 10:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698947241; x=1699552041; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8LZVQdmd+E8mUtJWBLZRWGzqUC4FZBj+7S3JJxwc7EY=; b=B/fNRAxwjHjApPsPjHqM9Gb4EGHfr6yz4yD75i2IH64fiXsTvOCKy14zKJMQ8zoYFe rtkiQiTFaT0pyaW80JlsSWd5lWeQGbxZN0pP6gHq80AiveLvqZZv0szWOjCGH91HWGxW oAfDB5n3WHZZsiIuuvQ1z8WO8JsAB5g67yZEUx+zVCXWRnOFK1NprvdNAupKFPzhhGGk EW3IBVTxVj/+eKU3ilIkij3aUvtssHTI8+A1DVBiQwL+UGovirAOTVNRHf6WTO0Oq9ik 4t4yecapsyn4+2ncWM0vrdxvKD/Xj4o6143XroD62PdI8gXh428apHfViJWC01gC45OH 8O3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698947241; x=1699552041; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8LZVQdmd+E8mUtJWBLZRWGzqUC4FZBj+7S3JJxwc7EY=; b=HetJz9/TRKdByt3MiKcwttj4huKhOqlkCusfvrGqIVb6JqOg9NcDG++gkR9VfSwSor QeZ7OPXI1zhWXGBe9Eu+ywUvScx0kwy8q6pf0DqebAc5XxzATqXtPBZQBHvIYcxFAAr2 VrvHtAMzcACpxiKv+pjbHTTlGDiQA0xZ+C9HR9eyFN2oyQP6TtX7iXMq1BxH+zKwsZL5 xM+jLT97jox2kYW+A2SNE4RbCV9gTI7CmHLLlMD9Uo/C1LWOZ2NyL2sWYzOPMc2v3nO9 qwu/T7SJ4faUaSjThCaLak9Ff5RHmbQzs+oEcUwqI5UNtogjzv1KZSH7sGoaWxaKJ2mr v84w== X-Gm-Message-State: AOJu0YxkqcfOr0dK0Ex6EuBAJVrzqNrjZSNUCHteySt5nj6HHDHhftSl FFr+9XImQwGaWErSr8LENlmWYjsNWe/trcMNkN8= X-Received: by 2002:a17:907:1c17:b0:9be:fc60:32d9 with SMTP id nc23-20020a1709071c1700b009befc6032d9mr4697800ejc.47.1698947240709; Thu, 02 Nov 2023 10:47:20 -0700 (PDT) MIME-Version: 1.0 References: <20231031134900.1432945-1-vadfed@meta.com> <91a6d5a7-7b18-48a2-9a74-7c00509467f8@linux.dev> <6947046d-27e3-90ee-3419-0b480af0abb0@linux.dev> <4258aabd-5f7b-4b7f-ab43-408b69bfdc58@linux.dev> In-Reply-To: From: Andrii Nakryiko Date: Thu, 2 Nov 2023 10:47:08 -0700 Message-ID: Subject: Re: [PATCH bpf-next v3 1/2] bpf: add skcipher API support to TC/XDP programs To: Vadim Fedorenko Cc: Alexei Starovoitov , Martin KaFai Lau , Song Liu , bpf , Network Development , Linux Crypto Mailing List , Jakub Kicinski , Andrii Nakryiko , Alexei Starovoitov , Mykola Lysenko , Vadim Fedorenko , "David S. Miller" , Herbert Xu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 02 Nov 2023 10:48:11 -0700 (PDT) On Thu, Nov 2, 2023 at 9:14=E2=80=AFAM Vadim Fedorenko wrote: > > On 02/11/2023 15:36, Alexei Starovoitov wrote: > > On Thu, Nov 2, 2023 at 6:44=E2=80=AFAM Vadim Fedorenko > > wrote: > >> > >> On 01/11/2023 23:41, Martin KaFai Lau wrote: > >>> On 11/1/23 3:50=E2=80=AFPM, 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 =3D 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 =3D 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_slic= e() > >>> kfunc. > >>> > >>>> create __bpf_dynptr_slice() which will be internal part of bpf_kfunc= ? > >> > >> Apparently Song has a patch to expose these bpf_dynptr_slice* function= s > >> ton in-kernel users. > >> > >> https://lore.kernel.org/bpf/20231024235551.2769174-2-song@kernel.org/ > >> > >> Should I wait for it to be merged before sending next version? > > > > If you need something from another developer it's best to ask them > > explicitly :) > > In this case Song can respin with just that change that you need. > > Got it. I actually need 2 different changes from the same patchset, I'll > ping Song in the appropriate thread, thanks! > Please also check my ramblings in [0] [0] https://patchwork.kernel.org/project/netdevbpf/patch/20231024235551.2= 769174-2-song@kernel.org/