The ice hardware uses aggregator nodes to track VSIs in the device scheduler tree. The existing logic used by the ice driver results in a two-layered tracking approach where the VSI has an ice_agg_node structure that wraps the ice_sched_agg_info structure.
This logic is done outside of the scheduler code, and results in the driver having two sources of "truth" for the aggregator nodes. If the two places become out of sync it could lead to imbalances in the scheduler tree, or failure to use the device resources as effectively. In addition, the tracking logic requires each struct ice_pf to contain two arrays, pf_agg_node and vf_agg_node, which track the ice_agg_node structures. This wastes about a kilobyte of memory (~5% of the total PF structure size). Almost all of the information required is already stored in the ice_sched_agg_info structure, so duplicating this information is redundant and unnecessary. This series refactors the logic in ice_sched.c, converting from a linked list to an xarray, implements a new ice_cfg_vsi_agg() function to replace the ice_cfg_agg() function. The new logic better integrates with what the driver actually wants to do. The result is that aggregator node information is tracked in only one place, preventing the possibility that it gets out of sync. Note: this depends on a bug fix that was spotted by sashiko during early development of this series: https://patchwork.ozlabs.org/project/intel-wired-lan/patch/[email protected]/ Signed-off-by: Jacob Keller <[email protected]> --- --- Jacob Keller (6): ice: convert hw->agg_list from linked list to xarray ice: count number of VSIS in agg_vsi_list ice: extract function to allocate aggregator info structure ice: remove ice_agg_node wrapper structure ice: remove unused aggregator node functions ice: refactor ice_sched_cfg_agg to take agg_info pointer drivers/net/ethernet/intel/ice/ice.h | 23 +-- drivers/net/ethernet/intel/ice/ice_sched.h | 13 +- drivers/net/ethernet/intel/ice/ice_type.h | 2 +- drivers/net/ethernet/intel/ice/ice_common.c | 4 +- drivers/net/ethernet/intel/ice/ice_lib.c | 114 ++--------- drivers/net/ethernet/intel/ice/ice_main.c | 7 - drivers/net/ethernet/intel/ice/ice_sched.c | 290 +++++++++++++++++----------- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 22 +-- 8 files changed, 218 insertions(+), 257 deletions(-) --- base-commit: f2047b9d846f79959cbb1fba812b967a86a3f024 change-id: 20260505-jk-cleanup-vsi-aggregator-nodes-9bb5285cceb4 Best regards, -- Jacob Keller <[email protected]>
