Skip to content

ice: support dynamic interrupt allocation

Piotr Raczynski intel-wired-lan netdev 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest8 patches 0 repliesNew
  2. v48 patches 3 repliesSuperseded
  3. v38 patches 19 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v28 patches5 repliesSuperseded
v18 patches0 repliesSuperseded

Changes in v5 from the cover letter

- ice: add dynamic interrupt allocation
- prevent q_vector leak in case vf ctrl VSI error
- ice: refactor VF control VSI interrupt handling
- simplify ice_vsi_setup_vector_base and account for num_avail_sw_msix

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8ice: move interrupt related code to separate filedrivers/net/ethernet/intel/ice/Makefile drivers/net/ethernet/intel/ice/ice.h drivers/net/ethernet/intel/ice/ice_irq.c +2 more+238 -2180 replies
2/8ice: use pci_irq_vector helper functiondrivers/net/ethernet/intel/ice/ice_arfs.c drivers/net/ethernet/intel/ice/ice_lib.c drivers/net/ethernet/intel/ice/ice_main.c +2 more+11 -110 replies
3/8ice: use preferred MSIX allocation apidrivers/net/ethernet/intel/ice/ice_idc.c drivers/net/ethernet/intel/ice/ice_irq.c drivers/net/ethernet/intel/ice/ice_main.c+37 -380 replies
4/8ice: refactor VF control VSI interrupt handlingdrivers/net/ethernet/intel/ice/ice_lib.c drivers/net/ethernet/intel/ice/ice_vf_lib.c drivers/net/ethernet/intel/ice/ice_vf_lib.h+58 -660 replies
5/8ice: remove redundant SRIOV codedrivers/net/ethernet/intel/ice/ice_sriov.c+0 -360 replies
6/8ice: add individual interrupt allocationdrivers/net/ethernet/intel/ice/ice.h drivers/net/ethernet/intel/ice/ice_arfs.c drivers/net/ethernet/intel/ice/ice_base.c +10 more+165 -2820 replies
7/8ice: track interrupt vectors with xarraydrivers/net/ethernet/intel/ice/ice.h drivers/net/ethernet/intel/ice/ice_irq.c drivers/net/ethernet/intel/ice/ice_irq.h +3 more+89 -840 replies
8/8ice: add dynamic interrupt allocationdrivers/net/ethernet/intel/ice/ice.h drivers/net/ethernet/intel/ice/ice_base.c drivers/net/ethernet/intel/ice/ice_idc.c +4 more+107 -210 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchJacob KellerSimon HormanPucha Himasekhar ReddyMichal SwiatkowskiRafal Romanowski
1/8R-b R-b T-b
2/8R-b T-b R-b
3/8R-b T-b R-b
4/8R-b R-b T-b
5/8R-b R-b R-b T-b
6/8R-b R-b T-b R-b
7/8R-b R-b T-b R-b
8/8R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v5 thread

Cover letter [PATCH iwl-next v5 0/8] ice: support dynamic interrupt allocation

This patchset reimplements MSIX interrupt allocation logic to allow dynamic interrupt allocation after MSIX has been initially enabled. This allows current and future features to allocate and free interrupts as needed and will help to drastically decrease number of initially preallocated interrupts (even down to the API hard limit of 1). Although this patchset does not change behavior in terms of actual number of allocated interrupts during probe, it will be subject to change.

First few patches prepares to introduce dynamic allocation by moving interrupt allocation code to separate file and update allocation API used in the driver to the currently preferred one.

Due to the current contract between ice and irdma driver which is directly accessing msix entries allocated by ice driver, even after moving away from older pci_enable_msix_range function, still keep msix_entries array for irdma use.

Next patches refactors and removes redundant code from SRIOV related logic as it also make it easier to move away from static allocation scheme.

