MCPcopy Create free account
hub / github.com/F-Stack/f-stack / schedule_dequeue

Function schedule_dequeue

dpdk/drivers/crypto/scheduler/scheduler_failover.c:86–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86static uint16_t
87schedule_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
115retrieve_sessions:
116 scheduler_retrieve_sessions(ops, nb_deq_ops + nb_deq_ops2);
117
118 return nb_deq_ops + nb_deq_ops2;
119}
120
121static uint16_t
122schedule_dequeue_ordering(void *qp, struct rte_crypto_op **ops,

Callers 1

Calls 2

Tested by

no test coverage detected