[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4f1a0b7d-973f-80f5-cc39-74f09622ccef@redhat.com>
Date: Fri, 9 Jun 2023 17:02:54 +0200
From: Jesper Dangaard Brouer <jbrouer@...hat.com>
To: Yunsheng Lin <linyunsheng@...wei.com>, davem@...emloft.net,
kuba@...nel.org, pabeni@...hat.com
Cc: brouer@...hat.com, netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Lorenzo Bianconi <lorenzo@...nel.org>,
Alexander Duyck <alexander.duyck@...il.com>,
Saeed Mahameed <saeedm@...dia.com>, Leon Romanovsky <leon@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Jesper Dangaard Brouer
<hawk@...nel.org>, Ilias Apalodimas <ilias.apalodimas@...aro.org>,
linux-rdma@...r.kernel.org
Subject: Re: [PATCH net-next v3 1/4] page_pool: frag API support for 32-bit
arch with 64-bit DMA
On 09/06/2023 15.17, Yunsheng Lin wrote:
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index a7c526ee5024..cd4ac378cc63 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -832,6 +832,15 @@ static int mlx5e_alloc_rq(struct mlx5e_params *params,
> /* Create a page_pool and register it with rxq */
> struct page_pool_params pp_params = { 0 };
>
> + /* Return error here to aoivd writing to page->pp_frag_count in
^^^^^
Typo
> + * mlx5e_page_release_fragmented() for page->pp_frag_count is not
> + * usable for arch with PAGE_POOL_DMA_USE_PP_FRAG_COUNT being true.
> + */
> + if (PAGE_POOL_DMA_USE_PP_FRAG_COUNT) {
> + err = -EINVAL;
> + goto err_free_by_rq_type;
> + }
> +
> pp_params.order = 0;
> pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV | PP_FLAG_PAGE_FRAG;
> pp_params.pool_size = pool_size;
> diff --git a/include/net/page_pool.h b/include/net/page_pool.h
> index 126f9e294389..5c7f7501f300 100644
> --- a/include/net/page_pool.h
> +++ b/include/net/page_pool.h
> @@ -33,6 +33,7 @@
> #include <linux/mm.h> /* Needed by ptr_ring */
> #include <linux/ptr_ring.h>
> #include <linux/dma-direction.h>
> +#include <linux/dma-mapping.h>
>
> #define PP_FLAG_DMA_MAP BIT(0) /* Should page_pool do the DMA
> * map/unmap
> @@ -50,6 +51,9 @@
> PP_FLAG_DMA_SYNC_DEV |\
> PP_FLAG_PAGE_FRAG)
>
> +#define PAGE_POOL_DMA_USE_PP_FRAG_COUNT \
> + (sizeof(dma_addr_t) > sizeof(unsigned long))
> +
I have a problem with the name PAGE_POOL_DMA_USE_PP_FRAG_COUNT
because it is confusing to read in an if-statement.
Proposals rename to: DMA_OVERLAP_PP_FRAG_COUNT
Or: MM_DMA_OVERLAP_PP_FRAG_COUNT
Or: DMA_ADDR_OVERLAP_PP_FRAG_COUNT
Notice how I also removed the prefix PAGE_POOL_ because this is a
MM-layer constraint and not a property of page_pool.
--Jesper
Powered by blists - more mailing lists