[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/12] vdpa: indicate transitional state for SVQ switching
From: |
Si-Wei Liu |
Subject: |
[PATCH 11/12] vdpa: indicate transitional state for SVQ switching |
Date: |
Wed, 14 Feb 2024 03:28:01 -0800 |
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.
Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
---
net/vhost-vdpa.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 9f25221..96d95b9 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -317,6 +317,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
@@ -329,6 +331,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 void vdpa_net_migration_state_notifier(Notifier *notifier, void *data)
--
1.8.3.1
- Re: [PATCH 04/12] vdpa: factor out vhost_vdpa_net_get_nc_vdpa, (continued)
[PATCH 05/12] vdpa: add vhost_vdpa_set_address_space_id trace, Si-Wei Liu, 2024/02/14
[PATCH 02/12] vdpa: no repeat setting shadow_data, Si-Wei Liu, 2024/02/14
[PATCH 01/12] vdpa: add back vhost_vdpa_net_first_nc_vdpa, Si-Wei Liu, 2024/02/14
[PATCH 07/12] vdpa: add vhost_vdpa_set_dev_vring_base trace for svq mode, Si-Wei Liu, 2024/02/14
[PATCH 08/12] vdpa: add trace events for vhost_vdpa_net_load_cmd, Si-Wei Liu, 2024/02/14
[PATCH 09/12] vdpa: add trace event for vhost_vdpa_net_load_mq, Si-Wei Liu, 2024/02/14
[PATCH 10/12] vdpa: define SVQ transitioning state for mode switching, Si-Wei Liu, 2024/02/14
[PATCH 11/12] vdpa: indicate transitional state for SVQ switching,
Si-Wei Liu <=
[PATCH 12/12] vdpa: fix network breakage after cancelling migration, Si-Wei Liu, 2024/02/14