| 509 | } |
| 510 | |
| 511 | static __rte_always_inline int |
| 512 | move_desc(struct vhost_crypto_desc *head, |
| 513 | struct vhost_crypto_desc **cur_desc, |
| 514 | uint32_t size, uint32_t max_n_descs) |
| 515 | { |
| 516 | struct vhost_crypto_desc *desc = *cur_desc; |
| 517 | int left = size - desc->len; |
| 518 | |
| 519 | while (desc->flags & VRING_DESC_F_NEXT && left > 0 && |
| 520 | desc >= head && |
| 521 | desc - head < (int)max_n_descs) { |
| 522 | desc++; |
| 523 | left -= desc->len; |
| 524 | } |
| 525 | |
| 526 | if (unlikely(left > 0)) |
| 527 | return -1; |
| 528 | |
| 529 | if (unlikely(head - desc == (int)max_n_descs)) |
| 530 | *cur_desc = NULL; |
| 531 | else |
| 532 | *cur_desc = desc + 1; |
| 533 | |
| 534 | return 0; |
| 535 | } |
| 536 | |
| 537 | static __rte_always_inline void * |
| 538 | get_data_ptr(struct vhost_crypto_data_req *vc_req, |
no outgoing calls
no test coverage detected