From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3542125AC; Tue, 13 Aug 2024 14:33:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723559603; cv=none; b=VHuIgvml+PBqZWL9UhpbY8Qs+GhGbakWSD4iYvOpI4WLd0vnNUT1xG+eVIGvW7d/H5KXjGa/GQX/qNZtN8DzwfygMcolb6Bz3Q7uGqlZ2q5Cycd3tIpScOWI5lyeveMYIh8cnCzPPzDo+v2p6JSkn9gYK2bwpP0cz5U+l50iGaA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723559603; c=relaxed/simple; bh=sFtPPJXw+oDaZO18986PArH/7XXzUe8DO5XJvEGKSxM=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Gwg/AnhkoZfbqdTnPRlXLcytcUtSTZKMmziQ0ia9oua4R8gmyf99ef19r9HDjOo/Ttz89Gi0/ErZXh2CmAwXxBW1UacS+laV7ttZL4l+v74uFBo1rB86nEm/Z5V65i0IxJfKmWqi0o58SNYCEJOYWgtWIxbIyWlIrPjTq0KI1QM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nAXt0UBa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nAXt0UBa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44B31C4AF0B; Tue, 13 Aug 2024 14:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723559603; bh=sFtPPJXw+oDaZO18986PArH/7XXzUe8DO5XJvEGKSxM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nAXt0UBalXvRn5zwD1LdgdqfsSHBNoAVzH7FOq28vl2bdsMsjXxBOPrVhyzduT5fk ZOdKEve+Q7qIR8SptTGdTkU+N79oXR6c72PuXovvAWYmTa+/i3BSLJNHB7fJkcnSTB ZnBanDEqYplCz3PPD5kCrTc5ETqDkdCcdBL2+J+HckGXQkmZtVedZyW8AlPfQC44lJ 3UDTeCym8iKlUNEnnYvc+JLEW4/esRUVAGrYu45/ASzO9kqLwDXCMY6gZQdwHE85Oq G2WszNB9e7ZDzWCR7R0rryd3z94kTMCr7pUSaJQBgF4tsx7T66UCmY0QRAgVQWENY0 /cgHRiYx1Af9A== Date: Tue, 13 Aug 2024 07:33:20 -0700 From: Jakub Kicinski To: Mina Almasry Cc: Pavel Begunkov , 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, Donald Hunter , "David S. Miller" , Eric Dumazet , Paolo Abeni , 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 , Sumit Semwal , Christian =?UTF-8?B?S8O2bmln?= , Bagas Sanjaya , Christoph Hellwig , Nikolay Aleksandrov , Taehee Yoo , David Wei , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi , Willem de Bruijn , Kaiyuan Zhang Subject: Re: [PATCH net-next v18 07/14] memory-provider: dmabuf devmem memory provider Message-ID: <20240813073320.3e5c3a7e@kernel.org> In-Reply-To: References: <20240805212536.2172174-1-almasrymina@google.com> <20240805212536.2172174-8-almasrymina@google.com> <20240806135924.5bb65ec7@kernel.org> <20240808192410.37a49724@kernel.org> <20240809205236.77c959b0@kernel.org> <48f3a61f-9e04-4755-b50c-8fae6e6112eb@gmail.com> <20240812105732.5d2845e4@kernel.org> <7e2ffe62-032a-4c5e-953b-b7117ab076be@gmail.com> <71260e3c-dee4-4bf0-b257-cdabd8cff3f1@gmail.com> <20240812171548.509ca539@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 13 Aug 2024 04:39:47 -0400 Mina Almasry wrote: > On Mon, Aug 12, 2024 at 8:15=E2=80=AFPM Jakub Kicinski = wrote: > > BTW, Mina, the core should probably also check that XDP isn't installed > > before / while the netmem is bound to a queue. =20 >=20 > Sorry if noob question, but what is the proper check for this? if (dev_xdp_prog_count(netdev)) > I tried adding this to net_devmem_bind_dmabuf_to_queue(): >=20 > if (xdp_rxq_info_is_reg(&rxq->xdp_rxq)) > return -EEXIST; >=20 > But quickly found out that in netif_alloc_rx_queues() we initialize > all the rxq->xdp_rxq to state REGISTERED regardless whether xdp is > installed or not, so this check actually fails. >=20 > Worthy of note is that GVE holds an instance of xdp_rxq_info in > gve_rx_ring, and seems to use that for its xdp information, not the > one that hangs off of netdev_rx_queue in core. >=20 > Additionally, my understanding of XDP is limited, but why do we want > to disable it? My understanding is that XDP is a kernel bypass that > hands the data directly to userspace. In theory at least there should > be no issue binding dmabuf to a queue, then getting the data in the > queue via an XDP program instead of via TCP sockets or io uring. Is > there some fundamental reason why dmabuf and XDP are incompatible? You're conflating XDP with AF_XDP, two different things, slightly related but different.