]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ice: Fix failure to re-add LAN/RDMA Tx queues
authorBrett Creeley <brett.creeley@intel.com>
Mon, 28 Jun 2021 17:53:45 +0000 (10:53 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 14 Oct 2021 17:14:00 +0000 (10:14 -0700)
Currently if the VSI is rebuilt/removed and the RDMA PF driver is active
the RDMA Tx queue scheduler node configuration will not be cleaned up.
This will cause the rebuild/re-add of the VSI to fail due to the
software structures not being correctly cleaned up for the VSI index.
Fix this by always calling ice_rm_vsi_rdma_cfg() for all VSI. If there
are no RDMA scheduler nodes created, then there is no harm in calling
ice_rm_vsi_rdma_cfg(). This change applies to all VSI types, so if
RDMA support is added for other VSI types they will also get this
change.

Fixes: 348048e724a0 ("ice: Implement iidc operations")
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Jerzy Wiktor Jurkowski <jerzy.wiktor.jurkowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_sched.c
drivers/net/ethernet/intel/ice/ice_sched.h

index dde9802c6c72903302e74a9921b6d34576fd16c1..b718e196af2a4a02bf58e0498513f81ffa7b42c5 100644 (file)
@@ -2841,6 +2841,7 @@ void ice_napi_del(struct ice_vsi *vsi)
  */
 int ice_vsi_release(struct ice_vsi *vsi)
 {
+       enum ice_status err;
        struct ice_pf *pf;
 
        if (!vsi->back)
@@ -2912,6 +2913,10 @@ int ice_vsi_release(struct ice_vsi *vsi)
 
        ice_fltr_remove_all(vsi);
        ice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx);
+       err = ice_rm_vsi_rdma_cfg(vsi->port_info, vsi->idx);
+       if (err)
+               dev_err(ice_pf_to_dev(vsi->back), "Failed to remove RDMA scheduler config for VSI %u, err %d\n",
+                       vsi->vsi_num, err);
        ice_vsi_delete(vsi);
        ice_vsi_free_q_vectors(vsi);
 
@@ -3092,6 +3097,10 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
        prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce);
 
        ice_rm_vsi_lan_cfg(vsi->port_info, vsi->idx);
+       ret = ice_rm_vsi_rdma_cfg(vsi->port_info, vsi->idx);
+       if (ret)
+               dev_err(ice_pf_to_dev(vsi->back), "Failed to remove RDMA scheduler config for VSI %u, err %d\n",
+                       vsi->vsi_num, ret);
        ice_vsi_free_q_vectors(vsi);
 
        /* SR-IOV determines needed MSIX resources all at once instead of per
index 9f07b66417059bb0202d0167a527533000c55cb4..2d9b10277186b6c475674db6d6ad31a04c716506 100644 (file)
@@ -2070,6 +2070,19 @@ enum ice_status ice_rm_vsi_lan_cfg(struct ice_port_info *pi, u16 vsi_handle)
        return ice_sched_rm_vsi_cfg(pi, vsi_handle, ICE_SCHED_NODE_OWNER_LAN);
 }
 
+/**
+ * ice_rm_vsi_rdma_cfg - remove VSI and its RDMA children nodes
+ * @pi: port information structure
+ * @vsi_handle: software VSI handle
+ *
+ * This function clears the VSI and its RDMA children nodes from scheduler tree
+ * for all TCs.
+ */
+enum ice_status ice_rm_vsi_rdma_cfg(struct ice_port_info *pi, u16 vsi_handle)
+{
+       return ice_sched_rm_vsi_cfg(pi, vsi_handle, ICE_SCHED_NODE_OWNER_RDMA);
+}
+
 /**
  * ice_get_agg_info - get the aggregator ID
  * @hw: pointer to the hardware structure
index 9beef8f0ec76089d8644fba2fb32ad26d3280af3..fdf7a5882f076a893085c67978feb4e5b4bf4c99 100644 (file)
@@ -89,6 +89,7 @@ enum ice_status
 ice_sched_cfg_vsi(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 maxqs,
                  u8 owner, bool enable);
 enum ice_status ice_rm_vsi_lan_cfg(struct ice_port_info *pi, u16 vsi_handle);
+enum ice_status ice_rm_vsi_rdma_cfg(struct ice_port_info *pi, u16 vsi_handle);
 
 /* Tx scheduler rate limiter functions */
 enum ice_status