Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp464420rdb; Thu, 2 Nov 2023 08:36:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMerpacKA6x0KTTlYFf1YeQdqYBtwqk2seGpajHTUPYsAB4qWwMidaJVv4XXK4BHwcltqC X-Received: by 2002:a05:6358:7209:b0:169:4c8a:7eb7 with SMTP id h9-20020a056358720900b001694c8a7eb7mr26519455rwa.4.1698939393504; Thu, 02 Nov 2023 08:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698939393; cv=none; d=google.com; s=arc-20160816; b=uwSRk83iJg/yaB1V6eQ+I+tPSC3KBRD6ZTRc1+g5UBlkCpWKfFNvSkprINsmKV1U9V Adq87E5Db5ZJConncOgrRR/ItVqd3jhNzzhsQhYkSfSYHiTTNBpHtbkBnWef3uinvrKB Qu00OWsMn9JWDgpRtkm1YzdNy1Q6PnBslmbz/C0dZjmt5mFgn3dvq0xoV6WUTFgJc0ja CGUGx9uCllKP4NYFLa8QNvzVrVkLOlnPYte+YSRAm0DmVgrqk0Ioou3o3mR76RZegscK HWX5i/sK1h99H5ku62gE/AbiV/1sKc/axWPFKtFNpNqxPBUQxywk03nwLs7xfYxbRfEP AMlA== 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=rMOgTTQfwkBYFLdv7N61GXnKXP7EQxg4GSCDuZfxSVE=; fh=2vLwziprQzO6GXHzU8NaLC1h5FR1syHfEsAhTbGqFpw=; b=N4FEi410wkO+NR8ceAw8QF/WpkOieYQg+b0RANP0+7vBKApWNu93MSYDQg3XWXNRUZ a4IO+2PgggqmMW09t7ufK3mbZ9g4tvPZo/lHfAb3ZorynjfOiiT6dhp/TRdbFhSAX0B3 o5cq/36kHz4AS+YlmcYxIDUmNpJirbPvoAJD3QmlspHCcCHGqu+kNj1A5LTISnMssj05 rZZ5d3FbrlOmRJwHuxcrzbdXrsppKU/+D1S7LzADRVO56rcGNlibi++7rtcJa8jZiO52 jueoaH4r8+pC/Li/3EPxTyH0O0T5DE+VllMLF7Ql9JtXO4INwswxVnDYOv4CsP/jvNZU 2cUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ablWAJNk; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id z123-20020a633381000000b005bcfc4fffe4si1995285pgz.187.2023.11.02.08.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 08:36:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ablWAJNk; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.32 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 E50B1811545F; Thu, 2 Nov 2023 08:36:24 -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 S229553AbjKBPgY (ORCPT + 99 others); Thu, 2 Nov 2023 11:36:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbjKBPgX (ORCPT ); Thu, 2 Nov 2023 11:36:23 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2018913D; Thu, 2 Nov 2023 08:36:21 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32d895584f1so590607f8f.1; Thu, 02 Nov 2023 08:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698939379; x=1699544179; 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=rMOgTTQfwkBYFLdv7N61GXnKXP7EQxg4GSCDuZfxSVE=; b=ablWAJNkQQWGVKn+b9pesKMaI+ip0/gUGr5aSysYd4CdbcP4R04p1DemSukWlf9JSV ifPq+hdkX7stZ1vVxbAmXU4+d25nt3CUcYEZsIbsQSstmtotzQ7aj0K0UVHiuaSyhZcg kF8SrnU1KnURlTOdQZMWNZRJIlIzeJix/KOuO0FIxA8gcSuTLqkMBUcM6HlnyQhfzayr tSs8l/Ddby2STqHO7B/psBqdHihpSSsGqg12uiwcoeOaPp1ZXThgBSjxa7Te39AcA63y Ziv3Jfo1fBL56O57LenZRxgOGwfGq93MA85EV18xS+VOxiocChzN4oSOg60IPoBdJ/5I qLrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698939379; x=1699544179; 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=rMOgTTQfwkBYFLdv7N61GXnKXP7EQxg4GSCDuZfxSVE=; b=HhPfPO8PoTfKf0VE15X5Yn026HCeE/TVtQ66KZaOytfJZsRNxcK3qug2zzAyZSwBJr wEA7QVR/FrYfKAFv9pecTf6OjKFfpZIM3piNZH2BlsuZo1UQbX2A6h7DsamYckWfY8Pa wS2dKnAl6mehF0kVKdZ66AFTq+oJCH3Re3EE2MMb4kt1V3EHT7wqReFHnS8lFhlVUED1 zDUPvi0JK4doFEmAIEGCjId/3skODcz3TqAeRNwIC8rm4FA6nbXAku/vOlgUzqgaTO4l PzSUZCDpiTsRg7aTNdMPGzCdVaSoxLyyZH8Ar93iiZ6QLoHBjCk9ecDEpdvuGMsnAPOW UhUg== X-Gm-Message-State: AOJu0YzJL9ZSUTmZGK4EG4NU2UyC640vjlWHPfBUJ3qPKcr0BZKu4aYT /BJsZgTJbUYxX5S4PDHgPuAb1NsdV8oHKdyvDGE= X-Received: by 2002:adf:d1cb:0:b0:32f:8966:c39c with SMTP id b11-20020adfd1cb000000b0032f8966c39cmr9632234wrd.71.1698939379259; Thu, 02 Nov 2023 08:36:19 -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: <4258aabd-5f7b-4b7f-ab43-408b69bfdc58@linux.dev> From: Alexei Starovoitov Date: Thu, 2 Nov 2023 08:36:06 -0700 Message-ID: Subject: Re: [PATCH bpf-next v3 1/2] bpf: add skcipher API support to TC/XDP programs To: Vadim Fedorenko Cc: 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 08:36:25 -0700 (PDT) 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 *pt= r) > >>>> +{ > >>>> + 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_slice(= ) > > kfunc. > > > >> create __bpf_dynptr_slice() which will be internal part of bpf_kfunc? > > Apparently Song has a patch to expose these bpf_dynptr_slice* functions > 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.