summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_irq.h
diff options
context:
space:
mode:
authorPiotr Raczynski <piotr.raczynski@intel.com>2023-05-15 21:03:19 +0200
committerTony Nguyen <anthony.l.nguyen@intel.com>2023-05-16 09:38:38 -0700
commit011670cc340cbc1131677fe233b1a52acee969ee (patch)
tree439b5731d00976d4f8395dd722a022db08260e1a /drivers/net/ethernet/intel/ice/ice_irq.h
parentcfebc0a36ea5518d6b32a6999da5accf0a94fafa (diff)
downloadlinux-stable-011670cc340cbc1131677fe233b1a52acee969ee.tar.gz
linux-stable-011670cc340cbc1131677fe233b1a52acee969ee.tar.bz2
linux-stable-011670cc340cbc1131677fe233b1a52acee969ee.zip
ice: add dynamic interrupt allocation
Currently driver can only allocate interrupt vectors during init phase by calling pci_alloc_irq_vectors. Change that and make use of new pci_msix_alloc_irq_at/pci_msix_free_irq API and enable to allocate and free more interrupts after MSIX has been enabled. Since not all platforms supports dynamic allocation, check it with pci_msix_can_alloc_dyn. Extend the tracker to keep track how many interrupts are allocated initially so when all such vectors are already used, additional interrupts are automatically allocated dynamically. Remember each interrupt allocation method to then free appropriately. Since some features may require interrupts allocated dynamically add appropriate VSI flag and take it into account when allocating new interrupt. Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Piotr Raczynski <piotr.raczynski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_irq.h')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_irq.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_irq.h b/drivers/net/ethernet/intel/ice/ice_irq.h
index da5cdb1f0d3a..f35efc08575e 100644
--- a/drivers/net/ethernet/intel/ice/ice_irq.h
+++ b/drivers/net/ethernet/intel/ice/ice_irq.h
@@ -6,17 +6,20 @@
struct ice_irq_entry {
unsigned int index;
+ bool dynamic; /* allocation type flag */
};
struct ice_irq_tracker {
struct xarray entries;
u16 num_entries; /* total vectors available */
+ u16 num_static; /* preallocated entries */
};
int ice_init_interrupt_scheme(struct ice_pf *pf);
void ice_clear_interrupt_scheme(struct ice_pf *pf);
-struct msi_map ice_alloc_irq(struct ice_pf *pf);
+struct msi_map ice_alloc_irq(struct ice_pf *pf, bool dyn_only);
void ice_free_irq(struct ice_pf *pf, struct msi_map map);
+int ice_get_max_used_msix_vector(struct ice_pf *pf);
#endif