]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: mana: Use per-queue allocation for tx_qp to reduce allocation size
authorAditya Garg <gargaditya@linux.microsoft.com>
Sat, 2 May 2026 07:45:33 +0000 (00:45 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 6 May 2026 02:23:16 +0000 (19:23 -0700)
commitd07efe5a6e641af59f2dbbef4a748fab6d967747
tree88ebf7406a429d7c842ceb2f3a3a63aeaa3cfe12
parent561e066284d14eb7a3ea31bfcb0cc599f6044739
net: mana: Use per-queue allocation for tx_qp to reduce allocation size

Convert tx_qp from a single contiguous array allocation to per-queue
individual allocations. Each mana_tx_qp struct is approximately 35KB.
With many queues (e.g., 32/64), the flat array requires a single
contiguous allocation that can fail under memory fragmentation.

Change mana_tx_qp *tx_qp to mana_tx_qp **tx_qp (array of pointers),
allocating each queue's mana_tx_qp individually via kvzalloc. This
reduces each allocation to ~35KB and provides vmalloc fallback,
avoiding allocation failure due to fragmentation.

Signed-off-by: Aditya Garg <gargaditya@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://patch.msgid.link/20260502074552.23857-2-gargaditya@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microsoft/mana/mana_bpf.c
drivers/net/ethernet/microsoft/mana/mana_en.c
drivers/net/ethernet/microsoft/mana/mana_ethtool.c
include/net/mana/mana.h