[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/16] migration/rdma: Fix race on source
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 01/16] migration/rdma: Fix race on source |
Date: |
Tue, 18 Jul 2017 17:41:12 +0200 |
From: "Dr. David Alan Gilbert" <address@hidden>
Fix a race where the destination might try and send the source a
WRID_READY before the source has done a post-recv for it.
rdma_post_recv has to happen after the qp exists, and we're
OK since we've already called qemu_rdma_source_init that calls
qemu_alloc_qp.
This corresponds to:
https://bugzilla.redhat.com/show_bug.cgi?id=1285044
The race can be triggered by adding a few ms wait before this
post_recv_control (which was originally due to me turning on loads of
debug).
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/rdma.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index c6bc607..6111e10 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2365,6 +2365,12 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error
**errp)
caps_to_network(&cap);
+ ret = qemu_rdma_post_recv_control(rdma, RDMA_WRID_READY);
+ if (ret) {
+ ERROR(errp, "posting second control recv");
+ goto err_rdma_source_connect;
+ }
+
ret = rdma_connect(rdma->cm_id, &conn_param);
if (ret) {
perror("rdma_connect");
@@ -2405,12 +2411,6 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error
**errp)
rdma_ack_cm_event(cm_event);
- ret = qemu_rdma_post_recv_control(rdma, RDMA_WRID_READY);
- if (ret) {
- ERROR(errp, "posting second control recv!");
- goto err_rdma_source_connect;
- }
-
rdma->control_ready_expected = 1;
rdma->nb_sent = 0;
return 0;
--
2.9.4
- [Qemu-devel] [PULL 00/16] Migration, Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 02/16] migration: Close file on failed migration load, Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 01/16] migration/rdma: Fix race on source,
Juan Quintela <=
- [Qemu-devel] [PULL 03/16] migration/rdma: fix qemu_rdma_block_for_wrid error paths, Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 04/16] migration/rdma: Allow cancelling while waiting for wrid, Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 05/16] migration/rdma: Safely convert control types, Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 06/16] migration/rdma: Send error during cancelling, Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 07/16] qdev: provide DEFINE_PROP_INT64(), Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 09/16] migration: export capabilities to props, Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 08/16] migration: export parameters to props, Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 10/16] migration: introduce migrate_params_check(), Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 11/16] migration: provide migrate_params_apply(), Juan Quintela, 2017/07/18
- [Qemu-devel] [PULL 13/16] migration: remove check against colo support, Juan Quintela, 2017/07/18