+ if (tmp_ops >= cryptodev_cnt)
+ cur_ops = nb_ops / cryptodev_cnt + (nb_ops)%cryptodev_cnt;
+ else
+ cur_ops = tmp_ops;
+ while (tmp_ops) {
+ b_idx = nb_ops - tmp_ops;
+ slots_req = 0;
+ if (cur_ops <= tmp_ops) {
+ tmp_ops -= cur_ops;
+ } else {
+ cur_ops = tmp_ops;
+ tmp_ops = 0;
+ }
+ for (i = 0; i < cur_ops; i++) {
+ sess = get_ccp_session(qp, ops[i + b_idx]);
+ if (unlikely(sess == NULL) && (i == 0)) {
+ qp->qp_stats.enqueue_err_count++;
+ return 0;
+ } else if (sess == NULL) {
+ cur_ops = i;
+ break;
+ }
+ slots_req += ccp_compute_slot_count(sess);
+ }