* [PATCH v3 net] octeontx2-pf: fix page_pool creation fail for rings > 32k
@ 2023-08-24 3:03 Ratheesh Kannoth
2023-08-24 11:01 ` Jesper Dangaard Brouer
2023-08-25 9:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Ratheesh Kannoth @ 2023-08-24 3:03 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba, pabeni,
rkannoth, hawk, alexander.duyck, ilias.apalodimas, linyunsheng,
Alexander Lobakin
octeontx2 driver calls page_pool_create() during driver probe()
and fails if queue size > 32k. Page pool infra uses these buffers
as shock absorbers for burst traffic. These pages are pinned down
over time as working sets varies, due to the recycling nature
of page pool, given page pool (currently) don't have a shrinker
mechanism, the pages remain pinned down in ptr_ring.
Instead of clamping page_pool size to 32k at
most, limit it even more to 2k to avoid wasting memory.
This have been tested on octeontx2 CN10KA hardware.
TCP and UDP tests using iperf shows no performance regressions.
Fixes: b2e3406a38f0 ("octeontx2-pf: Add support for page pool")
Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
---
ChangeLogs:
v2->v3: Fix macro aligment and header file changes suggested by
Alexander Lobakin
v1->v2: Commit message changes and typo fixes
v0->v1: Commit message changes.
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 2 +-
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
index 77c8f650f7ac..3e1c70c74622 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
@@ -1432,7 +1432,7 @@ int otx2_pool_init(struct otx2_nic *pfvf, u16 pool_id,
}
pp_params.flags = PP_FLAG_PAGE_FRAG | PP_FLAG_DMA_MAP;
- pp_params.pool_size = numptrs;
+ pp_params.pool_size = min(OTX2_PAGE_POOL_SZ, numptrs);
pp_params.nid = NUMA_NO_NODE;
pp_params.dev = pfvf->dev;
pp_params.dma_dir = DMA_FROM_DEVICE;
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h
index b5d689eeff80..9e3bfbe5c480 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h
@@ -23,6 +23,8 @@
#define OTX2_ETH_HLEN (VLAN_ETH_HLEN + VLAN_HLEN)
#define OTX2_MIN_MTU 60
+#define OTX2_PAGE_POOL_SZ 2048
+
#define OTX2_MAX_GSO_SEGS 255
#define OTX2_MAX_FRAGS_IN_SQE 9
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3 net] octeontx2-pf: fix page_pool creation fail for rings > 32k
2023-08-24 3:03 [PATCH v3 net] octeontx2-pf: fix page_pool creation fail for rings > 32k Ratheesh Kannoth
@ 2023-08-24 11:01 ` Jesper Dangaard Brouer
2023-08-25 9:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Jesper Dangaard Brouer @ 2023-08-24 11:01 UTC (permalink / raw)
To: Ratheesh Kannoth, netdev, linux-kernel
Cc: brouer, sgoutham, gakula, sbhatta, hkelam, davem, edumazet, kuba,
pabeni, hawk, alexander.duyck, ilias.apalodimas, linyunsheng,
Alexander Lobakin
On 24/08/2023 05.03, Ratheesh Kannoth wrote:
> octeontx2 driver calls page_pool_create() during driver probe()
> and fails if queue size > 32k. Page pool infra uses these buffers
> as shock absorbers for burst traffic. These pages are pinned down
> over time as working sets varies, due to the recycling nature
> of page pool, given page pool (currently) don't have a shrinker
> mechanism, the pages remain pinned down in ptr_ring.
> Instead of clamping page_pool size to 32k at
> most, limit it even more to 2k to avoid wasting memory.
>
> This have been tested on octeontx2 CN10KA hardware.
> TCP and UDP tests using iperf shows no performance regressions.
>
> Fixes: b2e3406a38f0 ("octeontx2-pf: Add support for page pool")
> Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> Reviewed-by: Sunil Goutham <sgoutham@marvell.com>
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
> ---
Again
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
> ChangeLogs:
>
> v2->v3: Fix macro aligment and header file changes suggested by
> Alexander Lobakin
> v1->v2: Commit message changes and typo fixes
> v0->v1: Commit message changes.
> ---
> drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 2 +-
> drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> index 77c8f650f7ac..3e1c70c74622 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
> @@ -1432,7 +1432,7 @@ int otx2_pool_init(struct otx2_nic *pfvf, u16 pool_id,
> }
>
> pp_params.flags = PP_FLAG_PAGE_FRAG | PP_FLAG_DMA_MAP;
> - pp_params.pool_size = numptrs;
> + pp_params.pool_size = min(OTX2_PAGE_POOL_SZ, numptrs);
> pp_params.nid = NUMA_NO_NODE;
> pp_params.dev = pfvf->dev;
> pp_params.dma_dir = DMA_FROM_DEVICE;
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h
> index b5d689eeff80..9e3bfbe5c480 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h
> @@ -23,6 +23,8 @@
> #define OTX2_ETH_HLEN (VLAN_ETH_HLEN + VLAN_HLEN)
> #define OTX2_MIN_MTU 60
>
> +#define OTX2_PAGE_POOL_SZ 2048
> +
> #define OTX2_MAX_GSO_SEGS 255
> #define OTX2_MAX_FRAGS_IN_SQE 9
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3 net] octeontx2-pf: fix page_pool creation fail for rings > 32k
2023-08-24 3:03 [PATCH v3 net] octeontx2-pf: fix page_pool creation fail for rings > 32k Ratheesh Kannoth
2023-08-24 11:01 ` Jesper Dangaard Brouer
@ 2023-08-25 9:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-25 9:10 UTC (permalink / raw)
To: Ratheesh Kannoth
Cc: netdev, linux-kernel, sgoutham, gakula, sbhatta, hkelam, davem,
edumazet, kuba, pabeni, hawk, alexander.duyck, ilias.apalodimas,
linyunsheng, aleksander.lobakin
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Thu, 24 Aug 2023 08:33:01 +0530 you wrote:
> octeontx2 driver calls page_pool_create() during driver probe()
> and fails if queue size > 32k. Page pool infra uses these buffers
> as shock absorbers for burst traffic. These pages are pinned down
> over time as working sets varies, due to the recycling nature
> of page pool, given page pool (currently) don't have a shrinker
> mechanism, the pages remain pinned down in ptr_ring.
> Instead of clamping page_pool size to 32k at
> most, limit it even more to 2k to avoid wasting memory.
>
> [...]
Here is the summary with links:
- [v3,net] octeontx2-pf: fix page_pool creation fail for rings > 32k
https://git.kernel.org/netdev/net/c/49fa4b0d0670
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-25 9:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24 3:03 [PATCH v3 net] octeontx2-pf: fix page_pool creation fail for rings > 32k Ratheesh Kannoth
2023-08-24 11:01 ` Jesper Dangaard Brouer
2023-08-25 9:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).