Lines Matching refs:copy

349 sum_iovec_len(struct mic_copy_desc *copy)  in sum_iovec_len()  argument
354 for (i = 0; i < copy->iovcnt; i++) in sum_iovec_len()
355 sum += copy->iov[i].iov_len; in sum_iovec_len()
360 struct mic_copy_desc *copy) in verify_out_len() argument
362 if (copy->out_len != sum_iovec_len(copy)) { in verify_out_len()
365 copy->out_len, sum_iovec_len(copy)); in verify_out_len()
366 assert(copy->out_len == sum_iovec_len(copy)); in verify_out_len()
372 disp_iovec(struct mic_info *mic, struct mic_copy_desc *copy, in disp_iovec() argument
377 for (i = 0; i < copy->iovcnt; i++) in disp_iovec()
380 copy->iov[i].iov_base, copy->iov[i].iov_len); in disp_iovec()
389 struct mic_copy_desc *copy, ssize_t len) in txrx_prepare() argument
391 copy->vr_idx = tx ? 0 : 1; in txrx_prepare()
392 copy->update_used = true; in txrx_prepare()
394 copy->iov[1].iov_len = len - sizeof(struct virtio_net_hdr); in txrx_prepare()
396 copy->iov[0].iov_len = len; in txrx_prepare()
402 struct mic_vring *vr, struct mic_copy_desc *copy) in mic_virtio_copy() argument
406 ret = ioctl(fd, MIC_VIRTIO_COPY_DESC, copy); in mic_virtio_copy()
552 struct mic_copy_desc copy; in virtio_net() local
578 copy.iovcnt = 2; in virtio_net()
609 copy.iov = iov0; in virtio_net()
611 copy.iov, copy.iovcnt); in virtio_net()
623 copy.out_len, hdr->gso_type); in virtio_net()
626 disp_iovec(mic, copy, __func__, __LINE__); in virtio_net()
632 txrx_prepare(VIRTIO_ID_NET, 1, &tx_vr, &copy, in virtio_net()
637 &copy); in virtio_net()
644 verify_out_len(mic, &copy); in virtio_net()
646 disp_iovec(mic, copy, __func__, __LINE__); in virtio_net()
649 sum_iovec_len(&copy)); in virtio_net()
654 disp_iovec(mic, &copy, __func__, __LINE__); in virtio_net()
658 copy.iovcnt, sum_iovec_len(&copy)); in virtio_net()
669 copy.iov = iov1; in virtio_net()
670 txrx_prepare(VIRTIO_ID_NET, 0, &rx_vr, &copy, in virtio_net()
676 &copy); in virtio_net()
687 copy.out_len, in virtio_net()
691 iov1[1].iov_len = copy.out_len - in virtio_net()
693 verify_out_len(mic, &copy); in virtio_net()
695 disp_iovec(mic, copy, __func__, in virtio_net()
700 sum_iovec_len(copy)); in virtio_net()
703 copy.iov, copy.iovcnt); in virtio_net()
704 if (len != sum_iovec_len(&copy)) { in virtio_net()
709 sum_iovec_len(&copy)); in virtio_net()
712 disp_iovec(mic, &copy, __func__, in virtio_net()
758 struct mic_copy_desc copy; in virtio_console() local
800 copy.iovcnt = 1; in virtio_console()
824 copy.iov = iov0; in virtio_console()
825 len = readv(pty_fd, copy.iov, copy.iovcnt); in virtio_console()
828 disp_iovec(mic, copy, __func__, __LINE__); in virtio_console()
835 &copy, len); in virtio_console()
839 &tx_vr, &copy); in virtio_console()
846 verify_out_len(mic, &copy); in virtio_console()
848 disp_iovec(mic, copy, __func__, __LINE__); in virtio_console()
851 sum_iovec_len(copy)); in virtio_console()
856 disp_iovec(mic, &copy, __func__, __LINE__); in virtio_console()
861 copy.iovcnt, sum_iovec_len(&copy)); in virtio_console()
868 copy.iov = iov1; in virtio_console()
870 &copy, PAGE_SIZE); in virtio_console()
874 &rx_vr, &copy); in virtio_console()
877 iov1->iov_len = copy.out_len; in virtio_console()
878 verify_out_len(mic, &copy); in virtio_console()
880 disp_iovec(mic, copy, __func__, in virtio_console()
885 sum_iovec_len(copy)); in virtio_console()
888 copy.iov, copy.iovcnt); in virtio_console()
889 if (len != sum_iovec_len(&copy)) { in virtio_console()
894 sum_iovec_len(&copy)); in virtio_console()
897 disp_iovec(mic, copy, __func__, in virtio_console()
1115 struct mic_copy_desc copy; in read_header() local
1119 copy.iov = &iovec; in read_header()
1120 copy.iovcnt = 1; in read_header()
1121 copy.vr_idx = 0; /* only one vring on virtio_block */ in read_header()
1122 copy.update_used = false; /* do not update used index */ in read_header()
1123 return ioctl(fd, MIC_VIRTIO_COPY_DESC, &copy); in read_header()
1129 struct mic_copy_desc copy; in transfer_blocks() local
1131 copy.iov = iovec; in transfer_blocks()
1132 copy.iovcnt = iovcnt; in transfer_blocks()
1133 copy.vr_idx = 0; /* only one vring on virtio_block */ in transfer_blocks()
1134 copy.update_used = false; /* do not update used index */ in transfer_blocks()
1135 return ioctl(fd, MIC_VIRTIO_COPY_DESC, &copy); in transfer_blocks()
1153 struct mic_copy_desc copy; in write_status() local
1157 copy.iov = &iovec; in write_status()
1158 copy.iovcnt = 1; in write_status()
1159 copy.vr_idx = 0; /* only one vring on virtio_block */ in write_status()
1160 copy.update_used = true; /* Update used index */ in write_status()
1161 return ioctl(fd, MIC_VIRTIO_COPY_DESC, &copy); in write_status()