aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_lib.c
diff options
context:
space:
mode:
authorAkeem G Abodunrin <akeem.g.abodunrin@intel.com>2019-02-08 15:51:01 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-03-22 11:19:16 -0400
commit7eeac889769ae96dbeb2209b816e14b12e0f9f6f (patch)
tree91bb463fff778ce42008ab72fde9ace397900c2d /drivers/net/ethernet/intel/ice/ice_lib.c
parentcb93a9529de8428f4b0bc76f6e6dced382712bcd (diff)
ice: Fix issue reclaiming resources back to the pool after reset
This patch fixes issue reclaiming VF resources back to the pool after reset - Since we only allocate HW vector for all VFs and track together with resources allocation for PF with ice_search_res, we need to free VFs resources separately, using first VF vector index to traverse the list. Otherwise tracker starts from the last assigned vectors list and causes maximum supported number of HW vectors, 1024 to be exhausted, depending on the number of VFs enabled, which causes a lot of unwanted issues, and failed to reassign vectors for VFs. Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_lib.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_lib.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index e3b44d413d5f..4763df009ed1 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -2655,6 +2655,7 @@ int ice_vsi_release(struct ice_vsi *vsi)
2655int ice_vsi_rebuild(struct ice_vsi *vsi) 2655int ice_vsi_rebuild(struct ice_vsi *vsi)
2656{ 2656{
2657 u16 max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 }; 2657 u16 max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 };
2658 struct ice_vf *vf = NULL;
2658 struct ice_pf *pf; 2659 struct ice_pf *pf;
2659 int ret, i; 2660 int ret, i;
2660 2661
@@ -2662,12 +2663,31 @@ int ice_vsi_rebuild(struct ice_vsi *vsi)
2662 return -EINVAL; 2663 return -EINVAL;
2663 2664
2664 pf = vsi->back; 2665 pf = vsi->back;
2666 if (vsi->type == ICE_VSI_VF)
2667 vf = &pf->vf[vsi->vf_id];
2668
2665 ice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx); 2669 ice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx);
2666 ice_vsi_free_q_vectors(vsi); 2670 ice_vsi_free_q_vectors(vsi);
2667 ice_free_res(vsi->back->sw_irq_tracker, vsi->sw_base_vector, vsi->idx); 2671
2668 ice_free_res(vsi->back->hw_irq_tracker, vsi->hw_base_vector, vsi->idx); 2672 if (vsi->type != ICE_VSI_VF) {
2669 vsi->sw_base_vector = 0; 2673 /* reclaim SW interrupts back to the common pool */
2674 ice_free_res(pf->sw_irq_tracker, vsi->sw_base_vector, vsi->idx);
2675 pf->num_avail_sw_msix += vsi->num_q_vectors;
2676 vsi->sw_base_vector = 0;
2677 /* reclaim HW interrupts back to the common pool */
2678 ice_free_res(pf->hw_irq_tracker, vsi->hw_base_vector,
2679 vsi->idx);
2680 pf->num_avail_hw_msix += vsi->num_q_vectors;
2681 } else {
2682 /* Reclaim VF resources back to the common pool for reset and
2683 * and rebuild, with vector reassignment
2684 */
2685 ice_free_res(pf->hw_irq_tracker, vf->first_vector_idx,
2686 vsi->idx);
2687 pf->num_avail_hw_msix += pf->num_vf_msix;
2688 }
2670 vsi->hw_base_vector = 0; 2689 vsi->hw_base_vector = 0;
2690
2671 ice_vsi_clear_rings(vsi); 2691 ice_vsi_clear_rings(vsi);
2672 ice_vsi_free_arrays(vsi, false); 2692 ice_vsi_free_arrays(vsi, false);
2673 ice_dev_onetime_setup(&vsi->back->hw); 2693 ice_dev_onetime_setup(&vsi->back->hw);