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 <[email protected]> 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. > 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 [ ... ] > @@ -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/[email protected]?part=2
