Re: [Intel-wired-lan] [PATCH net] ice: fix stats array overflow when VF requests more queues

Michal Schmidt
2026-04-27T19:32:35Z

On Mon, Apr 27, 2026 at 5:30 PM Loktionov, Aleksandr
<aleksandr.loktionov@intel.com> wrote:
> > -----Original Message-----
> > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> > Of Michal Schmidt
...
> > See the linked RHEL Jira item for a reproducer.
> >
> > Fixes: 2a2cb4c6c181 ("ice: replace ice_vf_recreate_vsi() with
> > ice_vf_reconfig_vsi()")
> > Closes: https://redhat.atlassian.net/browse/RHEL-164321
> Not sure are links to local JIRAs are acceptable in kernel?

The ticket is publicly visible and does not require a login.

> Why no Cc: stable@vger.kernel.org?

Apparently I still have not internalized the removal of the netdev
special stable handling from 5 years ago. Sorry!

Michal

> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
>
> > Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> > Assisted-by: Claude:claude-opus-4-6 semcode
> > ---
> > drivers/net/ethernet/intel/ice/ice_lib.c | 2 +-
> > drivers/net/ethernet/intel/ice/ice_lib.h | 1 +
> > drivers/net/ethernet/intel/ice/ice_vf_lib.c | 7 +++++++
> > 3 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c
> > b/drivers/net/ethernet/intel/ice/ice_lib.c
> > index 837b71b7b2b7..fc78176a2a8d 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_lib.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_lib.c
> > @@ -3015,7 +3015,7 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi
> > *vsi,
> > * ice_vsi_realloc_stat_arrays - Frees unused stat structures or
> > alloc new ones
> > * @vsi: VSI pointer
> > */
> > -static int
> > +int
> > ice_vsi_realloc_stat_arrays(struct ice_vsi *vsi) {
> > u16 req_txq = vsi->req_txq ? vsi->req_txq : vsi->alloc_txq;
> > diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h
> > b/drivers/net/ethernet/intel/ice/ice_lib.h
> > index 49454d98dcfe..6f7da84384e5 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_lib.h
> > +++ b/drivers/net/ethernet/intel/ice/ice_lib.h
> > @@ -66,6 +66,7 @@ int ice_ena_vsi(struct ice_vsi *vsi, bool locked);
> > void ice_vsi_decfg(struct ice_vsi *vsi); void ice_dis_vsi(struct
> > ice_vsi *vsi, bool locked);
> >
> > +int ice_vsi_realloc_stat_arrays(struct ice_vsi *vsi);
> > int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags); int
> > ice_vsi_cfg(struct ice_vsi *vsi); struct ice_vsi
> > *ice_vsi_alloc(struct ice_pf *pf); diff --git
> > a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > index 772f6b07340d..9edb2c14f553 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > @@ -268,6 +268,13 @@ static int ice_vf_reconfig_vsi(struct ice_vf *vf)
> >
> > vsi->flags = ICE_VSI_FLAG_NO_INIT;
> >
> > + vsi->req_txq = vf->num_req_qs;
> > + vsi->req_rxq = vf->num_req_qs;
> > +
> > + err = ice_vsi_realloc_stat_arrays(vsi);
> > + if (err)
> > + return err;
> > +
> > ice_vsi_decfg(vsi);
> > ice_fltr_remove_all(vsi);
> >
> > --
> > 2.54.0
>