Skip to content

Commit 49fa4b0

Browse files
rkannoth1davem330
authored andcommitted
octeontx2-pf: fix page_pool creation fail for rings > 32k
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: b2e3406 ("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> Acked-by: Jesper Dangaard Brouer <hawk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0aacec4 commit 49fa4b0

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ int otx2_pool_init(struct otx2_nic *pfvf, u16 pool_id,
14321432
}
14331433

14341434
pp_params.flags = PP_FLAG_PAGE_FRAG | PP_FLAG_DMA_MAP;
1435-
pp_params.pool_size = numptrs;
1435+
pp_params.pool_size = min(OTX2_PAGE_POOL_SZ, numptrs);
14361436
pp_params.nid = NUMA_NO_NODE;
14371437
pp_params.dev = pfvf->dev;
14381438
pp_params.dma_dir = DMA_FROM_DEVICE;

drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#define OTX2_ETH_HLEN (VLAN_ETH_HLEN + VLAN_HLEN)
2424
#define OTX2_MIN_MTU 60
2525

26+
#define OTX2_PAGE_POOL_SZ 2048
27+
2628
#define OTX2_MAX_GSO_SEGS 255
2729
#define OTX2_MAX_FRAGS_IN_SQE 9
2830

0 commit comments

Comments
 (0)