| 84 | } |
| 85 | |
| 86 | static uint16_t |
| 87 | schedule_dequeue(void *qp, struct rte_crypto_op **ops, uint16_t nb_ops) |
| 88 | { |
| 89 | struct fo_scheduler_qp_ctx *qp_ctx = |
| 90 | ((struct scheduler_qp_ctx *)qp)->private_qp_ctx; |
| 91 | struct scheduler_worker *workers[NB_FAILOVER_WORKERS] = { |
| 92 | &qp_ctx->primary_worker, &qp_ctx->secondary_worker}; |
| 93 | struct scheduler_worker *worker = workers[qp_ctx->deq_idx]; |
| 94 | uint16_t nb_deq_ops = 0, nb_deq_ops2 = 0; |
| 95 | |
| 96 | if (worker->nb_inflight_cops) { |
| 97 | nb_deq_ops = rte_cryptodev_dequeue_burst(worker->dev_id, |
| 98 | worker->qp_id, ops, nb_ops); |
| 99 | worker->nb_inflight_cops -= nb_deq_ops; |
| 100 | } |
| 101 | |
| 102 | qp_ctx->deq_idx = (~qp_ctx->deq_idx) & WORKER_SWITCH_MASK; |
| 103 | |
| 104 | if (nb_deq_ops == nb_ops) |
| 105 | goto retrieve_sessions; |
| 106 | |
| 107 | worker = workers[qp_ctx->deq_idx]; |
| 108 | |
| 109 | if (worker->nb_inflight_cops) { |
| 110 | nb_deq_ops2 = rte_cryptodev_dequeue_burst(worker->dev_id, |
| 111 | worker->qp_id, &ops[nb_deq_ops], nb_ops - nb_deq_ops); |
| 112 | worker->nb_inflight_cops -= nb_deq_ops2; |
| 113 | } |
| 114 | |
| 115 | retrieve_sessions: |
| 116 | scheduler_retrieve_sessions(ops, nb_deq_ops + nb_deq_ops2); |
| 117 | |
| 118 | return nb_deq_ops + nb_deq_ops2; |
| 119 | } |
| 120 | |
| 121 | static uint16_t |
| 122 | schedule_dequeue_ordering(void *qp, struct rte_crypto_op **ops, |
no test coverage detected