Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6807107rdb; Fri, 15 Dec 2023 08:48:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBSZ/HWfkTlT/J5CMKbj3MkfAwMBgXORBr7KaZ6SAJUHM02RFqAXeEmEpbg9ii56Iara09 X-Received: by 2002:a2e:a3d2:0:b0:2cc:4dfd:5e05 with SMTP id w18-20020a2ea3d2000000b002cc4dfd5e05mr527970lje.101.1702658897186; Fri, 15 Dec 2023 08:48:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702658897; cv=none; d=google.com; s=arc-20160816; b=Dd7e9zBHH9XGZfCDJsuY1jLJjQf6xFsoz0byGHNlHfd0Jy3lEwrbsuPIochHDmVhiH Bgq+YBdMdBIZFoSITz173vNSaokabHBcjC1PiaTilycvkrSuOlYjCVB4j4tdwlzrVQSL qEqxMoM/kWYlY4aV0KPoAmf29c7kas4+Q1Ufqf2hDvndRFYAvtSaBQ2TpIJcXIJAQDT/ FY+ARcifIMO5JHxIBeqJA56aNXib+Z7DtoJPEzQcEYztqORFNsQEUIT4izRWGq3Z1uPJ Z0/094/gvhbD3scQQZNkvBwmz2/K7tOBDo8cRQi43Ha1JV/x3r8zTL53xmZqdGjT0tFK QgAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=pFF1dta+xlyg8MLdIwibfZN3TDA+ceWGZnTEl/bvSYQ=; fh=rOyE9qt1+SgL5C5M+1w+CzGW5rP1YCGlLR4oc4WSe0g=; b=KyC7pSEGAR7YjpoH0p229xgdEGyTlvNAAX5gd72ZM4Qqg4j/IYeNpZwpk/uKeJ48Y0 1TWTwqc3ckJztZPrk+elAZVnQQeMoAX7IBa6V1wjosEKOYZclwvllnFtxWNQkhSXtnc3 sBnYBdsJ7/hD7BtIf+PoLukfsfAipiPC0pumhIEKveOmwdlVibqqErpB8jzJGqzSkFul og4quIE8+W9mxrX6XbdilOuBJdor1n0bp/dk4z86WYcvuGykyARv44L3XwwC0hAoCO9z ZK6YXEWUTDYrmIjW73yhbDmgJNjxi98uEMhM/WHGr2MUoyGbVGJSeGHRLl9KDhLrHXfO m/sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bXSXDzSB; spf=pass (google.com: domain of linux-kernel+bounces-1328-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1328-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e7-20020a056402190700b0054f64f49accsi6778198edz.305.2023.12.15.08.48.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:48:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1328-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bXSXDzSB; spf=pass (google.com: domain of linux-kernel+bounces-1328-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1328-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id B3C291F21479 for ; Fri, 15 Dec 2023 16:48:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F8AE3EA6F; Fri, 15 Dec 2023 16:48:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bXSXDzSB" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AEDA3DBAC for ; Fri, 15 Dec 2023 16:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d394cd331aso23325ad.1 for ; Fri, 15 Dec 2023 08:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702658879; x=1703263679; darn=vger.kernel.org; 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=pFF1dta+xlyg8MLdIwibfZN3TDA+ceWGZnTEl/bvSYQ=; b=bXSXDzSBSErBYcDeSf04Oo/6R6KqHXIJ+J+UecNGsyyGc36MaoAYOxn8eNe4iyKOQF wxqNrO3f/8yyOsPdjso8UbmhlJwHZFDy9N8ICOxKoPX/9W04NuTzJInOW7r9Z69ZTjX7 FbdVV80pAEbOx0wOznxquDjqLGoER5vNn6NFHuM2hmUvXlU/XA/gC6SniHJXjvJmURes FhWjTvknjXByoEo7eWAzor1aGBToDmpanONBT3eCSkN6YHhRgRUKrMMDzkAuW+fZljUV 74P+kNT9M6eLqYz5PUmqEJRQUBHxiLyyNoG0lMRi4CRiz0x1NKtYB6fasW83xPFyMK+V +xNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702658879; x=1703263679; 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=pFF1dta+xlyg8MLdIwibfZN3TDA+ceWGZnTEl/bvSYQ=; b=OdZiDKQ9QAXS2NJ6Y8Oz6eeCsNsRoYXe7zeMsmWYkF2iJ7dM6/51Yz3iqn45Z/337w 3HIaQD0usJPXzRmqHFHGo57nkjT2aE14Ek0tZD92fRv2omYpGKudNtwXpr+KhAUffH6J uyMuRhyGNJScbtI7CzRdb8zxuLcDIKu792P1Rb6+729deDJBMJ5pyZohTzxZ/6P56dvu CbRXv2vfFjFiOo9TS8VZBfBeyujrsBKJSxRlF8VgqgJ7vZGpuLxbmPjqmwAypJvj9KHn HRQKmIZ8TBK3fBdgrI+li/hVnT6A9wKelkzbHWpViZc5/TR00YBmagKX95+6yPIFk5o8 CaXA== X-Gm-Message-State: AOJu0YzLkGOLJ2fNiFWK9yp5rZghRY/Cll1em+IiDPo6/1nhjRMWkOE7 UvsKJQ6Mn7Q06QnDQDQgmHIMTEca3+cHFrwAAmKDDQ== X-Received: by 2002:a17:903:1108:b0:1d3:40ea:bf5b with SMTP id n8-20020a170903110800b001d340eabf5bmr1147864plh.21.1702658878388; Fri, 15 Dec 2023 08:47:58 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231214020530.2267499-1-almasrymina@google.com> <20231214020530.2267499-5-almasrymina@google.com> <20231215021114.ipvdx2bwtxckrfdg@google.com> <793eb1bd-29bd-3c66-4ed2-9297879dbaa0@huawei.com> In-Reply-To: <793eb1bd-29bd-3c66-4ed2-9297879dbaa0@huawei.com> From: Shakeel Butt Date: Fri, 15 Dec 2023 08:47:46 -0800 Message-ID: Subject: Re: [RFC PATCH net-next v1 4/4] net: page_pool: use netmem_t instead of struct page in API To: Yunsheng Lin Cc: Mina Almasry , 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 , =?UTF-8?Q?Christian_K=C3=B6nig?= , Michael Chan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , 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 , Willem de Bruijn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 15, 2023 at 3:04=E2=80=AFAM Yunsheng Lin wrote: > > On 2023/12/15 10:11, Shakeel Butt wrote: > > On Thu, Dec 14, 2023 at 08:27:55AM -0800, Mina Almasry wrote: > >> On Thu, Dec 14, 2023 at 4:05=E2=80=AFAM Yunsheng Lin wrote: > >>> > > [...] > >>> I perfer the second one personally, as devmem means that it is not > >>> readable from cpu. > >> > >> From my POV it has to be the first one. We want to abstract the memory > >> type from the drivers as much as possible, not introduce N new memory > >> types and ask the driver to implement new code for each of them > >> separately. > > That was my initial thinking too: > https://www.spinics.net/lists/netdev/msg949376.html > > But after discussion, it may make more sense to have two sets of API from= the > driver's piont of view if we want a complete safe type protection, so tha= t > compiler can check everything statically and devmem driver API have a cle= ar > semantic: > 1. devmem is not allowed to be called into mm subsystem. > 2. it will not provide a API like page_address(). > I think all of us are on the same page that there will be two sets of APIs here but Mina's point was let's aim to not make that N set of APIs.