From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by mail.toke.dk (Postfix) with ESMTPS id 2CD7D9CC773 for ; Wed, 7 Dec 2022 19:06:01 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=Prd6LTqR Received: by mail-pg1-x531.google.com with SMTP id 82so17106754pgc.0 for ; Wed, 07 Dec 2022 10:06:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=C3DV9l9zsQfHltjnuJ5yMubwGSae2S2bmpGgboE2nP8=; b=Prd6LTqRLZeS8XTw/gvJ8Q2gfHm1a5NPKg+JTD0/GTWchbjrAbYTQ5V9AeyT7EJM9R durRWfVvMEdRtO/jdT33KU3R03JL3vLoNpiAMW4UZu/vbTajASHlSfbQ4Ej5+0vcRAt4 5/I6XAxEef25yBisdlJ10CtucOW+YzKoN6SruxL7O/MVe23ShZiOpx0+5x3NdNciP+Gr xLliSHt1QbVRGvJHoWQ4S4wnkse0PQ2cMshCe0J3YqcCx/s3eghN9aZau+g+IKs5r9Ed yVvGeENXNWqYYV45QSNHmyJHJS1HM8YWVezFReXZUxZbkyAYbbNBArGrhHJic5x4u4gs 9qbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=C3DV9l9zsQfHltjnuJ5yMubwGSae2S2bmpGgboE2nP8=; b=jERBVv2iEJwjwPTAvyCchbN0BraDNdsbTg7aEu8zVZEvTQ+3i/oywqnVl8ZKMj0OJ5 4/Y2Jy6g6JBezttwKLiGYjbhzE+t8+WzX5u865gRU5dy8hOIu5iy8x9Qo/iwKWaqJAz2 Njh+dj0hkCa6QUDspLXzApEQHzNbVTQ23/g7vjF/QZLbnXj3jNCE65MA2Y7yS+wuSCks G9bITVBkIa9MrBzfr6/fsWDr16MEldFfzXPApE4U7AjWG+wUSJO8s7fZUvLdcGwmX5nL 8/XI9wwHv/jOHz81LxqjMSFu9lnW+hNsLVJx7Nbn+RKpmCwaF/31V2NmfD5bX6gmu1wU K6zw== X-Gm-Message-State: ANoB5plrbZoymO+cftoBJBAzgaKt4MsQHwIfuFGzkYiegbSyN3/6T96r a8QutgyO9oMWgfeUGRlzn80YW0HSA7e3bWU50ndQLw== X-Google-Smtp-Source: AA0mqf6V98W1Ea96QHbk4wRxDCKU/FpjbtMSK4RNn96lTbLyo7G5+5AtMHilaQI2eAgDXLqxNz2hHPUDW+FUaLdQDNo= X-Received: by 2002:a63:1747:0:b0:478:1391:fd14 with SMTP id 7-20020a631747000000b004781391fd14mr44296746pgx.112.1670436358455; Wed, 07 Dec 2022 10:05:58 -0800 (PST) MIME-Version: 1.0 References: <20221206024554.3826186-1-sdf@google.com> <20221206024554.3826186-4-sdf@google.com> In-Reply-To: From: Stanislav Fomichev Date: Wed, 7 Dec 2022 10:05:46 -0800 Message-ID: To: Martin KaFai Lau Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: P3NPNK2AW2PIHFLMMDMCVAWOIJDSPEWV X-Message-ID-Hash: P3NPNK2AW2PIHFLMMDMCVAWOIJDSPEWV X-MailFrom: sdf@google.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org, Alexei Starovoitov X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v3 03/12] bpf: XDP metadata RX kfuncs List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, Dec 6, 2022 at 11:24 PM Martin KaFai Lau wrote: > > On 12/6/22 8:52 PM, Stanislav Fomichev wrote: > > On Tue, Dec 6, 2022 at 8:29 PM Alexei Starovoitov > > wrote: > >> > >> On Mon, Dec 05, 2022 at 06:45:45PM -0800, Stanislav Fomichev wrote: > >>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > >>> index fc4e313a4d2e..00951a59ee26 100644 > >>> --- a/kernel/bpf/verifier.c > >>> +++ b/kernel/bpf/verifier.c > >>> @@ -15323,6 +15323,24 @@ static int fixup_kfunc_call(struct bpf_verifier_env *env, struct bpf_insn *insn, > >>> return -EINVAL; > >>> } > >>> > >>> + *cnt = 0; > >>> + > >>> + if (resolve_prog_type(env->prog) == BPF_PROG_TYPE_XDP) { > >>> + if (bpf_prog_is_offloaded(env->prog->aux)) { > >>> + verbose(env, "no metadata kfuncs offload\n"); > >>> + return -EINVAL; > >>> + } > >> > >> If I'm reading this correctly than this error will trigger > >> for any XDP prog trying to use a kfunc? > > > > bpf_prog_is_offloaded() should return true only when the program is > > fully offloaded to the device (like nfp). So here the intent is to > > reject kfunc programs because nft should somehow implement them first. > > Unless I'm not setting offload_requested somewhere, not sure I see the > > problem. LMK if I missed something. > > It errors out for all kfunc here though. or it meant to error out for the > XDP_METADATA_KFUNC_* only? Ah, good point, I was somewhat assuming that xdp doesn't use kfuncs right now and I can just assume that kfunc == metadata_kfunc. Will make this more selective, thanks!