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

Function copy_data

dpdk/lib/vhost/vhost_crypto.c:585–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583
584
585static __rte_always_inline int
586copy_data(void *data, struct vhost_crypto_data_req *vc_req,
587 struct vhost_crypto_desc *head, struct vhost_crypto_desc **cur_desc,
588 uint32_t size, uint32_t max_n_descs)
589 __rte_shared_locks_required(&vc_req->vq->iotlb_lock)
590{
591 struct vhost_crypto_desc *desc = *cur_desc;
592 uint32_t left = size;
593
594 do {
595 uint32_t copied;
596
597 copied = copy_data_from_desc(data, vc_req, desc, left);
598 if (copied == 0)
599 return -1;
600 left -= copied;
601 data = RTE_PTR_ADD(data, copied);
602 } while (left != 0 && ++desc < head + max_n_descs);
603
604 if (unlikely(left != 0))
605 return -1;
606
607 if (unlikely(desc == head + max_n_descs))
608 *cur_desc = NULL;
609 else
610 *cur_desc = desc + 1;
611
612 return 0;
613}
614
615static void
616write_back_data(struct vhost_crypto_data_req *vc_req)

Callers 3

prepare_sym_cipher_opFunction · 0.85
prepare_sym_chain_opFunction · 0.85

Calls 1

copy_data_from_descFunction · 0.85

Tested by

no test coverage detected