Lines Matching refs:rl_data

120 static struct rl_sla *find_parent(struct adf_rl *rl_data,  in find_parent()  argument
132 parent_sla = rl_data->sla[input_parent_id]; in find_parent()
147 if (rl_data->root[i] && rl_data->root[i]->srv == sla_in->srv) { in find_parent()
148 root = rl_data->root[i]; in find_parent()
164 if (rl_data->cluster[i] && rl_data->cluster[i]->parent == root) in find_parent()
165 return rl_data->cluster[i]; in find_parent()
193 u32 adf_rl_get_sla_arr_of_type(struct adf_rl *rl_data, enum rl_node_type type, in adf_rl_get_sla_arr_of_type() argument
198 *sla_arr = rl_data->leaf; in adf_rl_get_sla_arr_of_type()
201 *sla_arr = rl_data->cluster; in adf_rl_get_sla_arr_of_type()
204 *sla_arr = rl_data->root; in adf_rl_get_sla_arr_of_type()
297 u32 base_offset = hw_data->rl_data.r2l_offset; in assign_rps_to_leaf()
313 u32 base_offset = hw_data->rl_data.l2c_offset; in assign_leaf_to_cluster()
327 u32 base_offset = hw_data->rl_data.c2s_offset; in assign_cluster_to_root()
411 static bool is_enough_budget(struct adf_rl *rl_data, struct rl_sla *sla, in is_enough_budget() argument
415 u32 max_val = rl_data->device_data->scale_ref; in is_enough_budget()
487 static int get_next_free_sla_id(struct adf_rl *rl_data) in get_next_free_sla_id() argument
491 while (i < RL_NODES_CNT_MAX && rl_data->sla[i++]) in get_next_free_sla_id()
509 static int get_next_free_node_id(struct adf_rl *rl_data, struct rl_sla *sla) in get_next_free_node_id() argument
511 struct adf_hw_device_data *hw_device = GET_HW_DATA(rl_data->accel_dev); in get_next_free_node_id()
528 sla_list = rl_data->leaf; in get_next_free_node_id()
534 sla_list = rl_data->cluster; in get_next_free_node_id()
554 struct adf_rl_hw_data *device_data = &accel_dev->hw_device->rl_data; in adf_rl_calculate_slice_tokens()
587 struct adf_rl_hw_data *device_data = &accel_dev->hw_device->rl_data; in adf_rl_calculate_ae_cycles()
610 struct adf_rl_hw_data *device_data = &accel_dev->hw_device->rl_data; in adf_rl_calculate_pci_bw()
652 struct adf_rl *rl_data = accel_dev->rate_limiting; in add_new_sla_entry() local
672 ret = get_next_free_node_id(rl_data, sla); in add_new_sla_entry()
680 ret = get_next_free_sla_id(rl_data); in add_new_sla_entry()
688 sla->parent = find_parent(rl_data, sla_in); in add_new_sla_entry()
723 struct adf_rl *rl_data = accel_dev->rate_limiting; in initialize_default_nodes() local
724 struct adf_rl_hw_data *device_data = rl_data->device_data; in initialize_default_nodes()
749 if (!rl_data->root[i]) in initialize_default_nodes()
752 sla_in.cir = rl_data->root[i]->cir; in initialize_default_nodes()
754 sla_in.srv = rl_data->root[i]->srv; in initialize_default_nodes()
764 static void clear_sla(struct adf_rl *rl_data, struct rl_sla *sla) in clear_sla() argument
766 bool *rp_in_use = rl_data->rp_in_use; in clear_sla()
781 adf_rl_get_sla_arr_of_type(rl_data, sla->type, &sla_type_arr); in clear_sla()
782 assign_node_to_parent(rl_data->accel_dev, sla, true); in clear_sla()
783 adf_rl_send_admin_delete_msg(rl_data->accel_dev, node_id, sla->type); in clear_sla()
784 mark_rps_usage(sla, rl_data->rp_in_use, false); in clear_sla()
787 rl_data->sla[sla_id] = NULL; in clear_sla()
793 struct adf_rl *rl_data = accel_dev->rate_limiting; in free_all_sla() local
796 mutex_lock(&rl_data->rl_lock); in free_all_sla()
799 if (!rl_data->sla[sla_id]) in free_all_sla()
802 kfree(rl_data->sla[sla_id]); in free_all_sla()
803 rl_data->sla[sla_id] = NULL; in free_all_sla()
806 mutex_unlock(&rl_data->rl_lock); in free_all_sla()
824 struct adf_rl *rl_data = accel_dev->rate_limiting; in add_update_sla() local
836 mutex_lock(&rl_data->rl_lock); in add_update_sla()
848 sla = rl_data->sla[sla_in->sla_id]; in add_update_sla()
856 if (!is_enough_budget(rl_data, sla, sla_in, is_update)) { in add_update_sla()
877 mark_rps_usage(sla, rl_data->rp_in_use, true); in add_update_sla()
878 adf_rl_get_sla_arr_of_type(rl_data, sla->type, &sla_type_arr); in add_update_sla()
880 rl_data->sla[sla->sla_id] = sla; in add_update_sla()
892 mutex_unlock(&rl_data->rl_lock); in add_update_sla()
986 struct adf_rl *rl_data = accel_dev->rate_limiting; in adf_rl_get_capability_remaining() local
994 sla = rl_data->sla[sla_id]; in adf_rl_get_capability_remaining()
1001 if (!rl_data->cluster[i]) in adf_rl_get_capability_remaining()
1004 if (rl_data->cluster[i]->srv == srv) { in adf_rl_get_capability_remaining()
1005 sla = rl_data->cluster[i]; in adf_rl_get_capability_remaining()
1026 struct adf_rl *rl_data = accel_dev->rate_limiting; in adf_rl_remove_sla() local
1030 mutex_lock(&rl_data->rl_lock); in adf_rl_remove_sla()
1035 sla = rl_data->sla[sla_id]; in adf_rl_remove_sla()
1044 clear_sla(rl_data, sla); in adf_rl_remove_sla()
1047 mutex_unlock(&rl_data->rl_lock); in adf_rl_remove_sla()
1058 struct adf_rl *rl_data = accel_dev->rate_limiting; in adf_rl_remove_sla_all() local
1064 mutex_lock(&rl_data->rl_lock); in adf_rl_remove_sla_all()
1068 max_id = adf_rl_get_sla_arr_of_type(rl_data, j, &sla_type_arr); in adf_rl_remove_sla_all()
1074 clear_sla(rl_data, sla_type_arr[i]); in adf_rl_remove_sla_all()
1078 mutex_unlock(&rl_data->rl_lock); in adf_rl_remove_sla_all()
1084 struct adf_rl_hw_data *rl_hw_data = &hw_data->rl_data; in adf_rl_init()
1107 rl->device_data = &accel_dev->hw_device->rl_data; in adf_rl_init()
1118 struct adf_rl_hw_data *rl_hw_data = &GET_HW_DATA(accel_dev)->rl_data; in adf_rl_start()