From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by mail.toke.dk (Postfix) with ESMTPS id E03089CFC85 for ; Wed, 14 Dec 2022 19:43:25 +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=CbiNyqGX Received: by mail-pl1-x629.google.com with SMTP id m4so4288467pls.4 for ; Wed, 14 Dec 2022 10:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; 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=Tx/7Mp216A8Qn4MkEs5zUckwv8OVRFxV4QjTqd0INQg=; b=CbiNyqGXokWCN2cL1BOpasVzCtFhN251ShygUXi1pjW60rmJV0xCo+ACkgks+YLi8l VBXh+yBRWyyqu/+n/cj8CozSOPhPvAcJO6KkMfn+gpp+Pxd9jWhG2jTrqgqIkAr+htSn WK924z9B506T1W61fcdCtkZKlddt9Y/U5D8VCQ9prr39kGGHTHrzKMGkf/ZbVT0f3h1t bUbo9UFRAHmMkQzYSqHIR8bgTga86TPX7Rz9J/4IK6uq6l7jdn8zy9FNcsb5nC3lhgyq 8yjG17F12/RvNseOk8HpMHECJBjDtyfY50XnoLEPSjto0patR9nDJaN5h97ooovo7PiD OHoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Tx/7Mp216A8Qn4MkEs5zUckwv8OVRFxV4QjTqd0INQg=; b=wOeb6Foxvb1ah67r/QLY+IXz9sEfWBqpiE3Ow2Kt1rS9y/HXLRxgv4iRQU2IdfLtFk 8+hn0/eM4dlyiJPomyZco1yuJOI4i4TWOYCYAxJO6F5LxMNYglTwDp1vseNtY86HP/DY xRRPVptF+w2yPVYqoVqIeMGvGDKWtuKmNfwxeWTZmySvm1whJAYwZJeV5oNwc/fPazYQ fFJnV6fy/FnjEwd2v3kyv+mTwY0WtTsR4a3RFkOLz9CuHdMlZCR/e4fHFVftdiE3PvB6 hV9tq6ZxAXNUc2C7g0JBdA8Qimhx/hh6LvtYJ6oUKCkUU4vLhCnHX+o2krprZefhmv5o IStg== X-Gm-Message-State: AFqh2kr8Ag2pUqnuCNNHqiSyvpDDVKyYhn2OWfW96gC3oXRdYz4PYKjT L9DHtoIhwPL+KcBQExjvTmVFpyV6l6+tocSYe9Kxhw== X-Google-Smtp-Source: AMrXdXvV8RpCmYV9v26ONL+pUVX8We2euBkV5+QFga91DzGAQW2UtthS9Px0f7kaA/qqn9tRNMowjHwWmevy1HbYgNQ= X-Received: by 2002:a17:90a:b386:b0:219:fbc:a088 with SMTP id e6-20020a17090ab38600b002190fbca088mr498018pjr.162.1671043403879; Wed, 14 Dec 2022 10:43:23 -0800 (PST) MIME-Version: 1.0 References: <20221213023605.737383-1-sdf@google.com> <20221213023605.737383-6-sdf@google.com> <877cyugsrb.fsf@toke.dk> In-Reply-To: <877cyugsrb.fsf@toke.dk> From: Stanislav Fomichev Date: Wed, 14 Dec 2022 10:43:12 -0800 Message-ID: To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 43HJA74OFFTTB4CS6YETBXPYDNMW2FZG X-Message-ID-Hash: 43HJA74OFFTTB4CS6YETBXPYDNMW2FZG 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 v4 05/15] 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 Wed, Dec 14, 2022 at 2:54 AM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > > Stanislav Fomichev writes: > > [..] > > > diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c > > index d434a994ee04..c3e501e3e39c 100644 > > --- a/kernel/bpf/core.c > > +++ b/kernel/bpf/core.c > > @@ -2097,6 +2097,13 @@ bool bpf_prog_map_compatible(struct bpf_map *map= , > > if (fp->kprobe_override) > > return false; > > > > + /* When tail-calling from a non-dev-bound program to a dev-bound = one, > > + * XDP metadata helpers should be disabled. Until it's implemente= d, > > + * prohibit adding dev-bound programs to tail-call maps. > > + */ > > + if (bpf_prog_is_dev_bound(fp->aux)) > > + return false; > > + > > nit: the comment is slightly inaccurate as the program running in a > devmap/cpumap has nothing to do with tail calls. maybe replace it with: > > "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." SG. > Also, there needs to be a check in bpf_prog_test_run_xdp() to reject > dev-bound programs there as well... Ah, totally forgot about this part, thanks for reminding! > -Toke >