Last patches actually enables dynamic allocation of MSIX interrupts. First, introduce functions to allocate and free interrupts individually. This sets ground for the rest of the changes even if that patch still allocates the interrupts from the preallocated pool. Since this patch starts to keep interrupt details in ice_q_vector structure we can get rid of functions that calculates base vector number and register offset for the interrupt as it is equal to the interrupt index. Only keep separate register offset functions for the VF VSIs.

Next, replace homegrown interrupt tracker with much simpler xarray based approach. As new API always allocate interrupts one by one, also track interrupts in the same manner.

Lastly, extend the interrupt tracker to deal both with preallocated and dynamically allocated vectors and use pci_msix_alloc_irq_at and pci_msix_free_irq functions. Since not all architecture supports dynamic allocation, check it before trying to allocate a new interrupt.

As previously mentioned, this patchset does not change number of initially allocated interrupts during init phase but now it can and will likely be changed.

Patch 1-3 -> move code around and use newer API Patch 4-5 -> refactor and remove redundant SRIOV code

Patch 6   -> allocate every interrupt individually
Patch 7   -> replace homegrown interrupt tracker with xarray
Patch 8   -> allow dynamic interrupt allocation

Change history:
v1 -> v2:
- ice: refactor VF control VSI interrupt handling
- move ice_get_vf_ctrl_vsi to ice_lib.c (ice_vf_lib.c depends on CONFIG_PCI_IOV)
v2 -> v3:
- ice: refactor VF control VSI interrupt handling
- revert v2 change and add no-op function in case of CONFIG_PCI_IOV=n
- ice: add dynamic interrupt allocation
- fix commit message
v3 -> v4:
- ice: add individual interrupt allocation
- don't use devm alloc/free for q_vectors
- ice: track interrupt vectors with xarray
- just return NULL instead of goto if interrupt allocation failed
- ice: add dynamic interrupt allocation
- exit if released irq entry was not found in the tracker
v4 -> v5:
- ice: add dynamic interrupt allocation
- prevent q_vector leak in case vf ctrl VSI error
- ice: refactor VF control VSI interrupt handling
- simplify ice_vsi_setup_vector_base and account for num_avail_sw_msix

Piotr Raczynski (8):
ice: move interrupt related code to separate file
ice: use pci_irq_vector helper function
ice: use preferred MSIX allocation api
ice: refactor VF control VSI interrupt handling
ice: remove redundant SRIOV code
ice: add individual interrupt allocation
ice: track interrupt vectors with xarray
ice: add dynamic interrupt allocation

 drivers/net/ethernet/intel/ice/Makefile      |   1 +
 drivers/net/ethernet/intel/ice/ice.h         |  24 +-
 drivers/net/ethernet/intel/ice/ice_arfs.c    |   5 +-
 drivers/net/ethernet/intel/ice/ice_base.c    |  50 ++-
 drivers/net/ethernet/intel/ice/ice_ethtool.c |   2 +-
 drivers/net/ethernet/intel/ice/ice_idc.c     |  54 ++-
 drivers/net/ethernet/intel/ice/ice_irq.c     | 378 +++++++++++++++++++
 drivers/net/ethernet/intel/ice/ice_irq.h     |  25 ++
 drivers/net/ethernet/intel/ice/ice_lib.c     | 288 +-------------
 drivers/net/ethernet/intel/ice/ice_lib.h     |   5 -
 drivers/net/ethernet/intel/ice/ice_main.c    | 268 ++-----------
 drivers/net/ethernet/intel/ice/ice_ptp.c     |   2 +-
 drivers/net/ethernet/intel/ice/ice_sriov.c   |  43 +--
 drivers/net/ethernet/intel/ice/ice_vf_lib.c  |  32 ++
 drivers/net/ethernet/intel/ice/ice_vf_lib.h  |   7 +
 drivers/net/ethernet/intel/ice/ice_xsk.c     |   5 +-
 16 files changed, 569 insertions(+), 620 deletions(-)
 create mode 100644 drivers/net/ethernet/intel/ice/ice_irq.c
 create mode 100644 drivers/net/ethernet/intel/ice/ice_irq.h
Signature · 6 lines
2.38.1

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan