[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 08/12] vdpa: Add vhost_vdpa_start_control_svq
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH 08/12] vdpa: Add vhost_vdpa_start_control_svq |
Date: |
Sat, 16 Jul 2022 13:34:03 +0200 |
As a first step we only enable CVQ first than others. Future patches add
state restore.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
net/vhost-vdpa.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 986e6414b4..211bd0468b 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -334,6 +334,18 @@ static bool vhost_vdpa_net_cvq_map_elem(VhostVDPAState *s,
return true;
}
+static int vhost_vdpa_start_control_svq(struct vhost_vdpa *v)
+{
+ struct vhost_vring_state state = {
+ .index = v->dev->vq_index,
+ .num = 1,
+ };
+ int r;
+
+ r = ioctl(v->device_fd, VHOST_VDPA_SET_VRING_ENABLE, &state);
+ return r < 0 ? -errno : r;
+}
+
/**
* Do not forward commands not supported by SVQ. Otherwise, the device could
* accept it and qemu would not know how to update the device model.
@@ -493,6 +505,7 @@ static NetClientState *net_vhost_vdpa_init(NetClientState
*peer,
vhost_vdpa_net_cvq_cmd_page_len());
memset(s->cvq_cmd_in_buffer, 0, vhost_vdpa_net_cvq_cmd_page_len());
+ s->vhost_vdpa.start_op = vhost_vdpa_start_control_svq;
s->vhost_vdpa.shadow_vq_ops = &vhost_vdpa_net_svq_ops;
s->vhost_vdpa.shadow_vq_ops_opaque = s;
error_setg(&s->vhost_vdpa.migration_blocker,
--
2.31.1
- Re: [RFC PATCH 03/12] vdpa: Small rename of error labels, (continued)
- [RFC PATCH 04/12] vdpa: delay set_vring_ready after DRIVER_OK, Eugenio Pérez, 2022/07/16
- [RFC PATCH 06/12] vhost: Use opaque data in SVQDescState, Eugenio Pérez, 2022/07/16
- [RFC PATCH 05/12] vhost: stop transfer elem ownership in vhost_handle_guest_kick, Eugenio Pérez, 2022/07/16
- [RFC PATCH 07/12] vhost: Add VhostVDPAStartOp operation, Eugenio Pérez, 2022/07/16
- [RFC PATCH 08/12] vdpa: Add vhost_vdpa_start_control_svq,
Eugenio Pérez <=
- [RFC PATCH 09/12] vdpa: Extract vhost_vdpa_net_svq_add from vhost_vdpa_net_handle_ctrl_avail, Eugenio Pérez, 2022/07/16
- [RFC PATCH 10/12] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg, Eugenio Pérez, 2022/07/16
- [RFC PATCH 11/12] vdpa: Add virtio-net mac address via CVQ at start, Eugenio Pérez, 2022/07/16
- [RFC PATCH 12/12] vdpa: Delete CVQ migration blocker, Eugenio Pérez, 2022/07/16