#include <inttypes.h>
#include "../fio.h"
+#include "../hash.h"
#ifdef FIO_HAVE_RDMA
int io_u_flight_nr;
struct io_u **io_us_completed;
int io_u_completed_nr;
+
+ struct frand_state rand_state;
};
static int client_recv(struct thread_data *td, struct ibv_wc *wc)
if (td->o.use_os_rand)
index = os_random_long(&td->random_state) % rd->rmt_nr;
else
- index = __rand(&td->__random_state) % rd->rmt_nr;
+ index = __rand(&rd->rand_state) % 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 = \
if (td->o.use_os_rand)
index = os_random_long(&td->random_state) % rd->rmt_nr;
else
- index = __rand(&td->__random_state) % rd->rmt_nr;
+ index = __rand(&rd->rand_state) % 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 = malloc(sizeof(*rd));;
memset(rd, 0, sizeof(*rd));
+ init_rand_seed(&rd->rand_state, (unsigned int) GOLDEN_RATIO_PRIME);
td->io_ops->data = rd;
}