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

Function reach_inhdr

dpdk/lib/vhost/vhost_crypto.c:490–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488}
489
490static __rte_always_inline struct virtio_crypto_inhdr *
491reach_inhdr(struct vhost_crypto_data_req *vc_req,
492 struct vhost_crypto_desc *head,
493 uint32_t max_n_descs)
494 __rte_shared_locks_required(&vc_req->vq->iotlb_lock)
495{
496 struct virtio_crypto_inhdr *inhdr;
497 struct vhost_crypto_desc *last = head + (max_n_descs - 1);
498 uint64_t dlen = last->len;
499
500 if (unlikely(dlen != sizeof(*inhdr)))
501 return NULL;
502
503 inhdr = IOVA_TO_VVA(struct virtio_crypto_inhdr *, vc_req, last->addr,
504 &dlen, VHOST_ACCESS_WO);
505 if (unlikely(!inhdr || dlen != last->len))
506 return NULL;
507
508 return inhdr;
509}
510
511static __rte_always_inline int
512move_desc(struct vhost_crypto_desc *head,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected