Re: [PATCH net-next v12 2/6] net: mana: Query device capabilities and configure MSI-X sharing for EQs

From
sashiko-bot@kernel.org
Date
2026-06-06 00:57:48
Reply to
Long Li, 2026-06-05
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Permanent downward clamping of maximum queues (`apc->max_queues`) across suspend/resume cycles.
--

commit ae1648776d10be5e3fd6640d34f239a82e77a213
Author: Long Li [off-list ref]
Subject: net: mana: Query device capabilities and configure MSI-X sharing for EQs

This commit adjusts the max number of queues to allow dedicated MSI-X
vectors for each vPort and configures MSI-X sharing when resources are
scarce. It also updates port initialization to clamp the queue counts
to the recomputed per-vPort maximums.
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index ed60cc15fe78d..3ec8e94e7c17e 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -3208,6 +3213,8 @@ static int mana_init_port(struct net_device *ndev)
 	max_queues = min_t(u32, max_txq, max_rxq);
 	if (apc->max_queues > max_queues)
 		apc->max_queues = max_queues;
+	if (apc->max_queues > gc->max_num_queues_vport)
+		apc->max_queues = gc->max_num_queues_vport;
[Severity: Medium]
Will this result in a permanent downward clamping of the maximum queues across
suspend and resume cycles?

Because gc->max_num_queues_vport is dynamically recalculated on every
suspend/resume cycle based on current hardware state (such as the number of
online CPUs and available MSI-X vectors), it might temporarily shrink.

If a system resumes with fewer vectors, this logic reduces apc->max_queues.

However, if the system subsequently resumes again with the original number of
vectors restored, apc->max_queues cannot recover because this clamping only
ever reduces the value and the original allocation limit is permanently
overwritten. 

Should we be clamping a temporary runtime variable instead of permanently
modifying the device's capability maximums here?
 
 	if (apc->num_queues > apc->max_queues)
 		apc->num_queues = apc->max_queues;
-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260605005717.2059954-1-longli@microsoft.com?part=2
Thread (9 messages) 9 messages, 3 authors, last reply 2026-06-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help