RDMA update
authorYufei Ren <renyufei83@gmail.com>
Tue, 2 Aug 2011 10:15:30 +0000 (12:15 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Tue, 2 Aug 2011 10:15:30 +0000 (12:15 +0200)
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Makefile
engines/rdma.c

index e48c6e0e9452f767723d20d2a6ddf6bb4ac1faf7..40d47d5ef66329af53e8657cbbddf67737ee9205 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
        $(DEBUGFLAGS)
 OPTFLAGS= -O2 -fno-omit-frame-pointer -g $(EXTFLAGS)
 CFLAGS = -std=gnu99 -Wwrite-strings -Wall $(OPTFLAGS)
-LIBS    = -lm $(EXTLIBS)
+LIBS   = -lm $(EXTLIBS)
 PROGS  = fio
 SCRIPTS = fio_generate_plots
 UNAME  := $(shell uname)
index 2eeb897278e02f81e8ba7c8b35673dc8a95400ba..060927aec42cd261faf0c65dd9aa5920f718d4eb 100644 (file)
@@ -114,7 +114,7 @@ static int client_recv(struct thread_data *td, struct ibv_wc *wc)
        struct rdmaio_data *rd = td->io_ops->data;
 
        if (wc->byte_len != sizeof(rd->recv_buf)) {
-               fprintf(stderr, "Received bogus data, size %d\n", wc->byte_len);
+               log_err("Received bogus data, size %d\n", wc->byte_len);
                return 1;
        }
 
@@ -602,8 +602,8 @@ static int fio_rdmaio_send(struct thread_data *td, struct io_u **io_us,
                        index = rand() % rd->rmt_nr;
                        r_io_u_d->sq_wr.opcode = IBV_WR_RDMA_WRITE;
                        r_io_u_d->sq_wr.wr.rdma.rkey = rd->rmt_us[index].rkey;
-                       r_io_u_d->sq_wr.wr.rdma.remote_addr =
-                           rd->rmt_us[index].buf;
+                       r_io_u_d->sq_wr.wr.rdma.remote_addr = \
+                               rd->rmt_us[index].buf;
                        r_io_u_d->sq_wr.sg_list->length = io_us[i]->buflen;
                        break;
                case FIO_RDMA_MEM_READ:
@@ -612,8 +612,8 @@ static int fio_rdmaio_send(struct thread_data *td, struct io_u **io_us,
                        index = rand() % rd->rmt_nr;
                        r_io_u_d->sq_wr.opcode = IBV_WR_RDMA_READ;
                        r_io_u_d->sq_wr.wr.rdma.rkey = rd->rmt_us[index].rkey;
-                       r_io_u_d->sq_wr.wr.rdma.remote_addr =
-                           rd->rmt_us[index].buf;
+                       r_io_u_d->sq_wr.wr.rdma.remote_addr = \
+                               rd->rmt_us[index].buf;
                        r_io_u_d->sq_wr.sg_list->length = io_us[i]->buflen;
                        break;
                case FIO_RDMA_CHA_SEND:
@@ -1087,9 +1087,9 @@ static int fio_rdmaio_init(struct thread_data *td)
        if ((rd->rdma_protocol == FIO_RDMA_MEM_WRITE) ||
            (rd->rdma_protocol == FIO_RDMA_MEM_READ)) {
                rd->rmt_us =
-                   malloc(FIO_RDMA_MAX_IO_DPETH * sizeof(struct remote_u));
+                       malloc(FIO_RDMA_MAX_IO_DPETH * sizeof(struct remote_u));
                memset(rd->rmt_us, 0,
-                      FIO_RDMA_MAX_IO_DPETH * sizeof(struct remote_u));
+                       FIO_RDMA_MAX_IO_DPETH * sizeof(struct remote_u));
                rd->rmt_nr = 0;
        }
 
@@ -1184,19 +1184,19 @@ static int fio_rdmaio_setup(struct thread_data *td)
 }
 
 static struct ioengine_ops ioengine_rw = {
-       .name = "rdma",
-       .version = FIO_IOOPS_VERSION,
-       .setup = fio_rdmaio_setup,
-       .init = fio_rdmaio_init,
-       .prep = fio_rdmaio_prep,
-       .queue = fio_rdmaio_queue,
-       .commit = fio_rdmaio_commit,
-       .getevents = fio_rdmaio_getevents,
-       .event = fio_rdmaio_event,
-       .cleanup = fio_rdmaio_cleanup,
-       .open_file = fio_rdmaio_open_file,
-       .close_file = fio_rdmaio_close_file,
-       .flags = FIO_DISKLESSIO | FIO_UNIDIR | FIO_PIPEIO,
+       .name           = "rdma",
+       .version        = FIO_IOOPS_VERSION,
+       .setup          = fio_rdmaio_setup,
+       .init           = fio_rdmaio_init,
+       .prep           = fio_rdmaio_prep,
+       .queue          = fio_rdmaio_queue,
+       .commit         = fio_rdmaio_commit,
+       .getevents      = fio_rdmaio_getevents,
+       .event          = fio_rdmaio_event,
+       .cleanup        = fio_rdmaio_cleanup,
+       .open_file      = fio_rdmaio_open_file,
+       .close_file     = fio_rdmaio_close_file,
+       .flags          = FIO_DISKLESSIO | FIO_UNIDIR | FIO_PIPEIO,
 };
 
 #else /* FIO_HAVE_RDMA */
@@ -1231,13 +1231,13 @@ static int fio_rdmaio_init(struct thread_data fio_unused * td)
 }
 
 static struct ioengine_ops ioengine_rw = {
-       .name = "rdma",
-       .version = FIO_IOOPS_VERSION,
-       .init = fio_rdmaio_init,
-       .queue = fio_rdmaio_queue,
-       .open_file = fio_rdmaio_open_file,
-       .close_file = fio_rdmaio_close_file,
-       .flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR | FIO_PIPEIO,
+       .name           = "rdma",
+       .version        = FIO_IOOPS_VERSION,
+       .init           = fio_rdmaio_init,
+       .queue          = fio_rdmaio_queue,
+       .open_file      = fio_rdmaio_open_file,
+       .close_file     = fio_rdmaio_close_file,
+       .flags          = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR | FIO_PIPEIO,
 };
 
 #endif