Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/qat/qat_common/adf_cfg_device.c
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | |||||
adf_cfg_get_ring_pairs(struct adf_cfg_device *device, | adf_cfg_get_ring_pairs(struct adf_cfg_device *device, | ||||
struct adf_cfg_instance *inst, | struct adf_cfg_instance *inst, | ||||
const char *process_name, | const char *process_name, | ||||
struct adf_accel_dev *accel_dev) | struct adf_accel_dev *accel_dev) | ||||
{ | { | ||||
int i = 0; | int i = 0; | ||||
int ret = EFAULT; | int ret = EFAULT; | ||||
struct adf_cfg_instance *free_inst = NULL; | struct adf_cfg_instance *free_inst = NULL; | ||||
struct adf_cfg_bundle *first_free_bundle = NULL; | |||||
enum adf_cfg_bundle_type free_bundle_type; | enum adf_cfg_bundle_type free_bundle_type; | ||||
int first_user_bundle = 0; | int first_user_bundle = 0; | ||||
/* Section of user process with poll mode */ | /* Section of user process with poll mode */ | ||||
if (strcmp(ADF_KERNEL_SEC, process_name) && | if (strcmp(ADF_KERNEL_SEC, process_name) && | ||||
strcmp(ADF_KERNEL_SAL_SEC, process_name) && | strcmp(ADF_KERNEL_SAL_SEC, process_name) && | ||||
inst->polling_mode == ADF_CFG_RESP_POLL) { | inst->polling_mode == ADF_CFG_RESP_POLL) { | ||||
first_user_bundle = device->max_kernel_bundle_nr + 1; | first_user_bundle = device->max_kernel_bundle_nr + 1; | ||||
Show All 38 Lines | for (i = 0; i < device->bundle_num; i++) { | ||||
ret = adf_cfg_get_ring_pairs_from_bundle( | ret = adf_cfg_get_ring_pairs_from_bundle( | ||||
device->bundles[i], | device->bundles[i], | ||||
inst, | inst, | ||||
process_name, | process_name, | ||||
free_inst); | free_inst); | ||||
return ret; | return ret; | ||||
} else if (!first_free_bundle && | |||||
adf_cfg_is_free(device->bundles[i])) { | |||||
first_free_bundle = device->bundles[i]; | |||||
} | } | ||||
} | } | ||||
for (i = 0; i < device->bundle_num; i++) { | |||||
if (first_free_bundle) { | if (adf_cfg_is_free(device->bundles[i])) { | ||||
free_inst = adf_cfg_get_free_instance(device, | free_inst = adf_cfg_get_free_instance( | ||||
first_free_bundle, | device, | ||||
device->bundles[i], | |||||
inst, | inst, | ||||
process_name); | process_name); | ||||
if (!free_inst) | if (!free_inst) | ||||
return ret; | continue; | ||||
ret = adf_cfg_get_ring_pairs_from_bundle( | ret = adf_cfg_get_ring_pairs_from_bundle( | ||||
first_free_bundle, inst, process_name, free_inst); | device->bundles[i], | ||||
inst, | |||||
if (free_bundle_type == KERNEL) { | process_name, | ||||
device->max_kernel_bundle_nr = | free_inst); | ||||
first_free_bundle->number; | |||||
} | |||||
return ret; | return ret; | ||||
} | |||||
} | } | ||||
} | } | ||||
pr_err("Don't have enough rings for instance %s in process %s\n", | pr_err("Don't have enough rings for instance %s in process %s\n", | ||||
inst->name, | inst->name, | ||||
process_name); | process_name); | ||||
return ret; | return ret; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 765 Lines • Show Last 20 Lines |