@@ -1892,6 +1892,7 @@ void migrate_init(MigrationState *s)
s->migration_thread_running = false;
s->enabled_rdma_migration = false;
s->host_port = NULL;
+ s->rdma_channel = 0;
error_free(s->error);
s->error = NULL;
s->hostname = NULL;
@@ -272,6 +272,7 @@ struct MigrationState
/* Need by Multi-RDMA */
char *host_port;
+ int rdma_channel;
};
void migrate_set_state(int *state, int old_state, int new_state);
@@ -183,6 +183,20 @@ typedef struct {
} RDMAWorkRequestData;
/*
+ * Get the multifd RDMA channel used to send data.
+ */
+static int get_multifd_RDMA_channel(void)
+{
+ int thread_count = migrate_multifd_channels();
+ MigrationState *s = migrate_get_current();
+
+ s->rdma_channel++;
+ s->rdma_channel %= thread_count;
+
+ return s->rdma_channel;
+}
+
+/*
* Negotiate RDMA capabilities during connection-setup time.
*/
typedef struct {
Multifd RDMA is need to poll when we send data, record it. Signed-off-by: Chuan Zheng <zhengchuan@huawei.com> --- migration/migration.c | 1 + migration/migration.h | 1 + migration/rdma.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+)