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

Function ccp_pmd_enqueue_burst

dpdk/drivers/crypto/ccp/rte_ccp_pmd.c:80–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80static uint16_t
81ccp_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
82 uint16_t nb_ops)
83{
84 struct ccp_session *sess = NULL;
85 struct ccp_qp *qp = queue_pair;
86 struct ccp_queue *cmd_q;
87 struct rte_cryptodev *dev = qp->dev;
88 uint16_t i, enq_cnt = 0, slots_req = 0;
89 uint16_t tmp_ops = nb_ops, b_idx, cur_ops = 0;
90
91 if (nb_ops == 0)
92 return 0;
93
94 if (unlikely(rte_ring_full(qp->processed_pkts) != 0))
95 return 0;
96 if (tmp_ops >= cryptodev_cnt)
97 cur_ops = nb_ops / cryptodev_cnt + (nb_ops)%cryptodev_cnt;
98 else
99 cur_ops = tmp_ops;
100 while (tmp_ops) {
101 b_idx = nb_ops - tmp_ops;
102 slots_req = 0;
103 if (cur_ops <= tmp_ops) {
104 tmp_ops -= cur_ops;
105 } else {
106 cur_ops = tmp_ops;
107 tmp_ops = 0;
108 }
109 for (i = 0; i < cur_ops; i++) {
110 sess = get_ccp_session(qp, ops[i + b_idx]);
111 if (unlikely(sess == NULL) && (i == 0)) {
112 qp->qp_stats.enqueue_err_count++;
113 return 0;
114 } else if (sess == NULL) {
115 cur_ops = i;
116 break;
117 }
118 slots_req += ccp_compute_slot_count(sess);
119 }
120
121 cmd_q = ccp_allot_queue(dev, slots_req);
122 if (unlikely(cmd_q == NULL))
123 return 0;
124 enq_cnt += process_ops_to_enqueue(qp, ops, cmd_q, cur_ops,
125 nb_ops, slots_req, b_idx);
126 i++;
127 }
128
129 qp->qp_stats.enqueued_count += enq_cnt;
130 return enq_cnt;
131}
132
133static uint16_t
134ccp_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,

Callers

nothing calls this directly

Calls 5

rte_ring_fullFunction · 0.85
get_ccp_sessionFunction · 0.85
ccp_compute_slot_countFunction · 0.85
ccp_allot_queueFunction · 0.85
process_ops_to_enqueueFunction · 0.85

Tested by

no test coverage detected