Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] Per-vPort queue counts are not clamped across device resume, leading 
to MSI-X vector exhaustion and resume failure if available interrupts shrink.
--

commit 5d1fd25db612c4024c6a414d322389f154cfe998
Author: Long Li <[email protected]>
Date:   Fri May 15 04:05:04 2026 +0000

    net: mana: Query device capabilities and configure MSI-X sharing for EQs

This commit adjusts the maximum number of queues to allow dedicated MSI-X
vectors for each vPort, calculating per-vPort limits based on hardware
capabilities. It enables MSI-X sharing dynamically when there are not
enough vectors for dedicated allocation and ensures a minimum of one port
during probe.

> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c 
> b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index 18f8f653da3d4..d23b856f48f6f 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c

[ ... ]

> @@ -3426,9 +3431,9 @@ static int mana_probe_port(struct mana_context *ac, int 
> port_idx,
>       apc = netdev_priv(ndev);
>       apc->ac = ac;
>       apc->ndev = ndev;
> -     apc->max_queues = gc->max_num_queues;
> +     apc->max_queues = gc->max_num_queues_vport;
>       /* Use MANA_DEF_NUM_QUEUES as default, still honoring the HW limit */
> -     apc->num_queues = min(gc->max_num_queues, MANA_DEF_NUM_QUEUES);
> +     apc->num_queues = min(gc->max_num_queues_vport, MANA_DEF_NUM_QUEUES);
>       apc->tx_queue_size = DEF_TX_BUFFERS_PER_QUEUE;

Does this code handle clamping apc->num_queues if the available MSI-X
vectors decrease during a suspend/resume cycle?

During a device resume, mana_gd_query_max_resources() might recalculate
a smaller gc->max_num_queues_vport if fewer MSI-X vectors are provided
by the system.

Since apc->num_queues is set here during the initial probe, it appears
to retain its previously configured size on resume. When mana_attach()
is called in the resume path for existing ports, could it try to allocate
the old, larger number of vectors from the newly undersized msi_bitmap,
exhausting the bitmap and failing the resume with -ENOMEM?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=2

Reply via email to