Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iwl-next v2 0/6] ice: refactor aggregator node logic
@ 2026-10-09 20:11 Jacob Keller
  2026-10-09 20:11 ` [PATCH iwl-next v2 1/6] ice: convert hw->agg_list from linked list to xarray Jacob Keller
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Jacob Keller @ 2026-10-09 20:11 UTC (permalink / raw)
  To: Intel Wired LAN, Anthony Nguyen
  Cc: Przemek Kitszel, Aleksandr Loktionov, Jacob Keller,
	Aleksandr Loktionov

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.

-- Outstanding and preexisting issues --

It seems that since commit 47e3e53ceadc ("ice: Destroy scheduler tree in
reset path"), the reset paths now calls ice_rm_vsi_lan_cfg() which calls
ice_sched_rm_vsi_cfg() which will eventually call
ice_sched_rm_agg_vsi_info(), clearing the aggregator node info after a
reset. Since this removes the data from the agg_info structures, the replay
logic does not appear to replay aggregator node info properly after a
reset. The driver only calls ice_set_agg_vsi() once during ice_vsi_setup()
and does not call it during ice_vsi_cfg() or any rebuild path. I suspect
that post-reset the driver will leave all VSIs effectively in the default
aggregator node. This appears to be a preexisting issue since the
above-mentioned commit, which I have not attempted to fix in this series.

The logic for aggregator nodes and traffic classes is quite confusing. We
pass the ena_tc bits into the functions to create aggregator nodes, with
each node having a tc_bitmap of the enabled TCs. However, since we only
perform this setup during initialization, any changes to the traffic
classes do not get reflected in aggregator node configuration. The logic in
ice_sched.c is very confusing because it seems to imply that each VSI can
have its own set of traffic classes, but there is no attempt to handle the
case where a VSI with one set of TCs is placed onto an aggregator node
created with a different set of TCs. This appears to be a preexisting logic
since the beginning of driver development, which I have not attempted to
fix in this series.

Several places in the driver use a u8 for storing enabled TCs, while others
use proper bitmap APIs. This probably should be cleaned up so that
everything uses the same style instead of mixing and matching, copying or
casting from u8 to unsigned long, or using tc_bitmap[0] in places that
should have just passed the bitmap by pointer instead of by value. I
thought about cleaning this up but left it out of this series.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
Changes in v2:
- Rename agg_list to agg_nodes to avoid implying the old data structure
  type
- Squash the cleanup of passing agg_info around into the patch for
  extracting aggregator allocation out of ice_sched_cfg_agg. This
  sequencing is cleaner and more logical.
- Add a patch to also pass agg_info instead of performing a lookup at a few
  other functions that now already have a valid agg_info pointer in the
  callers.
- Move configuring an allocator node into ice_find_available_agg, so that
  we only call ice_sched_cfg_agg() once per node. This fixes a behavioral
  difference with the previous implementation that was pointed out by
  Sashiko.
- Link to v1: https://patch.msgid.link/20260601-jk-cleanup-vsi-aggregator-nodes-v1-0-36d6ecbe5ede@intel.com

---
Jacob Keller (6):
      ice: convert hw->agg_list from linked list to xarray
      ice: count number of VSIS in agg_vsi_list
      ice: extract aggregator allocation out of ice_sched_cfg_agg
      ice: pass agg_info instead of performing lookup
      ice: remove ice_agg_node wrapper structure
      ice: remove unused aggregator node functions

 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  | 336 ++++++++++++++++------------
 drivers/net/ethernet/intel/ice/ice_vf_lib.c |  22 +-
 8 files changed, 237 insertions(+), 284 deletions(-)
---
base-commit: 4fdf2a2915a3c1baa162671f8c7155cebf02354c
change-id: 20260505-jk-cleanup-vsi-aggregator-nodes-9bb5285cceb4

Best regards,
--  
Jacob Keller <jacob.e.keller@intel.com>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-10-09 23:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09 20:11 [PATCH iwl-next v2 0/6] ice: refactor aggregator node logic Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 1/6] ice: convert hw->agg_list from linked list to xarray Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 2/6] ice: count number of VSIS in agg_vsi_list Jacob Keller
2026-10-09 20:27   ` sashiko-bot
2026-10-09 23:11     ` Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 3/6] ice: extract aggregator allocation out of ice_sched_cfg_agg Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 4/6] ice: pass agg_info instead of performing lookup Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 5/6] ice: remove ice_agg_node wrapper structure Jacob Keller
2026-10-09 20:26   ` sashiko-bot
2026-10-09 23:08     ` Jacob Keller
2026-10-09 20:11 ` [PATCH iwl-next v2 6/6] ice: remove unused aggregator node functions Jacob Keller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox