> -----Original Message-----
> From: Kitszel, Przemyslaw <[email protected]>
> Sent: Friday, September 25, 2026 3:16 PM
> To: [email protected]; Jakub Kicinski <[email protected]>
> Cc: Nguyen, Anthony L <[email protected]>; Loktionov,
> Aleksandr <[email protected]>; Schmidt, Michal
> <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; Kitszel, Przemyslaw
> <[email protected]>
> Subject: [PATCH net v5 4/6] ice: extract ice_vsi_get_num_qs()
>
> ice_vsi_set_num_qs() mixed two things: deciding how many queues a VSI
> gets, and applying all the side effects of that decision. Split the
> decision out into ice_vsi_get_num_qs(), returning both counts at once.
>
> To make that possible, group alloc_txq and alloc_rxq in struct ice_vsi
> with struct_group_tagged(), which gives the return type without adding
> any new storage. Field order changes slightly, num_txq now follows
> alloc_rxq, but nothing depends on it.
>
> ice_vsi_get_num_qs() takes @held_txq and @held_rxq from the start,
> even though the only caller so far passes zero for both. They let a
> caller ask what the counts would be once the queues the VSI currently
> owns are back in the PF pool. A later commit adds the caller that
> needs this: the rebuild path has to size its ring stats arrays before
> ice_vsi_decfg() releases the queues, yet the arrays must match what
> ice_vsi_set_num_qs() computes afterwards.
>
> While reshaping the whole body, drop the kernel-doc line promising a
> return value; ice_vsi_set_num_qs() returns void.
>
> No functional change intended.
>
> Signed-off-by: Przemek Kitszel <[email protected]>
> ---
> v5:
> - drop the stale "Return 0 on success and a negative value on error"
> from the kernel-doc of the void ice_vsi_set_num_qs() (Clashiko)
> ---
> drivers/net/ethernet/intel/ice/ice.h | 6 +-
> drivers/net/ethernet/intel/ice/ice_lib.c | 88 ++++++++++++++---------
> -
> 2 files changed, 55 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice.h
> b/drivers/net/ethernet/intel/ice/ice.h
> index fadfe94bf1c8..f1ba86d066be 100644
> --- a/drivers/net/ethernet/intel/ice/ice.h
> +++ b/drivers/net/ethernet/intel/ice/ice.h
> @@ -403,9 +403,11 @@ struct ice_vsi {
> u8 rx_mapping_mode; /* ICE_MAP_MODE_[CONTIG|SCATTER] */
> u16 *txq_map; /* index in pf->avail_txqs */
> u16 *rxq_map; /* index in pf->avail_rxqs */
...
> break;
> }
>
> --
> 2.51.1
Reviewed-by: Aleksandr Loktionov <[email protected]>