Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp424877rwp; Wed, 12 Jul 2023 16:00:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlF8qVYe3PGwDbk5f68wLUTycTa+oq70lF3jvrsHnouG7+A+pY+cwtdvY6ZKnSmLOUfLouSw X-Received: by 2002:a17:903:11c9:b0:1ae:10bc:4ae8 with SMTP id q9-20020a17090311c900b001ae10bc4ae8mr17191plh.26.1689202856095; Wed, 12 Jul 2023 16:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689202856; cv=none; d=google.com; s=arc-20160816; b=rZJpSYh415zL8kx1Fc/NfCydSn3eTfhnRvRBpfFVbKoLxUPzIVXuKChp9cZKgDA5Ku qZtvKeItO/CT/nbsJ9ReF+L0e6rLaQMX3IOV+qVLORRV6Gdyw/eG2P6T98onH9c87JMN DPrR7TlLWouHxRkOZijZ12svt3aONaFWJXHZjdvf2DCkx3IHGI5neKWXSaZKeS4kPt86 Fz9QnJ4db4oYNZeZUXNsJht8Ma6RHbBaEfAlbmCN9YfGpipK6+B+AQgM/3ZHBHNOmo9T ZMx4amyMTxHSzJ9ksthst2pcmHxHnLI8LXTy2/AydAynej0lOHYx+fP8eIw9gaxcdAu7 vsHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=mz/xfQs228JkD+EmKHVt4aMZuBD4Ky+nWhlpQiowkyI=; fh=fen5rpvsLxY13IMCamhJT4Y1dGSGHAmHlmc9vi/uIH4=; b=Q/mRQ4ADUguK9h4ju7g3A0FsGsBeJVnY4LVvuu29xg6i0ydJb4+8ZDzcbo6vfhlc6G k0C/rwwUQrPeEOZb9DYkoWm45UdhSeUc0iUdGVhKFj43Ucf5klrwbUNOvPW+pO1rJDK5 qVQ0Hb+RBxquPQ/GchooVCvBS1WjL6N7we4OLG4G1FNfJpHrXNmd7Xd/isXR0TfRV2jB gAN7PHxP6y3HHtftA4sZp4nSpbhCwmM1wiGQ+9AFcpa6pgUmaJFGMNhxQx+AlJdcvKsn w4bXts6PFdx90PGCt6y9gfwLeywZXPBtoyAkJLjpj0IZdJiQX97kV2TmnOK5lenjQgEX MuBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=3JuEXg+y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ij8-20020a170902ab4800b001a97e24eb34si3977068plb.201.2023.07.12.16.00.43; Wed, 12 Jul 2023 16:00:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=3JuEXg+y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232550AbjGLWmE (ORCPT + 99 others); Wed, 12 Jul 2023 18:42:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232554AbjGLWmC (ORCPT ); Wed, 12 Jul 2023 18:42:02 -0400 Received: from mail-ua1-x931.google.com (mail-ua1-x931.google.com [IPv6:2607:f8b0:4864:20::931]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0AF91BE4 for ; Wed, 12 Jul 2023 15:42:00 -0700 (PDT) Received: by mail-ua1-x931.google.com with SMTP id a1e0cc1a2514c-7943bfaed0dso16397241.0 for ; Wed, 12 Jul 2023 15:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689201720; x=1691793720; 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=mz/xfQs228JkD+EmKHVt4aMZuBD4Ky+nWhlpQiowkyI=; b=3JuEXg+yPSc6oD9k/gVHY9JmrXpcmYz2DdmUKfAenXycWth8Ys52+0sfJNBJqhx+JA POfjtfGzT4R2YWrxkgajUcAHuZwh0tHTbms8ZnyvNuUeIHHVBkyqjnNmi7pVjn+1p2XO FT+BJijgfx1i+WKA7jlT7PyuiJDtM4V2bSpZ2ORkcz5BPrprzhZVrwTkYbGJtevpuwWu +4s8IYxiO+jzUiXLxbNo6SvC/rtIpPMvBFlxMxrSFT5yrglpO/RRHqDNwsQ7XIWt3Mrm 6q7/TIQmwLLzR3bbJ6UgAadSF6ClWCYMawulX/tcO2I2umBPB5clyz54VDHR+jYWjASk +o/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689201720; x=1691793720; 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=mz/xfQs228JkD+EmKHVt4aMZuBD4Ky+nWhlpQiowkyI=; b=HZjq7+0iE4Rm9ObQLH9/UOzxsE3Npzso4GAKpZKusIZA8WkzRhgYmZnwR5PxpfmuCs /HEXcaW/KZinmJmjGNS2QfiLMs+fLMAweeHq6bVprSKaUlwIskYgsH+2wosasrvlux3S evjQcPWDg9DcNmbwgsOx8E/OPaDRIQzwNfQeZpDSrNTL0HRzIZhgyv0WHsGhwVQ56kt5 9cujv2ZIwpJIFYF6Mm+TH3hTAdLkl4HHkctQjKPbGt7z4egnJanULcld7JEPMzHqPBh0 i1jODQDKWnZ2hRcfjyJ0pm8Vbo3D18Q+lde7GnJ4gsPD1ptBVgkzqZAV4rEQljJB8yBJ J3Vg== X-Gm-Message-State: ABy/qLat5o5aQw3GaguNnoTxPp6LqBGmnMLpwTyH2vj7j3b7eF1v7AYv IBGgKAVg+6rx2NcTj+qeDSsDZGYd9/3wHvzJm3bG3Q== X-Received: by 2002:a67:b407:0:b0:443:4eca:f7f0 with SMTP id x7-20020a67b407000000b004434ecaf7f0mr99255vsl.11.1689201719631; Wed, 12 Jul 2023 15:41:59 -0700 (PDT) MIME-Version: 1.0 References: <20230711050445.GA19323@lst.de> <20230711090047.37d7fe06@kernel.org> <04187826-8dad-d17b-2469-2837bafd3cd5@kernel.org> <20230711093224.1bf30ed5@kernel.org> <20230711133915.03482fdc@kernel.org> <2263ae79-690e-8a4d-fca2-31aacc5c9bc6@kernel.org> <20f6cbda-e361-9a81-de51-b395ec13841a@amd.com> <4f6e62e0-b4c2-9fca-6964-28cfea902de0@amd.com> In-Reply-To: <4f6e62e0-b4c2-9fca-6964-28cfea902de0@amd.com> From: Mina Almasry Date: Wed, 12 Jul 2023 15:41:47 -0700 Message-ID: Subject: Re: Memory providers multiplexing (Was: [PATCH net-next v4 4/5] page_pool: remove PP_FLAG_PAGE_FRAG flag) To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: Jason Gunthorpe , David Ahern , Samiullah Khawaja , Willem de Bruijn , Jakub Kicinski , Christoph Hellwig , John Hubbard , Dan Williams , Jesper Dangaard Brouer , brouer@redhat.com, Alexander Duyck , Yunsheng Lin , davem@davemloft.net, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Bianconi , Yisen Zhuang , Salil Mehta , Eric Dumazet , Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Saeed Mahameed , Leon Romanovsky , Felix Fietkau , Ryder Lee , Shayne Chen , Sean Wang , Kalle Valo , Matthias Brugger , AngeloGioacchino Del Regno , Jesper Dangaard Brouer , Ilias Apalodimas , linux-rdma@vger.kernel.org, linux-wireless@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Jonathan Lemon , logang@deltatee.com, Bjorn Helgaas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 12, 2023 at 6:35=E2=80=AFAM Christian K=C3=B6nig wrote: > > Am 12.07.23 um 15:03 schrieb Jason Gunthorpe: > > On Wed, Jul 12, 2023 at 09:55:51AM +0200, Christian K=C3=B6nig wrote: > > > >>> Anyone see any glaring issues with this approach? I plan on trying to > >>> implement a PoC and sending an RFC v2. > >> Well we already have DMA-buf as user API for this use case, which is > >> perfectly supported by RDMA if I'm not completely mistaken. > >> > >> So what problem do you try to solve here actually? > > In a nutshell, netdev's design currently needs struct pages to do DMA > > to it's packet buffers. > > > > So it cannot consume the scatterlist that dmabuf puts out > > > > RDMA doesn't need struct pages at all, so it is fine. > > > > If Mina can go down the path of changing netdev to avoid needing > > struct pages then no changes to DRM side things. > > > > Otherwise a P2P struct page and a co-existance with netmem on a > > ZONE_DEVICE page would be required. :\ > > Uff, depending on why netdev needs struct page (I think I have a good > idea why) this isn't really going to work generically either way. > > What we maybe able to do is to allow copy_file_range() between DMA-buf > file descriptor and a TCP socket. > > If I'm not completely mistaken that should then end up in DMA-bufs > file_operations->copy_file_range callback (maybe with some minor change > to allows this). > > The DMA-buf framework could then forward this to the exporter of the > memory which owns the backing memory could then do the necessary steps. > I may be missing something, but the way it works on our end for receive is that we give a list of buffers (dma_addr + length + other metadata) to the network card, and the network card writes incoming packets to these dma_addrs and gives us an rx completion pointing to the data it DMA'd. Usually the network card does something like an alloc_page() + dma_map_page() and provides the to the network card. Transmit path works similarly. Not sure that adding copy_file_range() support to dma-buf enables this in some way. --=20 Thanks, Mina