Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp15644lqi; Wed, 6 Mar 2024 08:51:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUIDrs2+JMmaxVAMVTKIaze1yHXe0WLj9iy+1Mtk/MnXQ4Yv61QzTxk3Wko+KioX0oGfyyNifHy1GEsZC4WQdEUAdJW+avQ9mFlnYDaTA== X-Google-Smtp-Source: AGHT+IGYMLx43MScfuHKPd4KKyWnVgp+0KKrJCbVorHzBlflxKduTS1uatuOR1UaifMVm2/0GRh6 X-Received: by 2002:a05:6830:2051:b0:6e4:da50:5b27 with SMTP id f17-20020a056830205100b006e4da505b27mr6005298otp.18.1709743909420; Wed, 06 Mar 2024 08:51:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709743909; cv=pass; d=google.com; s=arc-20160816; b=YIeia0nMf/e6tTb6iuHjTpJvf6ZwlgI7nwIF0Zw6y2Jr7cPDUhRXAqaCyi27C/B628 +sZ6A+bbfxr1o/iwv90cXbS6YyiKh/h48WUSdGPicuJUg3fI8cjgVShkempbf8HVwMzs 82+fmTS04MWgl1+yMl9y/gJ2CEAizWmFmcARZGeBPBqdXYUd4RFkuFipv+LF5J5XVjQZ 7QgKpu3VHUd0ogU48Avi48VoYsnVcIjjyl1FWGUzXqwZJ5MGZ8tqN9GYC7R9yQcCFbef COcVgDdZQLI/S2dJXM4tkoobxH64gb2460UTISmSCdVB9Dg3fK4ZFeaRPXxfK9K7HR87 wpFg== 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=fAuNxTfS6x4OQHwyTAR2JW08hPHhuONnAVW1sMtWxI0=; fh=7IlOTVsjXWr1i3Qx3c4Ai3Bhe1KnmZMtyPJ9eYCpR6k=; b=tg3sS9OiVv9cLkLS8KZzkIWh/YJOKcEhhO93jX6T4UWdHSkov5UjBYtSZTBWfCbbqa pJtfb61YUATmpS/2vMe/IITVQZEorKBjpHb/jyGk7zHKev5ewC3BEzNoznLqzKqhwlhk co5jLIJiz0XzgIGszXBhp35Tzno3rY04unyJF2a9vrqNwPyAy1Qlv29ONCbibVd3Nbxu zjUre1MRy7ofq2+jEZg+WTiEI6ORYFf6NNu59vGrS5QezdXJgJUxkMzS9DSscgOFFzKv b7Xhh246mCxWBLza/G2NXZijhtvYrda8+1N5D/bXAPNVBq9gtDFoBWnwGUBNEPpT6Lt4 mOgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=MgZ0KcAS; 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-94294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id cb4-20020a056a02070400b005dc071d13c7si12699322pgb.273.2024.03.06.08.51.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 08:51:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94294-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=@google.com header.s=20230601 header.b=MgZ0KcAS; 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-94294-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94294-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0DC9628132E for ; Wed, 6 Mar 2024 16:51:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D5A6137917; Wed, 6 Mar 2024 16:51:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MgZ0KcAS" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 6260A132C3D for ; Wed, 6 Mar 2024 16:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709743894; cv=none; b=gl8Lya7Px4Ma2OLiuGc2MhV38vtDIU5kvvX2gdwDkIG9lTUHWZtw86KHV3qtxQ9xTaJfy6ltFc8or9WwDR6giUXSFXcj/t7bwXK+QGvcvg8sohwKnrnFng3Jgd7x+drXMfoR5nMwwj+Oq3M3+ae3SkhwmSs1WFJOcSKNof8RPVs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709743894; c=relaxed/simple; bh=2ZhRIiVOue9t1Wad+eKIOFn2M0PF3k+uzBlQG79ns5E=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LjnVzv/TW3nWOr7n7NrZWq5ZriTE4i9cwPpLbkHyWw6ElTdvwoNWbhkDpPc1DiZw09sdKk/Fesijb1Q0DGgVHzHSE2gNAJeyAI/vpcTXW8CMoj0byA8eAtHo9GhHdA7PA9g/XBILQEh5hAxtaMcBykck+6y/5V09VQn41/y2/0I= 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=MgZ0KcAS; arc=none smtp.client-ip=209.85.208.53 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-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-567f7bba941so1027428a12.2 for ; Wed, 06 Mar 2024 08:51:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709743891; x=1710348691; 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=fAuNxTfS6x4OQHwyTAR2JW08hPHhuONnAVW1sMtWxI0=; b=MgZ0KcAS7HSS77yVu7xyCeHAcaC/1SdsNfuOebsPKTi47ADSikIPFHFpMVlwAuM3Lq ADh3B8tOCDjS8SO22bC5JH7v38MMF7sGik0mAt/5hJkVIW5AEQmXcFeW9oqhkFytK0rb /Ww9ONL83z+QuBnnhMONLXuuoA7qgm3K0ZfBZvgkcOLzqswyIaukdbQhLb3YNczFfmmx jgRR8h2ZQOpnYgWc7g+WCCi0m0f37F6bezegEtZlxh4cxVcQxJZp/udwbPuqUyp3aK1a 0D9N4f04odZmGIVAHEJ6AuB6otT/H7GV6nWXPid/olVyvuohW5SN+xe5wVd+/4rfcXAt PowQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709743891; x=1710348691; 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=fAuNxTfS6x4OQHwyTAR2JW08hPHhuONnAVW1sMtWxI0=; b=l7kBEzhQoQaPFtrj+AxdRg6rX6g7QE8ZcHM0OMgytUIWIKxYk6bWHGQeIyg2CfaU22 9y6cURfo76qkF2svG3WWSfdhZUq2mOBtq2FHSUbgpXCv5KWoxSQGrqfPXn8EMS3BobOV SOhlaKHrZegqgE432MiFzrl8VnQx1QSn1T/iw87aA1gcfDWJGxB5MiJayWTUZvEYMY6q MkY7WwgKhcMvU74Cx1R+/ooD2AdlYK/OMKWvPUiIkQ/tPpNoXkzGXe0jxwMT4t9zb7za 22ijdp4KSL8XJkYC1BImG+6v4pEa9lXAw1JxQPVZXEi2bzd2QzAMkuoiVD8xgNtN9S7Q NtgA== X-Forwarded-Encrypted: i=1; AJvYcCXthxF/g/Math+WHwuRiUIxlv7+67L6tMXJJjqciumZ+onVXoNqQWLT05Tfuqbagz/HtVBHv1lyFzxGv326yYaUDbG3LJHDO66JGSvR X-Gm-Message-State: AOJu0Yz0+soyVCbhIQVQDiie5zeylJ70XOSGw/0QzFi4VDT7xgg1Z9xA PULrW+sMQtYhzuiz5B/vqsPpEnUhaumx3qlaBpGtIRdzScKuNH259sewjQ6w4keveSpSbDM5XKI a5+xlIEVm6aptDGyRi2JhPKzepyRgZS7AtZwW X-Received: by 2002:a17:906:fc01:b0:a43:f267:789f with SMTP id ov1-20020a170906fc0100b00a43f267789fmr10647282ejb.41.1709743890406; Wed, 06 Mar 2024 08:51:30 -0800 (PST) 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-10-almasrymina@google.com> <383c4870-167f-4123-bbf3-928db1463e01@davidwei.uk> In-Reply-To: From: Mina Almasry Date: Wed, 6 Mar 2024 08:51:18 -0800 Message-ID: Subject: Re: [RFC PATCH net-next v6 09/15] memory-provider: dmabuf devmem memory provider To: Pavel Begunkov 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?= , Jason Gunthorpe , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Jeroen de Borst , Praveen Kaligineedi , Willem de Bruijn , Kaiyuan Zhang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 6, 2024 at 6:59=E2=80=AFAM Pavel Begunkov wrote: > > On 3/6/24 02:42, Mina Almasry wrote: > > On Tue, Mar 5, 2024 at 6:28=E2=80=AFPM David Wei wrote= : > >> > >> On 2024-03-04 18:01, Mina Almasry wrote: > >>> + if (pool->p.queue) > >>> + binding =3D READ_ONCE(pool->p.queue->binding); > >>> + > >>> + if (binding) { > >>> + pool->mp_ops =3D &dmabuf_devmem_ops; > >>> + pool->mp_priv =3D binding; > >>> + } > >> > >> This is specific to TCP devmem. For ZC Rx we will need something more > >> generic to let us pass our own memory provider backend down to the pag= e > >> pool. > >> > >> What about storing ops and priv void ptr in struct netdev_rx_queue > >> instead? Then we can both use it. > > > > Yes, this is dmabuf specific, I was thinking you'd define your own > > member of netdev_rx_queue, and then add something like this to > > page_pool_init: > > That would be quite annoying, there are 3 expected users together > with huge pages, each would need a field and check all others are > disabled as you mentioned and so on. It should be cleaner to pass > a generic {pp_ops,pp_private} pair instead. > > If header dependencies is a problem, you it can probably be > > struct pp_provider_param { > struct pp_ops ops; > void *private; > }; > > # netdev_rx_queue.h > > // definition is not included here > struct pp_provider_params; > > struct netdev_rx_queue { > ... > struct pp_provider_params *pp_params; > }; > Seems very reasonable, will do! Thanks! > -- > Pavel Begunkov --=20 Thanks, Mina