@@ -209,6 +209,13 @@ static void vp_slave_set_vring_num(VhostUserMsg *msg)
pvq_node->vring_num = msg->payload.u64;
}
+static void vp_slave_set_vring_base(VhostUserMsg *msg)
+{
+ PeerVqNode *pvq_node = QLIST_FIRST(&vp_slave->pvq_list);
+
+ pvq_node->last_avail_idx = msg->payload.u64;
+}
+
static int vp_slave_can_read(void *opaque)
{
return VHOST_USER_HDR_SIZE;
@@ -275,6 +282,9 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
vp_slave_alloc_pvq_node();
vp_slave_set_vring_num(&msg);
break;
+ case VHOST_USER_SET_VRING_BASE:
+ vp_slave_set_vring_base(&msg);
+ break;
default:
error_report("vhost-pci-slave does not support msg request = %d",
msg.request);
@@ -6,6 +6,7 @@
#include "standard-headers/linux/vhost_pci_net.h"
typedef struct PeerVqNode {
+ uint16_t last_avail_idx;
uint32_t vring_num;
QLIST_ENTRY(PeerVqNode) node;
} PeerVqNode;
Update last_avail_idx to the head node in the list. Signed-off-by: Wei Wang <wei.w.wang@intel.com> --- hw/virtio/vhost-pci-slave.c | 10 ++++++++++ include/hw/virtio/vhost-pci-slave.h | 1 + 2 files changed, 11 insertions(+)