Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp7092836rdb; Fri, 15 Dec 2023 18:52:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8Iz8tmh81OJ7nbZqbcfCt9yP1Aem1u4b9V0SaJUzFZ3c9xEVA9P7k6oAwFHx431cFjPZS X-Received: by 2002:a05:6870:e2cc:b0:203:2406:7b67 with SMTP id w12-20020a056870e2cc00b0020324067b67mr6828700oad.104.1702695133430; Fri, 15 Dec 2023 18:52:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702695133; cv=none; d=google.com; s=arc-20160816; b=Cak+6Xr3D3NWQPXEgnEttCLL1PLRTiqsZ0XDqh/MySvCgLIw0uE864Vd2I+brYzhc4 8358ldYuiwpvYS+8196ted2GcCWnsX9RB+vzt+zKKgVlhb0S6omrsyWgkV4rRJatqtFo ao5fxqV0nEGNaxNSHZtApGmBeqUtyGNvpyKQgL5xZcKQRAu61VMMUfF1hBAin1/bawDl AfrgZoFIQEjSxTH6EoYoZR4rnBtF5E6wV5q5QuuSlHTPtVTkZcEEVducoKYaF+4GXSsa EAyqPlMjtXAhUDGwi/NpZA5ojWsen405Q+3GMOCvIRVYkzsXGAYl8m1OVzhGNjKzN0ib 2eng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=zcJC7T4FpfJ8UeD9PRDEFVEITs8Cm9en+JTaFV2Y8RY=; fh=3QgiV+YHQwUlmrzaxWNOPC/ZKCCgIQXa+SYLmNwnPWE=; b=nwz1t3jJ+pIO6MJlxhoPndnAmFS/TkK9fyHikptHf5pya48y+CB9lF2olmudGi7s2L 2h2vp7hS1Dtjd1llWfwQoM0OkaRG/4449DJ9BD9CeQ8lm2qfpQEbFGiuphGLPoP3BpGJ eBpsTjtiGFyEZZzoWpaIU0iVYCB+boHc3qzXjp9BZjv3f17nlRJ6g7tubKheANTpK/Jj D6voM1/QG7w015QIfAvePrmA8gn/h7Kz2MwtqfYUFa974GD3CLMAhXSKIqANv8qNzRnT V3A8NPfkksnBlLE4Bd/DMJLHjlBHp/4ZKqR7cW65y3cPIixq0dEu9LEOe3UZzuOZM1Nb W+rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q8wt3Inh; spf=pass (google.com: domain of linux-kernel+bounces-1974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bv129-20020a632e87000000b005c6bdab9e58si13684687pgb.668.2023.12.15.18.52.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 18:52:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q8wt3Inh; spf=pass (google.com: domain of linux-kernel+bounces-1974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1A017283997 for ; Sat, 16 Dec 2023 02:52:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 607D246A7; Sat, 16 Dec 2023 02:52:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q8wt3Inh" X-Original-To: linux-kernel@vger.kernel.org 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 6186412E43; Sat, 16 Dec 2023 02:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 615E2C433C7; Sat, 16 Dec 2023 02:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702695123; bh=wEadWnvCc/HfoIu80FLtOBCdt6lNEYIGt4Ee9W8bEjg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Q8wt3InhMLHP4VwWMxtLBaYe3KIX1lISFdsJfCNMYuN6LBF/tbvmujO/sscks2DP0 qabxY/Lv3ST8+XiAtfpeCmmt9Rw3NTPWReIFKDc8VnIoM1aQNyRZ6IOMs4lSocMGwH ClGUfqoazOPQtCpnh2M/dKPRR9nehaLyVlsdT3LDDeDHY3Cv9b6MN2yC8tRV6XZa3t QYjHj/d5BCuH73p6iErkWyO30jEcjW/wGMw12uB8rzMQCAzU9zhRX4QTbUg7KF/blS 4zPRshHn9VtyganOS93WrDYuFSSvr2uFMnv/NoM/BXLMvpTjb5oT26u6a0Um1tmTXC A+xUgIOjlTUqg== Date: Fri, 15 Dec 2023 18:51:59 -0800 From: Jakub Kicinski To: Mina Almasry Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Greg Kroah-Hartman , "Rafael J. Wysocki" , Sumit Semwal , "Christian =?UTF-8?B?S8O2bmln?=" , Michael Chan , "David S. Miller" , Eric Dumazet , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , Jeroen de Borst , Praveen Kaligineedi , Shailend Chand , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Thomas Petazzoni , Marcin Wojtas , Russell King , Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Saeed Mahameed , Leon Romanovsky , Horatiu Vultur , UNGLinuxDriver@microchip.com, "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Jassi Brar , Ilias Apalodimas , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Siddharth Vadapalli , Ravi Gunasekaran , Roger Quadros , Jiawen Wu , Mengyuan Lou , Ronak Doshi , VMware PV-Drivers Reviewers , Ryder Lee , Shayne Chen , Kalle Valo , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Stefan Hajnoczi , Stefano Garzarella , Shuah Khan , " =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?=" , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Jason Gunthorpe , Shakeel Butt , Yunsheng Lin , Willem de Bruijn Subject: Re: [RFC PATCH net-next v1 2/4] net: introduce abstraction for network memory Message-ID: <20231215185159.7bada9a7@kernel.org> In-Reply-To: <20231214020530.2267499-3-almasrymina@google.com> References: <20231214020530.2267499-1-almasrymina@google.com> <20231214020530.2267499-3-almasrymina@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 13 Dec 2023 18:05:25 -0800 Mina Almasry wrote: > +struct netmem { > + union { > + struct page page; > + > + /* Stub to prevent compiler implicitly converting from page* > + * to netmem_t* and vice versa. > + * > + * Other memory type(s) net stack would like to support > + * can be added to this union. > + */ > + void *addr; > + }; > +}; My mind went to something like: typedef unsigned long __bitwise netmem_ref; instead. struct netmem does not exist, it's a handle which has to be converted to a real type using a helper.