| 36 | }; |
| 37 | |
| 38 | static uint16_t |
| 39 | schedule_enqueue(void *qp, struct rte_crypto_op **ops, uint16_t nb_ops) |
| 40 | { |
| 41 | struct mc_scheduler_qp_ctx *mc_qp_ctx = |
| 42 | ((struct scheduler_qp_ctx *)qp)->private_qp_ctx; |
| 43 | struct mc_scheduler_ctx *mc_ctx = mc_qp_ctx->mc_private_ctx; |
| 44 | uint32_t worker_idx = mc_qp_ctx->last_enq_worker_idx; |
| 45 | uint16_t i, processed_ops = 0; |
| 46 | |
| 47 | if (unlikely(nb_ops == 0)) |
| 48 | return 0; |
| 49 | |
| 50 | for (i = 0; i < mc_ctx->num_workers && nb_ops != 0; i++) { |
| 51 | struct rte_ring *enq_ring = mc_ctx->sched_enq_ring[worker_idx]; |
| 52 | uint16_t nb_queue_ops = rte_ring_enqueue_burst(enq_ring, |
| 53 | (void *)(&ops[processed_ops]), nb_ops, NULL); |
| 54 | |
| 55 | nb_ops -= nb_queue_ops; |
| 56 | processed_ops += nb_queue_ops; |
| 57 | |
| 58 | if (++worker_idx == mc_ctx->num_workers) |
| 59 | worker_idx = 0; |
| 60 | } |
| 61 | mc_qp_ctx->last_enq_worker_idx = worker_idx; |
| 62 | |
| 63 | return processed_ops; |
| 64 | } |
| 65 | |
| 66 | static uint16_t |
| 67 | schedule_enqueue_ordering(void *qp, struct rte_crypto_op **ops, |
no test coverage detected