1. Feb 04, 2023
    • Jacob Keller's avatar
      ice: stop hard coding the ICE_VSI_CTRL location · a696d615
      Jacob Keller authored
      
      
      When allocating the ICE_VSI_CTRL, the allocated struct ice_vsi pointer is
      stored into the PF's pf->vsi array at a fixed location. This was
      historically done on the basis that it could provide an O(1) lookup for the
      special control VSI.
      
      Since we store the ctrl_vsi_idx, we already have O(1) lookup regardless of
      where in the array we store this VSI.
      
      Simplify the logic in ice_vsi_alloc by using the same method of storing the
      control VSI as other types of VSIs.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
      Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      a696d615
    • Michal Swiatkowski's avatar
      ice: split ice_vsi_setup into smaller functions · 6624e780
      Michal Swiatkowski authored
      
      
      Main goal is to reuse the same functions in VSI config and rebuild
      paths.
      To do this split ice_vsi_setup into smaller pieces and reuse it during
      rebuild.
      
      ice_vsi_alloc() should only alloc memory, not set the default values
      for VSI.
      Move setting defaults to separate function. This will allow config of
      already allocated VSI, for example in reload path.
      
      The path is mostly moving code around without introducing new
      functionality. Functions ice_vsi_cfg() and ice_vsi_decfg() were
      added, but they are using code that already exist.
      
      Use flag to pass information about VSI initialization during rebuild
      instead of using boolean value.
      
      Co-developed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
      Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      6624e780
    • Michal Swiatkowski's avatar
      ice: cleanup in VSI config/deconfig code · 0db66d20
      Michal Swiatkowski authored
      
      
      Do few small cleanups:
      
      1) Rename the function to reflect that it doesn't configure all things
      related to VSI. ice_vsi_cfg_lan() better fits to what function is doing.
      
      ice_vsi_cfg() can be use to name function that will configure whole VSI.
      
      2) Remove unused ethtype field from VSI. There is no need to set
      ethtype here, because it is never used.
      
      3) Remove unnecessary check for ICE_VSI_CHNL. There is check for
      ICE_VSI_CHNL in ice_vsi_get_qs, so there is no need to check it before
      calling the function.
      
      4) Simplify ice_vsi_alloc() call. There is no need to check the type of
      VSI before calling ice_vsi_alloc(). For ICE_VSI_CHNL vf is always NULL
      (ice_vsi_setup() is called with vf=NULL).
      For ICE_VSI_VF or ICE_VSI_CTRL ch is always NULL and for other VSI types
      ch and vf are always NULL.
      
      5) Remove unnecessary call to ice_vsi_dis_irq(). ice_vsi_dis_irq() will
      be called in ice_vsi_close() flow (ice_vsi_close() -> ice_vsi_down() ->
      ice_vsi_dis_irq()). Remove unnecessary call.
      
      6) Don't remove specific filters in release. All hw filters are removed
      in ice_fltr_remove_alli(), which is always called in VSI release flow.
      There is no need to remove only ethertype filters before calling
      ice_fltr_remove_all().
      
      7) Rename ice_vsi_clear() to ice_vsi_free(). As ice_vsi_clear() only
      free memory allocated in ice_vsi_alloc() rename it to ice_vsi_free()
      which better shows what function is doing.
      
      8) Free coalesce param in rebuild. There is potential memory leak if
      configuration of VSI lan fails. Free coalesce to avoid it.
      
      Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
      Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      0db66d20
    • Michal Swiatkowski's avatar
      ice: alloc id for RDMA using xa_array · 2be29286
      Michal Swiatkowski authored
      
      
      Use xa_array instead of deprecated ida to alloc id for RDMA aux driver.
      
      Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      2be29286
    • Michal Swiatkowski's avatar
      ice: move RDMA init to ice_idc.c · 2b8db6af
      Michal Swiatkowski authored
      
      
      Simplify probe flow by moving all RDMA related code to ice_init_rdma().
      Unroll irq allocation if RDMA initialization fails.
      
      Implement ice_deinit_rdma() and use it in remove flow.
      
      Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
      Acked-by: default avatarDave Ertman <david.m.ertman@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      2b8db6af
  2. Feb 03, 2023