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 112A0C4332F for ; Wed, 13 Dec 2023 02:19:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6367810E23D; Wed, 13 Dec 2023 02:19:16 +0000 (UTC) Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7433B10E23D for ; Wed, 13 Dec 2023 02:19:14 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 90941CE1144; Wed, 13 Dec 2023 02:19:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBD23C433C8; Wed, 13 Dec 2023 02:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702433950; bh=DQPF3GcanIRKcaZKx1G5ZSV6kAy0I6t5QN8G9OuMZdM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DyCeS9GmtbFGFSsFn5YSGcJgY03zFug1iziwTrwVmg/ZlNI8m4c58IveouykxEdqa EMnEhzuZ63StLiesj5cSjbJf4TmG4ZBa1yJ7JCzsdawYg44TMs0dyNRoLJ1GELn1tz mZ0ttW2DALNof274ibmywvx6VjyQmwZ21hJje2+EzxdBAhAbf2HCJYKHiiZ+1qP7MN awBRzsmBQJpRFMscNENawsc7TC/PSZAjpMEzMokycEPjSXZZ9oUEEmo+Oekfpv6dsz Lulob+ZQQMb5SPxcQHqSMtRg1Oa5btnY+jl5DG0GR/t04qzTQhWGqHRNhfn4l51+iE FdNU7DP2aIKOg== Message-ID: Date: Tue, 12 Dec 2023 18:19:09 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [net-next v1 08/16] memory-provider: dmabuf devmem memory provider Content-Language: en-US To: Mina Almasry , Jason Gunthorpe References: <20231208005250.2910004-1-almasrymina@google.com> <20231208005250.2910004-9-almasrymina@google.com> <20231212122535.GA3029808@nvidia.com> <20231212143942.GF3014157@nvidia.com> <20231212150834.GI3014157@nvidia.com> From: David Ahern In-Reply-To: Content-Type: text/plain; charset=UTF-8 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: , Cc: linux-doc@vger.kernel.org, Kaiyuan Zhang , dri-devel@lists.freedesktop.org, Eric Dumazet , linux-kselftest@vger.kernel.org, Shuah Khan , Sumit Semwal , linux-arch@vger.kernel.org, Willem de Bruijn , Jeroen de Borst , Jonathan Corbet , Christoph Hellwig , Jakub Kicinski , Paolo Abeni , linux-media@vger.kernel.org, Jesper Dangaard Brouer , Arnd Bergmann , Shailend Chand , Shakeel Butt , Harshitha Ramamurthy , Willem de Bruijn , netdev@vger.kernel.org, Ilias Apalodimas , linux-kernel@vger.kernel.org, =?UTF-8?Q?Christian_K=C3=B6nig?= , Yunsheng Lin , Praveen Kaligineedi , bpf@vger.kernel.org, "David S. Miller" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 12/12/23 6:09 PM, Mina Almasry wrote: > OK, I imagine this is not that hard to implement - it's really whether > the change is acceptable to reviewers. > > I figure I can start by implementing a no-op abstraction to page*: > > typedef struct page netmem_t > > and replace the page* in the following places with netmem_t*: > > 1. page_pool API (not internals) > 2. drivers using the page_pool. > 3. skb_frag_t. > accessors to skb_frag_t field are now consolidated to include/linux/skbuff.h (the one IB driver was fixed in Sept by 4ececeb83986), so changing skb_frag_t from bio_vec to something like: typedef struct skb_frag { void *addr; unsigned int length; unsigned int offset; }; is trivial. From there, addr can default to `struct page *`. If LSB is set, strip it and return `struct page_pool_iov *` or `struct buffer_pool *`