// SPDX-License-Identifier: GPL-2.0-or-later /* Copyright Red Hat * Author: Laurent Vivier * * common_vu.c - vhost-user common UDP and TCP functions */ #include #include #include #include "util.h" #include "passt.h" #include "vhost_user.h" #include "vu_common.h" /** * vu_send_frame() - Send one frame to the vhost-user interface * @vdev: vhost-user device * @vq: vhost-user virtqueue * @elem: virtqueue element array to send back to the virqueue * @iov_vu: iovec array containing the data to send * @iov_used: Length of the array */ void vu_send_frame(const struct vu_dev *vdev, struct vu_virtq *vq, struct vu_virtq_element *elem, const struct iovec *iov_vu, int iov_used) { int i; for (i = 0; i < iov_used; i++) vu_queue_fill(vq, &elem[i], iov_vu[i].iov_len, i); vu_queue_flush(vq, iov_used); vu_queue_notify(vdev, vq); }