From b6cf38f0aed8b12db1c8fd520c09e5a74066ebc9 Mon Sep 17 00:00:00 2001 From: Yufei Ren Date: Tue, 2 Aug 2011 12:15:30 +0200 Subject: [PATCH] RDMA update Signed-off-by: Jens Axboe --- Makefile | 2 +- engines/rdma.c | 54 +++++++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index e48c6e0e..40d47d5e 100644 --- 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) diff --git a/engines/rdma.c b/engines/rdma.c index 2eeb8972..060927ae 100644 --- a/engines/rdma.c +++ b/engines/rdma.c @@ -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 -- 2.25.1