aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSi-Wei Liu <si-wei.liu@oracle.com>2024-02-14 03:28:01 -0800
committerMichael S. Tsirkin <mst@redhat.com>2024-03-12 17:56:55 -0400
commitdb4cba36a7356f5e94e97735af8c578c55838386 (patch)
treef22ef599ddd55561d16a438be0622c1f28019d64 /net
parentbb000fff0a1d9774444c431e0831550e99e159ce (diff)
vdpa: indicate transitional state for SVQ switching
svq_switching indicates the transitional state whether or not SVQ mode switching is in progress, and towards which direction. Add the neccessary state around where the switching would take place. Message-Id: <1707910082-10243-12-git-send-email-si-wei.liu@oracle.com> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/vhost-vdpa.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 2254859dec..5f06c39f63 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -324,6 +324,8 @@ static void vhost_vdpa_net_log_global_enable(VhostVDPAState *s, bool enable)
data_queue_pairs = n->multiqueue ? n->max_queue_pairs : 1;
cvq = virtio_vdev_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ) ?
n->max_ncs - n->max_queue_pairs : 0;
+ v->shared->svq_switching = enable ?
+ SVQ_TSTATE_ENABLING : SVQ_TSTATE_DISABLING;
/*
* TODO: vhost_net_stop does suspend, get_base and reset. We can be smarter
* in the future and resume the device if read-only operations between
@@ -336,6 +338,7 @@ static void vhost_vdpa_net_log_global_enable(VhostVDPAState *s, bool enable)
if (unlikely(r < 0)) {
error_report("unable to start vhost net: %s(%d)", g_strerror(-r), -r);
}
+ v->shared->svq_switching = SVQ_TSTATE_DONE;
}
static int vdpa_net_migration_state_notifier(NotifierWithReturn *notifier,