From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 466E2242D98; Wed, 28 May 2025 08:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748420268; cv=none; b=ZwabuFmPSpMC7m6gRqexAOq3p36Bl5iZMsolz54ODfOi2+4kmmUNYKbRUUeNNRAnn2WLrs/zt0ljwaBhsukAeuSgjXeDXGBvrEvFMZnFaahWjKzKXDHK91b/CgEcKOpOzZvF2XhQ3mSmhlWtc/zRTZBKBsDcj8cedhzBPouuSs8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748420268; c=relaxed/simple; bh=3mNsnGzG6uUwa8ptFauGd0YKJXwEUMSFZsODR54wFjc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dYcm8RQyYtvSZlu2BEmAZ6h4fzzx3KfebeiXt50cN7yWng8y8pWGa4SNRxjanIMmBuqFvtT39Kh9V67N5ORJa1wzgrBuhi3+VS74+g93QtOJJi2W/PYVorvXtkcA65mXeEMfu9BL5wKiNgRyAnJTLuHIiIcURDwe1N0IORnmZ6E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-669ff7000002311f-a1-6836c6a6c04e Date: Wed, 28 May 2025 17:17:37 +0900 From: Byungchul Park To: Pavel Begunkov Cc: Mina Almasry , willy@infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, kuba@kernel.org, ilias.apalodimas@linaro.org, harry.yoo@oracle.com, hawk@kernel.org, akpm@linux-foundation.org, davem@davemloft.net, john.fastabend@gmail.com, andrew+netdev@lunn.ch, toke@redhat.com, tariqt@nvidia.com, edumazet@google.com, pabeni@redhat.com, saeedm@nvidia.com, leon@kernel.org, ast@kernel.org, daniel@iogearbox.net, david@redhat.com, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, horms@kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, vishal.moola@gmail.com Subject: Re: [PATCH 01/18] netmem: introduce struct netmem_desc struct_group_tagged()'ed on struct net_iov Message-ID: <20250528081737.GC28116@system.software.com> References: <20250523032609.16334-1-byungchul@sk.com> <20250523032609.16334-2-byungchul@sk.com> <20250527025047.GA71538@system.software.com> <20250528012152.GA2986@system.software.com> <20250528050346.GA59539@system.software.com> <4d7a307f-d595-4020-8060-f3bc2f8f72ca@gmail.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d7a307f-d595-4020-8060-f3bc2f8f72ca@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0iTYRTHed7nvW04elq3J6OiRURadpcTdIOCHiooqL50f8m3Npoa05Ya hZpQrVwXo8taNLPyUrRYMi+I5BS1G9rCXGkaVlZUCzNF026vEfXtx/9/+J3z4cjYeEyIlC0J yaotQbGaRD2v/xSROyO/NtY8a/COCG7vTRFu9KVA/stSAdxFfgRf+1sk6K6pEyEvtxeDuyGL hx7vNwxvajskaL/eyUPF4RIMHSfqRcjOGsCQWVrAQaPfKcCZb9cwlKS/lOBJuVuEtps/BegM ZPNwz1XIQ7tzKdR6RkPvg48I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UUD Ey7DtVWvCNyoHxRho+UsfljpjXX2PhJbqi8x2PL1mgi/fdnE4M6byxRubJglcM7FKQbPjL2m 8JfmfgaXTEwT2FzbT+FuY5vogMsxcWisoFImC5qAsBixYuZKAZnY45zS2lyK0lCpkw6xLM9t 57/Ph+qQE0txm/nC9hnCwQznxdvt30gHu3I+/KcBq0iHxCzJTdK8ObuOchRrORVfnL/ymyUc 8Om9BtoxknImkl8cn2D+FC58163R3yOS8+btqx8Jx2GS8+ArVllH7MTt4ue7DcjB67hNfEtd B3EFSfT/2fr/bP0/24jIauSqVCfHy5WqEH9tnCJVrUzxP5UQb0G/vqD8wsrVBjRni7AijkUy Zwm+H6KQ0vJkbWq8FfEsKXOVZOzeoZBKYuWp5wVNwgnNWZWgtSIPlpKtl0QeEWKk3Gl5khAn CImC5m9LsE7uaSg6DdzPeVCmBKX0QfCLzGcn8/LfW0Y8C4KittiykgZbgw9HuNnCZ72yA47a 7pXt1T7JimxKmDjDHt93UH6jJ3L/oWxdccmesK1Ta6oCXa557I4YnaT9fC3K2xk+ps++LUGD j+iKxLLoMuTjt8E6FzStfmpLXhrwzJ8rpU0bn843yyitQr7Nm9Ro5T8B9lLpoQEDAAA= X-CFilter-Loop: Reflected On Wed, May 28, 2025 at 08:43:34AM +0100, Pavel Begunkov wrote: > On 5/28/25 06:03, Byungchul Park wrote: > ...>> Thus abstractly different things maybe should not share the same > > > in-kernel struct. > > > > > > One thing that maybe could work is if struct net_iov has a field in it > > > which tells us whether it's actually a struct page that can be passed > > > to mm apis, or not a struct page which cannot be passed to mm apis. > > > > > > > Or I should introduce another struct > > > > > > maybe introducing another struct is the answer. I'm not sure. The net > > > > The final form should be like: > > > > struct netmem_desc { > > struct page_pool *pp; > > unsigned long dma_addr; > > atomic_long_t ref_count; > > }; > > > > struct net_iov { > > struct netmem_desc; > > enum net_iov_type type; > > struct net_iov_area *owner; > > ... > > }; > > > > However, now that overlaying on struct page is required, struct > > netmem_desc should be almost same as struct net_iov. So I'm not sure if > > we should introduce struct netmem_desc as a new struct along with struct > > net_iov. > > Yes, you should. Mina already explained that net_iov is not the same > thing as the net specific sub-struct of the page. They have common > fields, but there are also net_iov (memory provider) specific fields > as well. Okay then. I will introduce a separate struct, netmem_desc, that has similar fields to net_iov, and related static assert for the offsets. Byungchul > > -- > Pavel Begunkov