projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/albert-chang0/fio
[fio.git]
/
engines
/
rdma.c
diff --git
a/engines/rdma.c
b/engines/rdma.c
index 2569a8e32e6a0d34f61fb3c9a46e13be56dfcf27..f4471869813693eb140bec7d87a31123b539ea89 100644
(file)
--- a/
engines/rdma.c
+++ b/
engines/rdma.c
@@
-226,7
+226,8
@@
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_nr = ntohl(rd->recv_buf.nr);
for (i = 0; i < rd->rmt_nr; i++) {
- rd->rmt_us[i].buf = be64_to_cpu(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);
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);
@@
-1050,7
+1051,7
@@
static int fio_rdmaio_setup_connect(struct thread_data *td, const char *host,
return err;
/* resolve route */
return err;
/* resolve route */
- if (
strcmp(o->bindname, "") != 0
) {
+ if (
o->bindname && strlen(o->bindname)
) {
addrb.ss_family = AF_INET;
err = aton(td, o->bindname, (struct sockaddr_in *)&addrb);
if (err)
addrb.ss_family = AF_INET;
err = aton(td, o->bindname, (struct sockaddr_in *)&addrb);
if (err)
@@
-1116,7
+1117,7
@@
static int fio_rdmaio_setup_listen(struct thread_data *td, short port)
rd->addr.sin_family = AF_INET;
rd->addr.sin_port = htons(port);
rd->addr.sin_family = AF_INET;
rd->addr.sin_port = htons(port);
- if (
strcmp(o->bindname, "") == 0
)
+ if (
!o->bindname || !strlen(o->bindname)
)
rd->addr.sin_addr.s_addr = htonl(INADDR_ANY);
else
rd->addr.sin_addr.s_addr = htonl(*o->bindname);
rd->addr.sin_addr.s_addr = htonl(INADDR_ANY);
else
rd->addr.sin_addr.s_addr = htonl(*o->bindname);
@@
-1249,8
+1250,7
@@
static int fio_rdmaio_init(struct thread_data *td)
{
struct rdmaio_data *rd = td->io_ops_data;
struct rdmaio_options *o = td->eo;
{
struct rdmaio_data *rd = td->io_ops_data;
struct rdmaio_options *o = td->eo;
- unsigned int max_bs;
- int ret, i;
+ int ret;
if (td_rw(td)) {
log_err("fio: rdma connections must be read OR write\n");
if (td_rw(td)) {
log_err("fio: rdma connections must be read OR write\n");
@@
-1318,6
+1318,13
@@
static int fio_rdmaio_init(struct thread_data *td)
rd->is_client = 1;
ret = fio_rdmaio_setup_connect(td, td->o.filename, o->port);
}
rd->is_client = 1;
ret = fio_rdmaio_setup_connect(td, td->o.filename, o->port);
}
+ return ret;
+}
+static int fio_rdmaio_post_init(struct thread_data *td)
+{
+ unsigned int max_bs;
+ int i;
+ struct rdmaio_data *rd = td->io_ops_data;
max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
rd->send_buf.max_bs = htonl(max_bs);
max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
rd->send_buf.max_bs = htonl(max_bs);
@@
-1351,7
+1358,7
@@
static int fio_rdmaio_init(struct thread_data *td)
rd->send_buf.nr = htonl(i);
rd->send_buf.nr = htonl(i);
- return
ret
;
+ return
0
;
}
static void fio_rdmaio_cleanup(struct thread_data *td)
}
static void fio_rdmaio_cleanup(struct thread_data *td)
@@
-1383,11
+1390,12
@@
static int fio_rdmaio_setup(struct thread_data *td)
return 0;
}
return 0;
}
-
static struct ioengine_ops ioengine_rw
= {
+
FIO_STATIC struct ioengine_ops ioengine
= {
.name = "rdma",
.version = FIO_IOOPS_VERSION,
.setup = fio_rdmaio_setup,
.init = fio_rdmaio_init,
.name = "rdma",
.version = FIO_IOOPS_VERSION,
.setup = fio_rdmaio_setup,
.init = fio_rdmaio_init,
+ .post_init = fio_rdmaio_post_init,
.prep = fio_rdmaio_prep,
.queue = fio_rdmaio_queue,
.commit = fio_rdmaio_commit,
.prep = fio_rdmaio_prep,
.queue = fio_rdmaio_queue,
.commit = fio_rdmaio_commit,
@@
-1403,10
+1411,10
@@
static struct ioengine_ops ioengine_rw = {
static void fio_init fio_rdmaio_register(void)
{
static void fio_init fio_rdmaio_register(void)
{
- register_ioengine(&ioengine
_rw
);
+ register_ioengine(&ioengine);
}
static void fio_exit fio_rdmaio_unregister(void)
{
}
static void fio_exit fio_rdmaio_unregister(void)
{
- unregister_ioengine(&ioengine
_rw
);
+ unregister_ioengine(&ioengine);
}
}