lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHS8izMdevPuO4zFF9EFP2Q7tdAUk+w+bMOO-cz-=_N0q0V37Q@mail.gmail.com>
Date: Fri, 15 Aug 2025 11:11:01 -0700
From: Mina Almasry <almasrymina@...gle.com>
To: Dragos Tatulea <dtatulea@...dia.com>
Cc: asml.silence@...il.com, "David S. Miller" <davem@...emloft.net>, 
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	Simon Horman <horms@...nel.org>, cratiu@...dia.com, tariqt@...dia.com, parav@...dia.com, 
	Christoph Hellwig <hch@...radead.org>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC net-next v3 1/7] queue_api: add support for fetching per
 queue DMA dev

On Fri, Aug 15, 2025 at 4:07 AM Dragos Tatulea <dtatulea@...dia.com> wrote:
>
> For zerocopy (io_uring, devmem), there is an assumption that the
> parent device can do DMA. However that is not always the case:
> - Scalable Function netdevs [1] have the DMA device in the grandparent.
> - For Multi-PF netdevs [2] queues can be associated to different DMA
> devices.
>
> This patch introduces the a queue based interface for allowing drivers
> to expose a different DMA device for zerocopy.
>
> [1] Documentation/networking/device_drivers/ethernet/mellanox/mlx5/switchdev.rst
> [2] Documentation/networking/multi-pf-netdev.rst
>
> Signed-off-by: Dragos Tatulea <dtatulea@...dia.com>
> ---
>  include/net/netdev_queues.h | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
> index 6e835972abd1..d4d8c42b809f 100644
> --- a/include/net/netdev_queues.h
> +++ b/include/net/netdev_queues.h
> @@ -127,6 +127,10 @@ void netdev_stat_queue_sum(struct net_device *netdev,
>   * @ndo_queue_stop:    Stop the RX queue at the specified index. The stopped
>   *                     queue's memory is written at the specified address.
>   *
> + * @ndo_queue_get_dma_dev: Get dma device for zero-copy operations to be used

I'm wondering a bit why this dma-dev issue exists for memory providers
but not for the dma-dev used by the page_pool itself.

I'm guessing because the pp uses the dev in page_pool_params->dev
while I implemented the memory provider stuff to completely ignore
pp_params->dev and use its own device (sorry...).

We may want to extend your work so that the pp also ignores
pp_params.dev and uses the device returned by the queue API if it's
provided by the driver. But there is no upside to doing things this
way except for some consistency, so I think I'm complicating things
for no reason.

I think this looks good to me. With the helper moved to a .c file as
Jakub requested I can Reviewed-by.

-- 
Thanks,
Mina

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