Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1299907lqp; Fri, 22 Mar 2024 10:41:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW16SX8jDSb3KbNlVEgJ+SNJ/Ap2bGNR2tWHpHLfLaUIUM1w4Vv77ccOV6AJz44PNf0yQb82VOUGirHFnkAPNWYBOdkLexfj09uH1LUcw== X-Google-Smtp-Source: AGHT+IE+fV7+CKyBuQoY6qKqDY5nU2VNZ0nbOryYuGSArsWNsav4kU7DjuK05a5zbiXPeROQZDsW X-Received: by 2002:a05:620a:4110:b0:789:f195:6702 with SMTP id j16-20020a05620a411000b00789f1956702mr219241qko.3.1711129273461; Fri, 22 Mar 2024 10:41:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711129273; cv=pass; d=google.com; s=arc-20160816; b=prvMjGPOAK2TSi76pS3RBxIZHz9sWJ2+QN6Em8k+ooC55lzIoLm0+FuvTL29+0BV9A 9GcJsjUAr4fvs1jVftitqKyB3HBaBHdlvKc5zNnjQcJQVTrcmll6DnmP5i5Mvwx1bCqv kMMQYgC50kuNK8UUOfRewOUS4QfV9jrN01SjLqbxQ1MrYCLraR5sD7NsWrSTBgW0TNjM TuMsw/lvX/mz0EyaSL8LGzXvTN3cwAuxq1+GPjTMZokBxerigBVpD3oqOqoFtBAUU4lF +gCN3oiVhiaILsJzmVIIv1pFAEptB4ttLDPioOcInkH9G2jQ/BiF87g4WM1J+EMd+qL0 fLhw== ARC-Message-Signature: i=2; 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=7YM4J2ObtCNq8IqrJeUkrlLZCafy3cmXh0Ri66R+dm4=; fh=anIsdAgxXbjl0MbEY2Y34M2V1uinLxbo/SOySaor8O4=; b=xGtSgcXtQFOwAgMC348XsAlxI3rCgcxDXHu7iJitijUtXW9su1ersWqytYt89q6Brv rMzR/iBTfM5SaJxM2jbSmeMo64nhHWLBqWYT3P5wCKGNH10IjHeOxZ0+MwBWbu2Io7Vd pcds6c7VHu+ZAlX8TyKziRMva7U/68HGmRO/Rrmqsi7ooiXccC8qazNJi8ejLpSh2Gqc 3LYJHxXjo0NwOMYMRYdtJpJWvIu/tNX6IRviePITgg7Aa1DhVNIC0Q8ra9cxY5/qxk9V DQz3hFmrLOFBXKKvN794fA2TklnDoBQMKO2knT4o/5JPe4L2faZin+gJSmihnssGq6mo MSeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="NuAiMh/M"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-111874-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e26-20020a05620a015a00b00789ed80e8b7si40661qkn.346.2024.03.22.10.41.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 10:41:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111874-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="NuAiMh/M"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-111874-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111874-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 298AB1C22C1E for ; Fri, 22 Mar 2024 17:41:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D210C60276; Fri, 22 Mar 2024 17:40:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NuAiMh/M" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 BED455FDA5 for ; Fri, 22 Mar 2024 17:40:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711129243; cv=none; b=lChMnyMYfEyHoRExrnxDuyQwGjv65p1lP7jv0TZ+Yf2KjpCRudUpoFG3xdmzCobq5Vhyu2AVCtUpIzg7e6RslMkbFkb9qdwQs3p5SDzTDmSHR6W+x77VlGbRSCudvhJ571NVPu9XNJtEN2eWgIAnlXcGhbCJza4xYlc4HHCyNJc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711129243; c=relaxed/simple; bh=7T0QYgj6Z0QWJ7WZghtr6Q0zZ77ROAwtyZEJQAtnJrY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=A8FI7NXMr68e7sdpmDWAJjuCRtjZsOMfTE0XEMO4dxd9CCgsQ82NGEYJ/s+HsMqTIwr088rcABgZDsipBdcJFM+TtnDvhQpfEFVe10PMIth0+RdkXPs8Zt/h/Abfd8HwVanliuTqm1eRlajeoyPkSApL1xgCO+cGxGaKKJSypbU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=NuAiMh/M; arc=none smtp.client-ip=209.85.218.49 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-ej1-f49.google.com with SMTP id a640c23a62f3a-a450bedffdfso292960566b.3 for ; Fri, 22 Mar 2024 10:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711129239; x=1711734039; 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=7YM4J2ObtCNq8IqrJeUkrlLZCafy3cmXh0Ri66R+dm4=; b=NuAiMh/MosGpuJph6/CXhnqgtnF7qTB4wgozIjMxlP7xwIMTBUkxGp7jiLeBJeNUA8 uf3RbWvwApbMZFE+1zAiSE/rUFH1AmO4Inn/LeR4eLLIyJhCb6kAZF5e/IqWygoVbAS0 YNddRISS5xPN/6moDsAN0RJLCFP7BYfwoyTBXRz81dPr4VwAGpuAx4kKX1ddy3i+i8J0 GW8CtvhZyNMxHOAbds+zU9+r9Ux6hPYEAFI7Xi+I0b4x9bRWTLPNpPCI2wo9BHwHpm54 90xv2NndkuSs6tCPxxNLMeQMMbA9UkVREUUY00h8sSJNFZUydz03W+30nass1/Zv6OwQ wtCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711129239; x=1711734039; 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=7YM4J2ObtCNq8IqrJeUkrlLZCafy3cmXh0Ri66R+dm4=; b=YjMnno77SQlv+S3KMBKyEFyBfiCZusUM6JiW825Z2L7QiVWYQ/DqNw3dLnG/K/fdF0 Lk6XJlD9qIjO5ilgOrOTmfraCJaoK4gMcQ5p1A9JZWvo4lhmfogopfnTORQkQ+0OIBCw dfh6oZM4+pHU66N/AS1SzCCXiuilW0k+oF+Kd/K1JhXP1SyGjt69PpNLXSex60N8HQOP H9wJeEc4xj/bRPPVgfha5aofPaZaLBeyrK7dkbiJBw0HPnoyjBmJKvgzDvQWTX0gc8wg yDHFwG0icrFu/I5uidx71aNhqd9fxu9Vr1YmSJrYxHhkdx33DEamCSTxdyPFJCLyRg1X FPXg== X-Forwarded-Encrypted: i=1; AJvYcCXtXdJXL3sV6BKgDOjY8ErBp4/AjIyKvj9E9ZoOJlNOtKgFMrea3RUqi+r8T1nCGnRmlfyA6GopEQLzvBF7HcRQubFQRH1NsQuR8dqY X-Gm-Message-State: AOJu0Yw5rLzs/UI1k7OjkGGTE53P23dZbHl8ObwJpXoGbqJw3CJCn7vt Q2g+165eiPMyWXqaMQ3C9Qbf/xT4v4vRKUKGqTRgAVVWfZ+8Lbb1NhkOKDRsIyQfhi1GZ6/4x0e kIJtEfcMrgdzjHNcPXkiI6XB4i3wPO7tOxdWj X-Received: by 2002:a17:906:c2d4:b0:a46:befa:f0b0 with SMTP id ch20-20020a170906c2d400b00a46befaf0b0mr293662ejb.45.1711129238808; Fri, 22 Mar 2024 10:40:38 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240305020153.2787423-1-almasrymina@google.com> <20240305020153.2787423-3-almasrymina@google.com> In-Reply-To: From: Mina Almasry Date: Fri, 22 Mar 2024 10:40:26 -0700 Message-ID: Subject: Re: [RFC PATCH net-next v6 02/15] net: page_pool: create hooks for custom page providers To: Christoph Hellwig Cc: David Wei , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Andreas Larsson , Jesper Dangaard Brouer , Ilias Apalodimas , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Arnd Bergmann , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Pavel Begunkov , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Jeroen de Borst , Praveen Kaligineedi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Christoph, Sorry for the late reply, I've been out for a few days. On Mon, Mar 18, 2024 at 4:22=E2=80=AFPM Christoph Hellwig wrote: > > On Sun, Mar 17, 2024 at 07:49:43PM -0700, David Wei wrote: > > I'm working on a similar proposal for zero copy Rx but to host memory > > and depend on this memory provider API. > > How do you need a different provider for that vs just udmabuf? > This was discussed on the io_uring ZC RFC in one of the earliest RFCs. Here is a link to Pavel's response: https://patchwork.kernel.org/project/netdevbpf/patch/20231106024413.2801438= -6-almasrymina@google.com/#25589471 The UAPI of wrapping io_uring memory into a udmabuf just to use it with devmem TCP only for the user to have to unwrap it is undesirable to him. > > Jakub also designed this API for hugepages too IIRC. Basically there's > > going to be at least three fancy ways of providing pages (one of which > > isn't actually pages, hence the merged netmem_t series) to drivers. > > How do hugepages different from a normal page allocation? They should > just a different ordered passed to the page allocator. > Yes, that's more-or-less what's what the hugepage memory provider Jakub proposed does. The memory provider would allocate a hugepage and hold a reference to it. Then when the page_pool needs a page, it would allocate a PAGE_SIZE page from said hugepage region and provide it to the page_pool, and the pool back to the driver. This allows the hugepages to work without the page_pool and driver to be hugepage aware and to insert huge page specific processing in it. Other designs for this hugepage use case are possible, I'm just describing Jakub's idea for it as a potential use-case for these hooks. For example technically the page_pool at the moment does support non-0 order allocations, but most drivers simply set the order to 0 and use the page pool only for PAGE_SIZE allocations. An alternative design could be to use this support in the page pool, but that requires every driver to adopt this rather than a core networking change that can apply transparently (to a large extent) to all page_pool drivers. --=20 Thanks, Mina