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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5D25C3DA4A for ; Tue, 20 Aug 2024 15:19:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4127A10E0A4; Tue, 20 Aug 2024 15:19:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="XhV8y6cZ"; dkim-atps=neutral Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E55510E0A4 for ; Tue, 20 Aug 2024 15:19:28 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 151E5CE0A66; Tue, 20 Aug 2024 15:19:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 899F1C4AF0B; Tue, 20 Aug 2024 15:19:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724167164; bh=/OXYNA076GPRELh0pHtb1LqJyPMWNb0FBe4CzjTGaQs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XhV8y6cZBCxHcRXtyBXg5fkxQ0emSjT4auJjQk+246Tw8eD3OUCE057w6/vUhGK+Q RBjicnT8mi2sKTBuq0JANhVJTDhMvdUqDUjecxktxoY+vMrnz4MGVdsNOpaqcNAw9I 8huEtnENFiJFKoN9IcbUvsltqlewOPHIwnN9eFpsuawwCJvXkDlHhiXl7L7Wur0fpu tpAX/YFnzoaY+ZA/9o5gRvZTPhKxlmy+9Auiz50bY1SO6+EAmVeqJQ3ehrBxhx64mc 3Inbdd0jxjd2cxDx/Af/1fV60ySoP0m+sl/9zoj0NBHNWDP6FteTyA3BOpW4xPB0UC 8Lpljm3h/QgEQ== Date: Tue, 20 Aug 2024 08:19:20 -0700 From: Jakub Kicinski To: Mina Almasry Cc: Taehee Yoo , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, "David S. Miller" , Eric Dumazet , Paolo Abeni , Donald Hunter , Jonathan Corbet , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Andreas Larsson , Jesper Dangaard Brouer , Ilias Apalodimas , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Arnd Bergmann , Steffen Klassert , Herbert Xu , David Ahern , Willem de Bruijn , Shuah Khan , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Sumit Semwal , Christian =?UTF-8?B?S8O2bmln?= , Bagas Sanjaya , Christoph Hellwig , Nikolay Aleksandrov , Pavel Begunkov , David Wei , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi , Willem de Bruijn , Kaiyuan Zhang , Daniel Vetter Subject: Re: [PATCH net-next v19 03/13] netdev: support binding dma-buf to netdevice Message-ID: <20240820081920.6630a73f@kernel.org> In-Reply-To: References: <20240813211317.3381180-4-almasrymina@google.com> <20240819155257.1148e869@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 20 Aug 2024 00:01:02 -0400 Mina Almasry wrote: > Took a bit of a look here. Forgive me, I'm not that familiar with XDP > and virtual interfaces, so I'm a bit unsure what to do here. > > For veth, it seems, the device behind the veth is stored in > veth_priv->peer, so it seems maybe a dev_get_max_mp_channel() check on > veth_priv->peer is the way to go to disable this for veth? I think we > need to do this check on creation of the veth and on the ndo_bpf of > veth. veth is a SW device pair, it can't reasonably support netmem. Given all the unreasonable features it grew over time we can't rule out that someone will try, but that's not our problem now. > For bonding, it seems we need to add mp channel check in bond_xdp_set, > and bond_enslave? Sort of, I'd factor out that logic into the core first, as some sort of "xdp propagate" helper. Then we can add that check once. I don't see anything bond specific in the logic. > There are a few other drivers that define ndo_add_slave, seems a check > in br_add_slave is needed as well. I don't think it's that broad. Not many drivers propagate XDP: $ git grep -C 200 '\.ndo_add_slave' | grep '\.ndo_bpf' drivers/net/bonding/bond_main.c- .ndo_bpf = bond_xdp, $ git grep --files-with-matches 'ops->ndo_bpf' -- drivers/ drivers/net/bonding/bond_main.c drivers/net/hyperv/netvsc_bpf.c > This seems like a potentially deep rabbit hole with a few checks to > add all of the place. Is this blocking the series? Protecting the stack from unreadable memory is *the* challenge in this series. The rest is a fairly straightforward.