On Sat, Nov 07, 2026 at 11:52:15PM +0000, Anurag Mandal wrote:
> ice_dcf_hierarchy_commit() keeps a copy of the bandwidth config
> of each VF, and of the TC nodes, in qos_bw_cfg[] to replay it
> after a VF reset.
> Each DCF hierarchy commit allocates commit allocates new copies
> of the VF and TC bandwidth config for VF reset replay, without
> freeing the previous ones,
> They cannot simply be freed there, as the VF reset thread may be
> replaying them at the same time.
> A new copy is also visible to that thread before it is filled in.
> Also, ice_dcf_uninit_hw() frees the array but not the copies, so
> they also leak on close and reset.
>
> Fill each new copy first, then swap it in under the lock the VF
> reset thread holds while replaying, and free the old copy after
> that and free all copies in ice_dcf_uninit_hw().
>
> Fixes: 931ee54072b1 ("net/ice: support QoS bandwidth config after VF reset in
> DCF")
> Fixes: 775a25a372f5 ("net/ice: clear QoS bandwidth on DCF close")
> Cc: [email protected]
>
> Signed-off-by: Anurag Mandal <[email protected]>
> ---
> drivers/net/intel/ice/ice_dcf.c | 6 ++++++
> drivers/net/intel/ice/ice_dcf_ethdev.h | 2 ++
> drivers/net/intel/ice/ice_dcf_parent.c | 15 +++++++++++++++
> drivers/net/intel/ice/ice_dcf_sched.c | 17 +++++++++--------
> 4 files changed, 32 insertions(+), 8 deletions(-)
>
Acked-by: Bruce Richardson <[email protected]>