net/ice/base: check failed acts allocation
[dpdk.git] / drivers / net / ice / base / ice_sched.c
index f5f3b85..1374b9a 100644 (file)
@@ -165,8 +165,7 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer,
        parent = ice_sched_find_node_by_teid(pi->root,
                                             LE32_TO_CPU(info->parent_teid));
        if (!parent) {
-               ice_debug(hw, ICE_DBG_SCHED,
-                         "Parent Node not found for parent_teid=0x%x\n",
+               ice_debug(hw, ICE_DBG_SCHED, "Parent Node not found for parent_teid=0x%x\n",
                          LE32_TO_CPU(info->parent_teid));
                return ICE_ERR_PARAM;
        }
@@ -742,8 +741,7 @@ static void ice_sched_clear_rl_prof(struct ice_port_info *pi)
                        rl_prof_elem->prof_id_ref = 0;
                        status = ice_sched_del_rl_profile(hw, rl_prof_elem);
                        if (status) {
-                               ice_debug(hw, ICE_DBG_SCHED,
-                                         "Remove rl profile failed\n");
+                               ice_debug(hw, ICE_DBG_SCHED, "Remove rl profile failed\n");
                                /* On error, free mem required */
                                LIST_DEL(&rl_prof_elem->list_entry);
                                ice_free(hw, rl_prof_elem);
@@ -930,8 +928,7 @@ ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node,
        for (i = 0; i < num_nodes; i++) {
                status = ice_sched_add_node(pi, layer, &buf->generic[i]);
                if (status != ICE_SUCCESS) {
-                       ice_debug(hw, ICE_DBG_SCHED,
-                                 "add nodes in SW DB failed status =%d\n",
+                       ice_debug(hw, ICE_DBG_SCHED, "add nodes in SW DB failed status =%d\n",
                                  status);
                        break;
                }
@@ -939,8 +936,7 @@ ice_sched_add_elems(struct ice_port_info *pi, struct ice_sched_node *tc_node,
                teid = LE32_TO_CPU(buf->generic[i].node_teid);
                new_node = ice_sched_find_node_by_teid(parent, teid);
                if (!new_node) {
-                       ice_debug(hw, ICE_DBG_SCHED,
-                                 "Node is missing for teid =%d\n", teid);
+                       ice_debug(hw, ICE_DBG_SCHED, "Node is missing for teid =%d\n", teid);
                        break;
                }
 
@@ -1297,8 +1293,7 @@ struct ice_sched_node *ice_sched_get_node(struct ice_port_info *pi, u32 teid)
        ice_release_lock(&pi->sched_lock);
 
        if (!node)
-               ice_debug(pi->hw, ICE_DBG_SCHED,
-                         "Node not found for teid=0x%x\n", teid);
+               ice_debug(pi->hw, ICE_DBG_SCHED, "Node not found for teid=0x%x\n", teid);
 
        return node;
 }
@@ -2048,8 +2043,7 @@ ice_sched_rm_vsi_cfg(struct ice_port_info *pi, u16 vsi_handle, u8 owner)
                        continue;
 
                if (ice_sched_is_leaf_node_present(vsi_node)) {
-                       ice_debug(pi->hw, ICE_DBG_SCHED,
-                                 "VSI has leaf nodes in TC %d\n", i);
+                       ice_debug(pi->hw, ICE_DBG_SCHED, "VSI has leaf nodes in TC %d\n", i);
                        status = ICE_ERR_IN_USE;
                        goto exit_sched_rm_vsi_cfg;
                }
@@ -2891,8 +2885,7 @@ static void ice_sched_rm_unused_rl_prof(struct ice_port_info *pi)
                                         &pi->rl_prof_list[ln],
                                         ice_aqc_rl_profile_info, list_entry) {
                        if (!ice_sched_del_rl_profile(pi->hw, rl_prof_elem))
-                               ice_debug(pi->hw, ICE_DBG_SCHED,
-                                         "Removed rl profile\n");
+                               ice_debug(pi->hw, ICE_DBG_SCHED, "Removed rl profile\n");
                }
        }
 }
@@ -4143,8 +4136,7 @@ ice_sched_rm_rl_profile(struct ice_port_info *pi, u8 layer_num, u8 profile_type,
                        /* Remove old profile ID from database */
                        status = ice_sched_del_rl_profile(pi->hw, rl_prof_elem);
                        if (status && status != ICE_ERR_IN_USE)
-                               ice_debug(pi->hw, ICE_DBG_SCHED,
-                                         "Remove rl profile failed\n");
+                               ice_debug(pi->hw, ICE_DBG_SCHED, "Remove rl profile failed\n");
                        break;
                }
        if (status == ICE_ERR_IN_USE)
@@ -5389,6 +5381,26 @@ void ice_sched_replay_agg_vsi_preinit(struct ice_hw *hw)
        ice_release_lock(&pi->sched_lock);
 }
 
+/**
+ * ice_sched_replay_root_node_bw - replay root node BW
+ * @pi: port information structure
+ *
+ * Replay root node BW settings.
+ */
+enum ice_status ice_sched_replay_root_node_bw(struct ice_port_info *pi)
+{
+       enum ice_status status = ICE_SUCCESS;
+
+       if (!pi->hw)
+               return ICE_ERR_PARAM;
+       ice_acquire_lock(&pi->sched_lock);
+
+       status = ice_sched_replay_node_bw(pi->hw, pi->root,
+                                         &pi->root_node_bw_t_info);
+       ice_release_lock(&pi->sched_lock);
+       return status;
+}
+
 /**
  * ice_sched_replay_tc_node_bw - replay TC node(s) BW
  * @pi: port information structure