| 488 | } |
| 489 | |
| 490 | static __rte_always_inline struct virtio_crypto_inhdr * |
| 491 | reach_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 | |
| 511 | static __rte_always_inline int |
| 512 | move_desc(struct vhost_crypto_desc *head, |
no outgoing calls
no test coverage detected