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

Function move_desc

dpdk/lib/vhost/vhost_crypto.c:511–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511static __rte_always_inline int
512move_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
537static __rte_always_inline void *
538get_data_ptr(struct vhost_crypto_data_req *vc_req,

Callers 2

prepare_sym_cipher_opFunction · 0.85
prepare_sym_chain_opFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected