Commit 84058ffb authored by Siming Wan's avatar Siming Wan Committed by Herbert Xu

crypto: qat - rename get_sla_arr_of_type()

The function get_sla_arr_of_type() returns a pointer to an SLA type
specific array.
Rename it and expose it as it will be used externally to this module.

This does not introduce any functional change.
Signed-off-by: default avatarSiming Wan <siming.wan@intel.com>
Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: default avatarDamian Muszynski <damian.muszynski@intel.com>
Signed-off-by: default avatarXin Zeng <xin.zeng@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 680302d1
...@@ -183,14 +183,14 @@ static enum adf_cfg_service_type srv_to_cfg_svc_type(enum adf_base_services rl_s ...@@ -183,14 +183,14 @@ static enum adf_cfg_service_type srv_to_cfg_svc_type(enum adf_base_services rl_s
} }
/** /**
* get_sla_arr_of_type() - Returns a pointer to SLA type specific array * adf_rl_get_sla_arr_of_type() - Returns a pointer to SLA type specific array
* @rl_data: pointer to ratelimiting data * @rl_data: pointer to ratelimiting data
* @type: SLA type * @type: SLA type
* @sla_arr: pointer to variable where requested pointer will be stored * @sla_arr: pointer to variable where requested pointer will be stored
* *
* Return: Max number of elements allowed for the returned array * Return: Max number of elements allowed for the returned array
*/ */
static u32 get_sla_arr_of_type(struct adf_rl *rl_data, enum rl_node_type type, u32 adf_rl_get_sla_arr_of_type(struct adf_rl *rl_data, enum rl_node_type type,
struct rl_sla ***sla_arr) struct rl_sla ***sla_arr)
{ {
switch (type) { switch (type) {
...@@ -778,7 +778,7 @@ static void clear_sla(struct adf_rl *rl_data, struct rl_sla *sla) ...@@ -778,7 +778,7 @@ static void clear_sla(struct adf_rl *rl_data, struct rl_sla *sla)
rp_in_use[sla->ring_pairs_ids[i]] = false; rp_in_use[sla->ring_pairs_ids[i]] = false;
update_budget(sla, old_cir, true); update_budget(sla, old_cir, true);
get_sla_arr_of_type(rl_data, sla->type, &sla_type_arr); adf_rl_get_sla_arr_of_type(rl_data, sla->type, &sla_type_arr);
assign_node_to_parent(rl_data->accel_dev, sla, true); assign_node_to_parent(rl_data->accel_dev, sla, true);
adf_rl_send_admin_delete_msg(rl_data->accel_dev, node_id, sla->type); adf_rl_send_admin_delete_msg(rl_data->accel_dev, node_id, sla->type);
mark_rps_usage(sla, rl_data->rp_in_use, false); mark_rps_usage(sla, rl_data->rp_in_use, false);
...@@ -875,7 +875,7 @@ static int add_update_sla(struct adf_accel_dev *accel_dev, ...@@ -875,7 +875,7 @@ static int add_update_sla(struct adf_accel_dev *accel_dev,
if (!is_update) { if (!is_update) {
mark_rps_usage(sla, rl_data->rp_in_use, true); mark_rps_usage(sla, rl_data->rp_in_use, true);
get_sla_arr_of_type(rl_data, sla->type, &sla_type_arr); adf_rl_get_sla_arr_of_type(rl_data, sla->type, &sla_type_arr);
sla_type_arr[sla->node_id] = sla; sla_type_arr[sla->node_id] = sla;
rl_data->sla[sla->sla_id] = sla; rl_data->sla[sla->sla_id] = sla;
} }
...@@ -1065,7 +1065,7 @@ void adf_rl_remove_sla_all(struct adf_accel_dev *accel_dev, bool incl_default) ...@@ -1065,7 +1065,7 @@ void adf_rl_remove_sla_all(struct adf_accel_dev *accel_dev, bool incl_default)
/* Unregister and remove all SLAs */ /* Unregister and remove all SLAs */
for (j = RL_LEAF; j >= end_type; j--) { for (j = RL_LEAF; j >= end_type; j--) {
max_id = get_sla_arr_of_type(rl_data, j, &sla_type_arr); max_id = adf_rl_get_sla_arr_of_type(rl_data, j, &sla_type_arr);
for (i = 0; i < max_id; i++) { for (i = 0; i < max_id; i++) {
if (!sla_type_arr[i]) if (!sla_type_arr[i])
......
...@@ -151,6 +151,8 @@ struct rl_sla { ...@@ -151,6 +151,8 @@ struct rl_sla {
u16 ring_pairs_cnt; u16 ring_pairs_cnt;
}; };
u32 adf_rl_get_sla_arr_of_type(struct adf_rl *rl_data, enum rl_node_type type,
struct rl_sla ***sla_arr);
int adf_rl_add_sla(struct adf_accel_dev *accel_dev, int adf_rl_add_sla(struct adf_accel_dev *accel_dev,
struct adf_rl_sla_input_data *sla_in); struct adf_rl_sla_input_data *sla_in);
int adf_rl_update_sla(struct adf_accel_dev *accel_dev, int adf_rl_update_sla(struct adf_accel_dev *accel_dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment