Merge branch 'doc-patches' of https://github.com/vincentkfu/fio
[fio.git] / engines / rdma.c
index fbe8434406b72e37fd88cf20ca46114b0b001914..da00cba8b66b3f6db0bcd3a9cba8b45b9362ffa7 100644 (file)
@@ -44,7 +44,6 @@
 #include "../optgroup.h"
 
 #include <rdma/rdma_cma.h>
-#include <infiniband/arch.h>
 
 #define FIO_RDMA_MAX_IO_DEPTH    512
 
@@ -216,7 +215,7 @@ static int client_recv(struct thread_data *td, struct ibv_wc *wc)
                rd->rmt_nr = ntohl(rd->recv_buf.nr);
 
                for (i = 0; i < rd->rmt_nr; i++) {
-                       rd->rmt_us[i].buf = ntohll(rd->recv_buf.rmt_us[i].buf);
+                       rd->rmt_us[i].buf = be64_to_cpu(rd->recv_buf.rmt_us[i].buf);
                        rd->rmt_us[i].rkey = ntohl(rd->recv_buf.rmt_us[i].rkey);
                        rd->rmt_us[i].size = ntohl(rd->recv_buf.rmt_us[i].size);
 
@@ -802,7 +801,7 @@ static void fio_rdmaio_queued(struct thread_data *td, struct io_u **io_us,
                              unsigned int nr)
 {
        struct rdmaio_data *rd = td->io_ops_data;
-       struct timeval now;
+       struct timespec now;
        unsigned int i;
 
        if (!fio_fill_issue_time(td))
@@ -881,7 +880,7 @@ static int fio_rdmaio_connect(struct thread_data *td, struct fio_file *f)
        rd->send_buf.nr = htonl(td->o.iodepth);
 
        if (ibv_post_send(rd->qp, &rd->sq_wr, &bad_wr) != 0) {
-               log_err("fio: ibv_post_send fail: %m");
+               log_err("fio: ibv_post_send fail: %m\n");
                return 1;
        }
 
@@ -932,7 +931,7 @@ static int fio_rdmaio_accept(struct thread_data *td, struct fio_file *f)
        ret = rdma_poll_wait(td, IBV_WC_RECV) < 0;
 
        if (ibv_post_send(rd->qp, &rd->sq_wr, &bad_wr) != 0) {
-               log_err("fio: ibv_post_send fail: %m");
+               log_err("fio: ibv_post_send fail: %m\n");
                return 1;
        }
 
@@ -965,7 +964,7 @@ static int fio_rdmaio_close_file(struct thread_data *td, struct fio_file *f)
                                     || (rd->rdma_protocol ==
                                         FIO_RDMA_MEM_READ))) {
                if (ibv_post_send(rd->qp, &rd->sq_wr, &bad_wr) != 0) {
-                       log_err("fio: ibv_post_send fail: %m");
+                       log_err("fio: ibv_post_send fail: %m\n");
                        return 1;
                }
 
@@ -1300,7 +1299,7 @@ static int fio_rdmaio_init(struct thread_data *td)
                }
 
                rd->send_buf.rmt_us[i].buf =
-                   htonll((uint64_t) (unsigned long)io_u->buf);
+                   cpu_to_be64((uint64_t) (unsigned long)io_u->buf);
                rd->send_buf.rmt_us[i].rkey = htonl(io_u->mr->rkey);
                rd->send_buf.rmt_us[i].size = htonl(max_bs);