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

Function vhost_crypto_finalize_one_request

dpdk/lib/vhost/vhost_crypto.c:1292–1329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1290}
1291
1292static __rte_always_inline struct vhost_virtqueue *
1293vhost_crypto_finalize_one_request(struct rte_crypto_op *op,
1294 struct vhost_virtqueue *old_vq)
1295{
1296 struct rte_mbuf *m_src = op->sym->m_src;
1297 struct rte_mbuf *m_dst = op->sym->m_dst;
1298 struct vhost_crypto_data_req *vc_req = rte_mbuf_to_priv(m_src);
1299 struct vhost_virtqueue *vq;
1300 uint16_t used_idx, desc_idx;
1301
1302 if (unlikely(!vc_req)) {
1303 VC_LOG_ERR("Failed to retrieve vc_req");
1304 return NULL;
1305 }
1306 vq = vc_req->vq;
1307 used_idx = vc_req->desc_idx;
1308
1309 if (old_vq && (vq != old_vq))
1310 return vq;
1311
1312 if (unlikely(op->status != RTE_CRYPTO_OP_STATUS_SUCCESS))
1313 vc_req->inhdr->status = VIRTIO_CRYPTO_ERR;
1314 else {
1315 if (vc_req->zero_copy == 0)
1316 write_back_data(vc_req);
1317 }
1318
1319 desc_idx = vq->avail->ring[used_idx];
1320 vq->used->ring[desc_idx].id = vq->avail->ring[desc_idx];
1321 vq->used->ring[desc_idx].len = vc_req->len;
1322
1323 rte_mempool_put(m_src->pool, (void *)m_src);
1324
1325 if (m_dst)
1326 rte_mempool_put(m_dst->pool, (void *)m_dst);
1327
1328 return vc_req->vq;
1329}
1330
1331static __rte_always_inline uint16_t
1332vhost_crypto_complete_one_vm_requests(struct rte_crypto_op **ops,

Callers 1

Calls 3

rte_mbuf_to_privFunction · 0.85
write_back_dataFunction · 0.85
rte_mempool_putFunction · 0.85

Tested by

no test coverage detected