- if (unlikely(rr_qp_ctx->slaves[last_slave_idx].nb_inflight_cops == 0)) {
- do {
- last_slave_idx += 1;
-
- if (unlikely(last_slave_idx >= rr_qp_ctx->nb_slaves))
- last_slave_idx = 0;
- /* looped back, means no inflight cops in the queue */
- if (last_slave_idx == rr_qp_ctx->last_deq_slave_idx)
- return 0;
- } while (rr_qp_ctx->slaves[last_slave_idx].nb_inflight_cops
- == 0);
- }
-
- slave = &rr_qp_ctx->slaves[last_slave_idx];
-
- nb_deq_ops = rte_cryptodev_dequeue_burst(slave->dev_id,
- slave->qp_id, op_ops, nb_ops);
-
- rr_qp_ctx->last_deq_slave_idx += 1;
- rr_qp_ctx->last_deq_slave_idx %= rr_qp_ctx->nb_slaves;
-
- slave->nb_inflight_cops -= nb_deq_ops;
-
- for (i = 0; i < nb_deq_ops && i < 4; i++)
- rte_prefetch0(op_ops[i]->sym->m_src);
-
- for (i = 0; (i < (nb_deq_ops - 8)) && (nb_deq_ops > 8); i += 4) {
- mbuf0 = op_ops[i]->sym->m_src;
- mbuf1 = op_ops[i + 1]->sym->m_src;
- mbuf2 = op_ops[i + 2]->sym->m_src;
- mbuf3 = op_ops[i + 3]->sym->m_src;
-
- mbuf0->userdata = op_ops[i];
- mbuf1->userdata = op_ops[i + 1];
- mbuf2->userdata = op_ops[i + 2];
- mbuf3->userdata = op_ops[i + 3];
-
- rte_reorder_insert(reorder_buff, mbuf0);
- rte_reorder_insert(reorder_buff, mbuf1);
- rte_reorder_insert(reorder_buff, mbuf2);
- rte_reorder_insert(reorder_buff, mbuf3);
-
- rte_prefetch0(op_ops[i + 4]->sym->m_src);
- rte_prefetch0(op_ops[i + 5]->sym->m_src);
- rte_prefetch0(op_ops[i + 6]->sym->m_src);
- rte_prefetch0(op_ops[i + 7]->sym->m_src);
- }
-
- for (; i < nb_deq_ops; i++) {
- mbuf0 = op_ops[i]->sym->m_src;
- mbuf0->userdata = op_ops[i];
- rte_reorder_insert(reorder_buff, mbuf0);
- }
-
- nb_drained_mbufs = rte_reorder_drain(reorder_buff, reorder_mbufs,
- nb_ops);
- for (i = 0; i < nb_drained_mbufs && i < 4; i++)
- rte_prefetch0(reorder_mbufs[i]);
-
- for (i = 0; (i < (nb_drained_mbufs - 8)) && (nb_drained_mbufs > 8);
- i += 4) {
- ops[i] = *(struct rte_crypto_op **)reorder_mbufs[i]->userdata;
- ops[i + 1] = *(struct rte_crypto_op **)
- reorder_mbufs[i + 1]->userdata;
- ops[i + 2] = *(struct rte_crypto_op **)
- reorder_mbufs[i + 2]->userdata;
- ops[i + 3] = *(struct rte_crypto_op **)
- reorder_mbufs[i + 3]->userdata;
-
- reorder_mbufs[i]->userdata = NULL;
- reorder_mbufs[i + 1]->userdata = NULL;
- reorder_mbufs[i + 2]->userdata = NULL;
- reorder_mbufs[i + 3]->userdata = NULL;
-
- rte_prefetch0(reorder_mbufs[i + 4]);
- rte_prefetch0(reorder_mbufs[i + 5]);
- rte_prefetch0(reorder_mbufs[i + 6]);
- rte_prefetch0(reorder_mbufs[i + 7]);
- }
-
- for (; i < nb_drained_mbufs; i++) {
- ops[i] = *(struct rte_crypto_op **)
- reorder_mbufs[i]->userdata;
- reorder_mbufs[i]->userdata = NULL;
- }