options: split out option grouping code
[fio.git] / engines / rdma.c
index 5f0adee5377c61a84080169811eebc16ad0c8b61..87ba4658ceca94f6c6aec683cc4e56fc5d0c4d63 100644 (file)
@@ -41,6 +41,7 @@
 
 #include "../fio.h"
 #include "../hash.h"
+#include "../optgroup.h"
 
 #include <rdma/rdma_cma.h>
 #include <infiniband/arch.h>
@@ -115,7 +116,7 @@ static struct fio_option options[] = {
                          },
                          { .ival = "recv",
                            .oval = FIO_RDMA_CHA_RECV,
-                           .help = "Posted Recieve",
+                           .help = "Posted Receive",
                          },
                },
                .category = FIO_OPT_C_ENGINE,
@@ -1073,6 +1074,9 @@ static int fio_rdmaio_setup_listen(struct thread_data *td, short port)
 {
        struct rdmaio_data *rd = td->io_ops->data;
        struct ibv_recv_wr *bad_wr;
+       int state = td->runstate;
+
+       td_set_runstate(td, TD_SETTING_UP);
 
        rd->addr.sin_family = AF_INET;
        rd->addr.sin_addr.s_addr = htonl(INADDR_ANY);
@@ -1089,6 +1093,8 @@ static int fio_rdmaio_setup_listen(struct thread_data *td, short port)
                return 1;
        }
 
+       log_info("fio: waiting for connection\n");
+
        /* wait for CONNECT_REQUEST */
        if (get_next_channel_event
            (td, rd->cm_channel, RDMA_CM_EVENT_CONNECT_REQUEST) != 0) {
@@ -1108,6 +1114,7 @@ static int fio_rdmaio_setup_listen(struct thread_data *td, short port)
                return 1;
        }
 
+       td_set_runstate(td, state);
        return 0;
 }
 
@@ -1264,6 +1271,7 @@ static int fio_rdmaio_init(struct thread_data *td)
 
        if (td_read(td)) {      /* READ as the server */
                rd->is_client = 0;
+               td->flags |= TD_F_NO_PROGRESS;
                /* server rd->rdma_buf_len will be setup after got request */
                ret = fio_rdmaio_setup_listen(td, o->port);
        } else {                /* WRITE as the client */