vhost: add two new messages to support a shared buffer
A message that is not in the archive (sent off-list or not yet received): 20190917145234.16951-5
PATCH 4/10 vhost: add two new messages to support a shared buffer
This patch introduces two new messages VHOST_USER_GET_INFLIGHT_FD and VHOST_USER_SET_INFLIGHT_FD to support transferring a shared buffer between qemu and backend.
Signed-off-by Lin Li <[email protected]>
Signed-off-by Xun Ni <[email protected]>
Signed-off-by Yu Zhang <[email protected]>
Signed-off-by Jin Yu <[email protected]>
--- lib/librte_vhost/vhost.h | 7 + lib/librte_vhost/vhost_user.c | 260 +++++++++++++++++++++++++++++++++- lib/librte_vhost/vhost_user.h | 4 +- 3 files changed, 269 insertions(+), 2 deletions(-)
lib/librte_vhost/vhost.h +7 -0
@@ -286,6 +286,12 @@ struct guest_page {uint64_t size; }; +struct inflight_mem_info { +int fd; +void *addr; +uint64_t size; +}; +/** * Device structure contains all configuration information relating * to the device.
@@ -303,6 +309,7 @@ struct virtio_net {uint32_t nr_vring;int dequeue_zero_copy;struct vhost_virtqueue *virtqueue[VHOST_MAX_QUEUE_PAIRS *2 ]; +struct inflight_mem_info *inflight_info;#define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ)char ifname[IF_NAME_SZ ];uint64_t log_size;
lib/librte_vhost/vhost_user.c +259 -1
298 lines not on this page · raw message
lib/librte_vhost/vhost_user.h +3 -1
@@ -54,7 +54,9 @@ typedef enum VhostUserRequest {VHOST_USER_POSTCOPY_ADVISE =28 ,VHOST_USER_POSTCOPY_LISTEN =29 ,VHOST_USER_POSTCOPY_END =30 , - VHOST_USER_MAX = 31 +VHOST_USER_GET_INFLIGHT_FD =31 , +VHOST_USER_SET_INFLIGHT_FD =32 , + VHOST_USER_MAX = 33 } VhostUserRequest; typedef enum VhostUserSlaveRequest {
Signature · 1 line
2.17.2