From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FF99C4332F for ; Fri, 23 Dec 2022 04:06:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230106AbiLWEGp (ORCPT ); Thu, 22 Dec 2022 23:06:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235120AbiLWEGn (ORCPT ); Thu, 22 Dec 2022 23:06:43 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3357BE29 for ; Thu, 22 Dec 2022 20:06:42 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id gv5-20020a17090b11c500b00223f01c73c3so6774714pjb.0 for ; Thu, 22 Dec 2022 20:06:42 -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=VLyozpzqTG5bFTysajq5LMUmZI4JC2pRucbpWfjHY5B1KYq6QI6ofd8VxIusZfmCSF 919vWKMouNsBt36GkSWc64/IAcdKoLEhIeha4JhoQBhIGNyQ3jr+lJp/MUpKX0YRhYlC uxvIkwA4gI9/+BqJdjvYmDjDa4VZrk/VP25uIrBjxywVVgFHvVrPN4Z0kzXlHMA1oVq0 /06ochkrWeMhC77TcKDbJwvY5EV3FPgYymFCMDrNcMqvzDoebjXNAW6IENIZVpCNxJav 6gX3+fuQo1wP+XRNmryLvgYMmT4mc/Nqnl8RLf+Y98ouiTyuEDkgmNyXxizN9fJLrRgA Cg6A== X-Gm-Message-State: AFqh2krdRgEtZiwsHoKyZoPLlj/Y+PIaVrPx2Fo6OXRzEhwo/RdC/lIw +nr9zeWd/jlof9Eikwud47zQ8UMBf/rUItgO76Qs+w== 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: Subject: Re: [PATCH bpf-next v5 07/17] bpf: XDP metadata RX kfuncs To: Martin KaFai Lau 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org 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. >