summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-05-05 19:23:18 -0700
committerJakub Kicinski <kuba@kernel.org>2026-05-05 19:23:18 -0700
commit7e0cccae6b45b12eaf71fc3ab8eb133bb50b28ad (patch)
treeda0d42f2115debfe217cb6edfe6c6dc501837ab7 /include
parent561e066284d14eb7a3ea31bfcb0cc599f6044739 (diff)
parent3af0820c878e2bca77141981b808be9994341654 (diff)
Merge branch 'net-mana-avoid-queue-struct-allocation-failure-under-memory-fragmentation'
Aditya Garg says: ==================== net: mana: Avoid queue struct allocation failure under memory fragmentation The MANA driver can fail to load on systems with high memory utilization because several allocations in the queue setup paths require large physically contiguous blocks via kmalloc. Under memory fragmentation these high-order allocations may fail, preventing the driver from creating queues when opening the interface or when reconfiguring channels, ring parameters or MTU at runtime. Allocation sizes that are problematic: mana_create_txq -> tx_qp flat array (sizeof(mana_tx_qp) = 35528): 16 queues (default): 35528 * 16 = ~555 KB contiguous 64 queues (max): 35528 * 64 = ~2220 KB contiguous mana_create_rxq -> rxq struct with flex array (sizeof(mana_rxq) = 35712, rx_oobs=296 per entry): depth 1024 (default): 35712 + 296 * 1024 = ~331 KB per queue depth 8192 (max): 35712 + 296 * 8192 = ~2403 KB per queue mana_pre_alloc_rxbufs -> rxbufs_pre and das_pre arrays: 16 queues, depth 1024 (default): 16 * 1024 * 8 = 128 KB each 64 queues, depth 8192 (max): 64 * 8192 * 8 = 4096 KB each This series addresses the issue by: 1. Converting the tx_qp flat array into an array of pointers with per-queue kvzalloc (~35 KB each), replacing a single contiguous allocation that can reach ~2.2 MB at 64 queues. 2. Switching rxbufs_pre, das_pre, and rxq allocations to kvmalloc/kvzalloc so the allocator can fall back to vmalloc when contiguous memory is unavailable. Throughput testing confirms no regression. Since kvmalloc falls back to vmalloc under memory fragmentation, all kvmalloc calls were temporarily replaced with vmalloc to simulate the fallback path (iperf3, GBits/sec): Physically contiguous vmalloc region Connections TX RX TX RX -------------------------------------------------------------- 1 47.2 46.9 46.8 46.6 16 181 181 181 181 32 181 181 181 181 64 181 181 181 181 ==================== Link: https://patch.msgid.link/20260502074552.23857-1-gargaditya@linux.microsoft.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/mana/mana.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 8f721cd4e4a7..aa90a858c8e3 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -507,7 +507,7 @@ struct mana_port_context {
bool tx_shortform_allowed;
u16 tx_vp_offset;
- struct mana_tx_qp *tx_qp;
+ struct mana_tx_qp **tx_qp;
/* Indirection Table for RX & TX. The values are queue indexes */
u32 *indir_table;