From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by mail.toke.dk (Postfix) with ESMTPS id 87B009D3D10 for ; Fri, 23 Dec 2022 05:06:44 +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=InIJ9eEL Received: by mail-pl1-x636.google.com with SMTP id d7so3864104pll.9 for ; Thu, 22 Dec 2022 20:06:44 -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=ITHvQmWzjt4zer3CNXL+osA3IW9wZQ/oBnc+oe/0zSw=; b=InIJ9eELcaHbC4ZGs2CubzdiThHLMg3Vm3VB2egMysUQ/r5hsNMnYn8XBxcl8GfXNx O/NbaIcrDdfxhOcamgiVUL7lJI2E+GXVZMc195RwgumHv2+VZo8v7ujVXzGwFDXPRqb3 OJbzELAf/jESJCsaNyeEFTAPYzwUHclacPV0rdQDzgXZZkq9b54PY1vBspnmujNYK0UI 9nsI0l9Ptvr8B0JwUVshGjN/muG5MBOeX97/OxAKvYEiDXRv5/tYPhpHu/Du7Wn/j2Ly oEMItfN3065mt5+5Q/D1CD77tDondCXtbDxti5J0pKG+U9KjcK+hVAa6gOQZamQux1f9 XFUw== 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=ITHvQmWzjt4zer3CNXL+osA3IW9wZQ/oBnc+oe/0zSw=; b=v9vAILs1nhZrzQwBULXCdn9DQZHS7V326EtCyFxRYClsD69Ri+rLMhqsDMacyyeW3O R7psoogGE50gOV/Jt6F2iK1iX9eSqd5fJfaqshGPl0YjuCHPOe6frYK/9uDKfdFmlYi8 UCE0Nk8KjXi8/tCb8gTmh+HRvcs+JqUfe+sokEOHl8UQMnujHn9gLUVb4AVJLpGjIgq+ RN0sn7SAva0rrYm+YJIWn/qIk07HTEMr1uyF+vx98FF/Voc5AEiV83Ebv6EcinZH2w81 o+8pd+BD2+EN3Dp12Gk+d/ZIHh3YAF7fx6yuMxuW31fx/edsJuumG9aXdNrLTBvJtsFa OyCw== X-Gm-Message-State: AFqh2kqawv/tSyUs/m1raHNdh/eUhmlI5bM6iX7LqmBThX90eVkJlgxt JkByv9gBXijuTnvYLLQFxiWUVMmZAyRGEbopSzcLlw== X-Google-Smtp-Source: AMrXdXtqE79Qj/QkPzBcfCF0FkxqqExxPPwynaoKhVENrm5UQrlSkX7IPplsQHXCangdFGrfm4K9w8E5n48UhPQ7b+Q= X-Received: by 2002:a17:90a:8b92:b0:218:9107:381b with SMTP id z18-20020a17090a8b9200b002189107381bmr723809pjn.75.1671768402262; Thu, 22 Dec 2022 20:06:42 -0800 (PST) MIME-Version: 1.0 References: <20221220222043.3348718-1-sdf@google.com> <20221220222043.3348718-8-sdf@google.com> <00810419-c76c-32da-16a6-27c1029e3a60@linux.dev> In-Reply-To: <00810419-c76c-32da-16a6-27c1029e3a60@linux.dev> From: Stanislav Fomichev Date: Thu, 22 Dec 2022 20:06:30 -0800 Message-ID: To: Martin KaFai Lau Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: MY5J7JRPMZP47DE3HGQMKUOOP7PCL3RZ X-Message-ID-Hash: MY5J7JRPMZP47DE3HGQMKUOOP7PCL3RZ 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: 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, bpf@vger.kernel.org X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v5 07/17] 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 Thu, Dec 22, 2022 at 4:31 PM Martin KaFai Lau wrote: > > On 12/20/22 2:20 PM, Stanislav Fomichev wrote: > > diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c > > index bafcb7a3ae6f..6d81b14361e3 100644 > > --- a/kernel/bpf/core.c > > +++ b/kernel/bpf/core.c > > @@ -2097,6 +2097,14 @@ bool bpf_prog_map_compatible(struct bpf_map *map, > > if (fp->kprobe_override) > > return false; > > > > + /* XDP programs inserted into maps are not guaranteed to run on > > + * a particular netdev (and can run outside driver context entirely > > + * in the case of devmap and cpumap). Until device checks > > + * are implemented, prohibit adding dev-bound programs to program maps. > > + */ > > + if (bpf_prog_is_dev_bound(fp->aux)) > > + return false; > > + > > There is a recent change in the same function in the bpf tree, commit > 1c123c567fb1. fyi. Thanks for the heads up; looks like it won't conflict, right? > [ ... ] > > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > > index fdfdcab4a59d..320451a0be3e 100644 > > --- a/kernel/bpf/verifier.c > > +++ b/kernel/bpf/verifier.c > > @@ -2081,6 +2081,22 @@ static struct btf *find_kfunc_desc_btf(struct bpf_verifier_env *env, s16 offset) > > return btf_vmlinux ?: ERR_PTR(-ENOENT); > > } > > > > +int bpf_dev_bound_kfunc_check(struct bpf_verifier_env *env, > > + struct bpf_prog_aux *prog_aux) > > nit. Move the dev bound related function to offload.c. &env->log can be passed > instead of env and then use bpf_log(). Sure, SG! > Others lgtm. >