From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by mail.toke.dk (Postfix) with ESMTPS id A0A159CC124 for ; Wed, 7 Dec 2022 05:52:46 +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=m1VXeLq0 Received: by mail-pj1-x1034.google.com with SMTP id o12so16480099pjo.4 for ; Tue, 06 Dec 2022 20:52:46 -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=z1MllrK9qt7IPbxn8SLx0NFrqMVmB40d8EFuAkil31U=; b=m1VXeLq0luzQBQFRff9sX/js+wkR2gT50ESiyRrYq1E0mGU3fT3V+dffda1H9tPB9g L96pq0H9bodoeeM8K83cVN1LIQOfjUznPOMBezyeoufHH/gYEEOTA8yyqiQvE9nGze0x hKWqNSWzj84d2mpv5WqnhIYmpU5SHOTartUb9GLYuD5a16/yDWX7/oHGb53WtECo9a8/ vnisxdL4aXQY4vDxnzL94zdf7ZYK/cR1wYjO+K+SEir4nSVZfdnZXTarrY4nrzNecXcV k9QKmvROrb/DpUWyTlQA/xmuKl+GAtRy+jrXWoarZZvT0pQTy5V9osa4fU7dMKAv0rSx sSZw== 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=z1MllrK9qt7IPbxn8SLx0NFrqMVmB40d8EFuAkil31U=; b=XF0XtYvvXXrPysFtRpWKNJZDzA2v5WViwakhfhDEZ2lm5UEllDawfLVUQy0wxgUtt9 pmOUCRzm2A4Q6LZ3qQC+Xb6BmtFQBEjZTRXTDY9z+Gi2w60I4I/fJ5etrbpKK6Zl6KyC 0SYII7lGtIyfxJm0qLHJokTAxeZo3VFE8xn3kMhf3R7ATRiwZqtKaB557Op+cAPMo7Bc DtzgxRXRRxEUmnRD4odR1bX+PDqG83dUOECN01C2iNXonB+2+DtuNHrJ8TpakdfL6mUH X1wsIpa2KK6wTW4bm3F9DfpKcZ1v95deOz7j3scXvnzpy5gKm2fxmVkvEHWoumuI79g3 fjag== X-Gm-Message-State: ANoB5pmkvKp1wYFJb/T8Xd6r1o/oHAbsI0MW4Evmoq2Lxgt12nhvlSQe 37Zk7lmSdx1pjbmhB3Cj1C0VyJc9qr9u/pLQbWsnYg== X-Google-Smtp-Source: AA0mqf7jk6PKiimI2vjKH1e7HtJUBi0CkAsLinCRYQ3x4Sk0onLox4st2IRjcm8+NhsUA/9pMHGYqOUQjJaSFW/M/AA= X-Received: by 2002:a17:903:244c:b0:189:e426:463e with SMTP id l12-20020a170903244c00b00189e426463emr8905233pls.134.1670388764191; Tue, 06 Dec 2022 20:52:44 -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: Tue, 6 Dec 2022 20:52:32 -0800 Message-ID: To: Alexei Starovoitov Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: XXUXJUMO4NFLN5D3C3IHEUV73CGPK4KX X-Message-ID-Hash: XXUXJUMO4NFLN5D3C3IHEUV73CGPK4KX 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, martin.lau@linux.dev, 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 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 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. > I was hoping that BPF CI can prove my point, but it failed to > build your newly added xdp_hw_metadata.c test. Ugh, will take a look, thank you!