{
Cpa16U buff_num = 0;
Cpa16U num_inter_buff_lists = 0;
- Cpa16U i = 0;
- for (i = 0; i < num_inst; i++) {
+ for (Cpa16U i = 0; i < num_inst; i++) {
cpaDcStopInstance(dc_inst_handles[i]);
QAT_PHYS_CONTIG_FREE(session_handles[i]);
/* free intermediate buffers */
Cpa16U buff_num = 0;
Cpa32U buff_meta_size = 0;
CpaDcSessionSetupData sd = {0};
- Cpa16U i;
status = cpaDcGetNumInstances(&num_inst);
if (status != CPA_STATUS_SUCCESS)
if (status != CPA_STATUS_SUCCESS)
return (-1);
- for (i = 0; i < num_inst; i++) {
+ for (Cpa16U i = 0; i < num_inst; i++) {
cpaDcSetAddressTranslation(dc_inst_handles[i],
(void*)virt_to_phys);
num_add_buf * sizeof (struct page *)) != CPA_STATUS_SUCCESS)
goto fail;
- i = atomic_inc_32_nv(&inst_num) % num_inst;
+ i = (Cpa32U)atomic_inc_32_nv(&inst_num) % num_inst;
dc_inst_handle = dc_inst_handles[i];
session_handle = session_handles[i];
#define MAX_PAGE_NUM 1024
-static Cpa16U inst_num = 0;
+static Cpa32U inst_num = 0;
static Cpa16U num_inst = 0;
static CpaInstanceHandle cy_inst_handles[QAT_CRYPT_MAX_INSTANCES];
static boolean_t qat_crypt_init_done = B_FALSE;
void
qat_crypt_clean(void)
{
- for (Cpa32U i = 0; i < num_inst; i++)
+ for (Cpa16U i = 0; i < num_inst; i++)
cpaCyStopInstance(cy_inst_handles[i]);
num_inst = 0;
int
qat_crypt_init(void)
{
- Cpa32U i;
CpaStatus status = CPA_STATUS_FAIL;
status = cpaCyGetNumInstances(&num_inst);
if (status != CPA_STATUS_SUCCESS)
return (-1);
- for (i = 0; i < num_inst; i++) {
+ for (Cpa16U i = 0; i < num_inst; i++) {
status = cpaCySetAddressTranslation(cy_inst_handles[i],
(void *)virt_to_phys);
if (status != CPA_STATUS_SUCCESS)
QAT_STAT_INCR(decrypt_total_in_bytes, enc_len);
}
- i = atomic_inc_32_nv(&inst_num) % num_inst;
+ i = (Cpa32U)atomic_inc_32_nv(&inst_num) % num_inst;
cy_inst_handle = cy_inst_handles[i];
status = qat_init_crypt_session_ctx(dir, cy_inst_handle,
QAT_STAT_BUMP(cksum_requests);
QAT_STAT_INCR(cksum_total_in_bytes, size);
- i = atomic_inc_32_nv(&inst_num) % num_inst;
+ i = (Cpa32U)atomic_inc_32_nv(&inst_num) % num_inst;
cy_inst_handle = cy_inst_handles[i];
status = qat_init_checksum_session_ctx(cy_inst_handle,