Lines Matching refs:sla_in

34 			       struct adf_rl_sla_input_data *sla_in,  in validate_user_input()  argument
37 const unsigned long rp_mask = sla_in->rp_mask; in validate_user_input()
41 if (sla_in->pir < sla_in->cir) { in validate_user_input()
44 sla_in->pir = sla_in->cir; in validate_user_input()
49 rp_mask_size = sizeof(sla_in->rp_mask) * BITS_PER_BYTE; in validate_user_input()
58 if (sla_in->srv >= ADF_SVC_NONE) { in validate_user_input()
64 if (sla_in->type > RL_LEAF) { in validate_user_input()
70 if (sla_in->parent_id < RL_PARENT_DEFAULT_ID || in validate_user_input()
71 sla_in->parent_id >= RL_NODES_CNT_MAX) { in validate_user_input()
121 struct adf_rl_sla_input_data *sla_in) in find_parent() argument
123 int input_parent_id = sla_in->parent_id; in find_parent()
128 if (sla_in->type == RL_ROOT) in find_parent()
138 if (parent_sla && parent_sla->srv == sla_in->srv && in find_parent()
139 parent_sla->type == sla_in->type - 1) in find_parent()
147 if (rl_data->root[i] && rl_data->root[i]->srv == sla_in->srv) { in find_parent()
160 if (sla_in->type == RL_CLUSTER) in find_parent()
368 static bool can_parent_afford_sla(struct adf_rl_sla_input_data *sla_in, in can_parent_afford_sla() argument
377 if (sla_in->cir > rem_cir || sla_in->pir > sla_parent->pir) in can_parent_afford_sla()
395 static bool can_node_afford_update(struct adf_rl_sla_input_data *sla_in, in can_node_afford_update() argument
401 if (cir_in_use > sla_in->cir) in can_node_afford_update()
405 if (sla_in->pir < sla->pir && sla->type != RL_LEAF && cir_in_use > 0) in can_node_afford_update()
412 struct adf_rl_sla_input_data *sla_in, in is_enough_budget() argument
419 if (sla_in->cir > max_val || sla_in->pir > max_val) in is_enough_budget()
424 ret &= can_parent_afford_sla(sla_in, parent, sla->cir, in is_enough_budget()
428 ret &= can_parent_afford_sla(sla_in, parent, sla->cir, in is_enough_budget()
432 ret &= can_node_afford_update(sla_in, sla); in is_enough_budget()
437 ret &= can_node_afford_update(sla_in, sla); in is_enough_budget()
649 struct adf_rl_sla_input_data *sla_in, in add_new_sla_entry() argument
663 if (!is_service_enabled(accel_dev, sla_in->srv)) { in add_new_sla_entry()
670 sla->srv = sla_in->srv; in add_new_sla_entry()
671 sla->type = sla_in->type; in add_new_sla_entry()
688 sla->parent = find_parent(rl_data, sla_in); in add_new_sla_entry()
690 if (sla_in->parent_id != RL_PARENT_DEFAULT_ID) in add_new_sla_entry()
701 ret = prepare_rp_ids(accel_dev, sla, sla_in->rp_mask); in add_new_sla_entry()
725 struct adf_rl_sla_input_data sla_in = { }; in initialize_default_nodes() local
730 sla_in.type = RL_ROOT; in initialize_default_nodes()
731 sla_in.parent_id = RL_PARENT_DEFAULT_ID; in initialize_default_nodes()
737 sla_in.cir = device_data->scale_ref; in initialize_default_nodes()
738 sla_in.pir = sla_in.cir; in initialize_default_nodes()
739 sla_in.srv = i; in initialize_default_nodes()
741 ret = adf_rl_add_sla(accel_dev, &sla_in); in initialize_default_nodes()
747 sla_in.type = RL_CLUSTER; in initialize_default_nodes()
752 sla_in.cir = rl_data->root[i]->cir; in initialize_default_nodes()
753 sla_in.pir = sla_in.cir; in initialize_default_nodes()
754 sla_in.srv = rl_data->root[i]->srv; in initialize_default_nodes()
756 ret = adf_rl_add_sla(accel_dev, &sla_in); in initialize_default_nodes()
822 struct adf_rl_sla_input_data *sla_in, bool is_update) in add_update_sla() argument
830 if (!sla_in) { in add_update_sla()
839 ret = validate_user_input(accel_dev, sla_in, is_update); in add_update_sla()
844 ret = validate_sla_id(accel_dev, sla_in->sla_id); in add_update_sla()
848 sla = rl_data->sla[sla_in->sla_id]; in add_update_sla()
851 ret = add_new_sla_entry(accel_dev, sla_in, &sla); in add_update_sla()
856 if (!is_enough_budget(rl_data, sla, sla_in, is_update)) { in add_update_sla()
863 sla->cir = sla_in->cir; in add_update_sla()
864 sla->pir = sla_in->pir; in add_update_sla()
883 sla_in->sla_id = sla->sla_id; in add_update_sla()
888 sla_in->sla_id = -1; in add_update_sla()
908 struct adf_rl_sla_input_data *sla_in) in adf_rl_add_sla() argument
910 return add_update_sla(accel_dev, sla_in, false); in adf_rl_add_sla()
923 struct adf_rl_sla_input_data *sla_in) in adf_rl_update_sla() argument
925 return add_update_sla(accel_dev, sla_in, true); in adf_rl_update_sla()
940 struct adf_rl_sla_input_data *sla_in) in adf_rl_get_sla() argument
945 ret = validate_sla_id(accel_dev, sla_in->sla_id); in adf_rl_get_sla()
949 sla = accel_dev->rate_limiting->sla[sla_in->sla_id]; in adf_rl_get_sla()
950 sla_in->type = sla->type; in adf_rl_get_sla()
951 sla_in->srv = sla->srv; in adf_rl_get_sla()
952 sla_in->cir = sla->cir; in adf_rl_get_sla()
953 sla_in->pir = sla->pir; in adf_rl_get_sla()
954 sla_in->rp_mask = 0U; in adf_rl_get_sla()
956 sla_in->parent_id = sla->parent->sla_id; in adf_rl_get_sla()
958 sla_in->parent_id = RL_PARENT_DEFAULT_ID; in adf_rl_get_sla()
961 sla_in->rp_mask |= BIT(sla->ring_pairs_ids[i]); in adf_rl_get_sla()