]> www.infradead.org Git - users/hch/misc.git/commit
net/mlx5e: reduce the max log mpwrq sz for ECPF and reps
authorWilliam Tu <witu@nvidia.com>
Sun, 9 Feb 2025 10:17:07 +0000 (12:17 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 12 Feb 2025 18:46:17 +0000 (10:46 -0800)
commite1d68ea58c7e9ebacd9ad7a99b25a3578fa62182
tree7a59f84822c67cc33bd397b8b449f7be1627a7e7
parent4e41231249f4083a095085ff86e317e29313c2c3
net/mlx5e: reduce the max log mpwrq sz for ECPF and reps

For the ECPF and representors, reduce the max MPWRQ size from 256KB (18)
to 128KB (17). This prepares the later patch for saving representor
memory.

With Striding RQ, there is a minimum of 4 MPWQEs. So with 128KB of max
MPWRQ size, the minimal memory is 4 * 128KB = 512KB. When creating page
pool, consider 1500 mtu, the minimal page pool size will be 512KB/4KB =
128 pages = 256 rx ring entries (2 entries per page).

Before this patch, setting RX ringsize (ethtool -G rx) to 256 causes
driver to allocate page pool size more than it needs due to max MPWRQ
is 256KB (18). Ex: 4 * 256KB = 1MB, 1MB/4KB = 256 pages, but actually
128 pages is good enough. Reducing the max MPWRQ to 128KB fixes the
limitation.

Signed-off-by: William Tu <witu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/20250209101716.112774-7-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en/params.c