Motr  M0
bulkio_ut.c File Reference
#include <sys/stat.h>
#include <sys/types.h>
#include "lib/processor.h"
#include "lib/locality.h"
#include "lib/finject.h"
#include "ut/ut.h"
#include "bulkio_common.h"
#include "net/lnet/lnet.h"
#include "rpc/rpclib.h"
#include "ioservice/io_fops.c"
#include "ioservice/io_foms.c"
#include "motr/setup.h"
#include "motr/setup_internal.h"
#include "pool/pool.h"
#include "fop/fom_generic.c"
Include dependency graph for bulkio_ut.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_IOSERVICE
 
#define WRITE_FOP_DATA(fop)   M0_XCODE_OBJ(m0_fop_cob_writev_xc, fop)
 

Enumerations

enum  fom_state_transition_tests {
  TEST00 = M0_FOPH_IO_FOM_PREPARE, TEST01, TEST02, TEST03,
  TEST07, TEST10, TEST11, TEST12
}
 

Functions

void bulkioapi_test (void)
 
static int io_fop_server_write_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
 
static int ut_io_fom_cob_rw_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
 
static int io_fop_server_read_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
 
static int io_fop_stob_create_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
 
static int check_write_fom_tick (struct m0_fom *fom)
 
static int check_read_fom_tick (struct m0_fom *fom)
 
static void bulkio_stob_fom_fini (struct m0_fom *fom)
 
struct m0_net_buffer_poolut_get_buffer_pool (struct m0_fom *fom)
 
static int bulkio_server_write_fom_tick (struct m0_fom *fom)
 
static int bulkio_server_read_fom_tick (struct m0_fom *fom)
 
static int ut_io_fom_cob_rw_state (struct m0_fom *fom)
 
static void empty_buffers_pool (uint32_t colour)
 
static void release_one_buffer (uint32_t colour)
 
static void fill_buffers_pool (uint32_t colour)
 
static void builkio_ut_stob_get (struct m0_io_fom_cob_rw *fom_obj)
 
static void fom_phase_set (struct m0_fom *fom, int phase)
 
static int bulkio_stob_create_fom_tick (struct m0_fom *fom)
 
static void bulkio_stob_create (void)
 
static void io_fops_submit (uint32_t index, enum M0_RPC_OPCODES op)
 
static void io_single_fop_submit (enum M0_RPC_OPCODES op)
 
static void bulkio_server_single_read_write (void)
 
static void bulkio_server_write_fol_rec_verify (void)
 
static void bulkio_server_write_fol_rec_undo_verify (void)
 
static void bulkio_server_read_write_state_test (void)
 
static void bulkio_server_rw_state_transition_test (void)
 
static void bulkio_server_fsync_multiple_read_write (void)
 
static void bulkio_server_multiple_read_write (void)
 
static void add_buffer_bulk (struct m0_rpc_bulk *rbulk, enum M0_RPC_OPCODES op, int index)
 
static void fop_create_populate (int index, enum M0_RPC_OPCODES op, int buf_nr)
 
static void bulkio_server_read_write_multiple_nb (void)
 
static void bulkio_init (void)
 
static void bulkio_fini (void)
 

Variables

static bool bulkio_stob_created = false
 
static struct bulkio_paramsbp
 
static struct m0_buf payload_buf = M0_BUF_INIT0
 
static bool fol_check_enabled = false
 
static const struct m0_fop_type_ops bulkio_stob_create_ops
 
static const struct m0_fop_type_ops bulkio_server_write_fop_ut_ops
 
static const struct m0_fop_type_ops bulkio_server_read_fop_ut_ops
 
static const struct m0_fom_type_ops bulkio_server_write_fomt_ops
 
static const struct m0_fom_type_ops bulkio_server_read_fomt_ops
 
static const struct m0_fom_type_ops bulkio_stob_create_fomt_ops
 
static const struct m0_fom_type_ops ut_io_fom_cob_rw_type_ops
 
static int nb_nr = 0
 
static struct m0_net_buffernb_list [64]
 
static struct m0_net_buffer_poolbuf_pool
 
static int next_write_test = TEST00
 
static int next_read_test = TEST00
 
static const struct m0_fom_ops bulkio_stob_create_fom_ops
 
static const struct m0_fom_ops bulkio_server_write_fom_ops
 
static const struct m0_fom_ops ut_io_fom_cob_rw_ops
 
static const struct m0_fom_ops bulkio_server_read_fom_ops
 
struct m0_ut_suite bulkio_server_ut
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_IOSERVICE

Definition at line 40 of file bulkio_ut.c.

◆ WRITE_FOP_DATA

#define WRITE_FOP_DATA (   fop)    M0_XCODE_OBJ(m0_fop_cob_writev_xc, fop)

Definition at line 1315 of file bulkio_ut.c.

Enumeration Type Documentation

◆ fom_state_transition_tests

Enumerator
TEST00 
TEST01 
TEST02 
TEST03 
TEST07 
TEST10 
TEST11 
TEST12 

Definition at line 248 of file bulkio_ut.c.

Function Documentation

◆ add_buffer_bulk()

static void add_buffer_bulk ( struct m0_rpc_bulk rbulk,
enum M0_RPC_OPCODES  op,
int  index 
)
static

Definition at line 1627 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ builkio_ut_stob_get()

static void builkio_ut_stob_get ( struct m0_io_fom_cob_rw fom_obj)
static

Definition at line 290 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bulkio_fini()

static void bulkio_fini ( void  )
static

Definition at line 1794 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_init()

static void bulkio_init ( void  )
static

Definition at line 1759 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_fsync_multiple_read_write()

static void bulkio_server_fsync_multiple_read_write ( void  )
static

Sends several read/write fops to the ioservice and keeps the ID of the last transaction generated by them. The received ID is then used to send an fsync fop request that commits transactions that are lingering in the ioservice.

Definition at line 1535 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_multiple_read_write()

static void bulkio_server_multiple_read_write ( void  )
static

Definition at line 1579 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_read_fom_tick()

static int bulkio_server_read_fom_tick ( struct m0_fom fom)
static

Definition at line 188 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_read_write_multiple_nb()

static void bulkio_server_read_write_multiple_nb ( void  )
static

Definition at line 1721 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_read_write_state_test()

static void bulkio_server_read_write_state_test ( void  )
static

Definition at line 1450 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_rw_state_transition_test()

static void bulkio_server_rw_state_transition_test ( void  )
static

Definition at line 1492 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_single_read_write()

static void bulkio_server_single_read_write ( void  )
static

Definition at line 1295 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_write_fol_rec_undo_verify()

static void bulkio_server_write_fol_rec_undo_verify ( void  )
static

Definition at line 1359 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_write_fol_rec_verify()

static void bulkio_server_write_fol_rec_verify ( void  )
static

Definition at line 1317 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_server_write_fom_tick()

static int bulkio_server_write_fom_tick ( struct m0_fom fom)
static

Definition at line 132 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_stob_create()

static void bulkio_stob_create ( void  )
static

Definition at line 1224 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bulkio_stob_create_fom_tick()

static int bulkio_stob_create_fom_tick ( struct m0_fom fom)
static

Definition at line 1060 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkio_stob_fom_fini()

static void bulkio_stob_fom_fini ( struct m0_fom fom)
static

Definition at line 95 of file bulkio_ut.c.

Here is the call graph for this function:

◆ bulkioapi_test()

void bulkioapi_test ( void  )

◆ check_read_fom_tick()

static int check_read_fom_tick ( struct m0_fom fom)
static

Definition at line 720 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_write_fom_tick()

static int check_write_fom_tick ( struct m0_fom fom)
static

Definition at line 366 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ empty_buffers_pool()

static void empty_buffers_pool ( uint32_t  colour)
static

Definition at line 265 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill_buffers_pool()

static void fill_buffers_pool ( uint32_t  colour)
static

Definition at line 282 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fom_phase_set()

static void fom_phase_set ( struct m0_fom fom,
int  phase 
)
static

Definition at line 315 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fop_create_populate()

static void fop_create_populate ( int  index,
enum M0_RPC_OPCODES  op,
int  buf_nr 
)
static

Definition at line 1661 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_fop_server_read_fom_create()

static int io_fop_server_read_fom_create ( struct m0_fop fop,
struct m0_fom **  m,
struct m0_reqh reqh 
)
static

Definition at line 1209 of file bulkio_ut.c.

Here is the call graph for this function:

◆ io_fop_server_write_fom_create()

static int io_fop_server_write_fom_create ( struct m0_fop fop,
struct m0_fom **  m,
struct m0_reqh reqh 
)
static

Definition at line 1167 of file bulkio_ut.c.

Here is the call graph for this function:

◆ io_fop_stob_create_fom_create()

static int io_fop_stob_create_fom_create ( struct m0_fop fop,
struct m0_fom **  m,
struct m0_reqh reqh 
)
static

Definition at line 1152 of file bulkio_ut.c.

Here is the call graph for this function:

◆ io_fops_submit()

static void io_fops_submit ( uint32_t  index,
enum M0_RPC_OPCODES  op 
)
static

Definition at line 1264 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ io_single_fop_submit()

static void io_single_fop_submit ( enum M0_RPC_OPCODES  op)
static

Definition at line 1274 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ release_one_buffer()

static void release_one_buffer ( uint32_t  colour)
static

Definition at line 275 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ut_get_buffer_pool()

struct m0_net_buffer_pool* ut_get_buffer_pool ( struct m0_fom fom)

Definition at line 105 of file bulkio_ut.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ut_io_fom_cob_rw_create()

static int ut_io_fom_cob_rw_create ( struct m0_fop fop,
struct m0_fom **  m,
struct m0_reqh reqh 
)
static

Definition at line 1185 of file bulkio_ut.c.

Here is the call graph for this function:

◆ ut_io_fom_cob_rw_state()

static int ut_io_fom_cob_rw_state ( struct m0_fom fom)
static

Definition at line 242 of file bulkio_ut.c.

Here is the call graph for this function:

Variable Documentation

◆ bp

struct bulkio_params* bp
static

Definition at line 44 of file bulkio_ut.c.

◆ buf_pool

struct m0_net_buffer_pool* buf_pool
static

Definition at line 261 of file bulkio_ut.c.

◆ bulkio_server_read_fom_ops

const struct m0_fom_ops bulkio_server_read_fom_ops
static
Initial value:
= {
.fo_home_locality = m0_io_fom_cob_rw_locality_get
}
static int bulkio_server_read_fom_tick(struct m0_fom *fom)
Definition: bulkio_ut.c:188
static void m0_io_fom_cob_rw_fini(struct m0_fom *fom)
Definition: io_foms.c:2396
static size_t m0_io_fom_cob_rw_locality_get(const struct m0_fom *fom)
Definition: io_foms.c:2478

Definition at line 1146 of file bulkio_ut.c.

◆ bulkio_server_read_fomt_ops

const struct m0_fom_type_ops bulkio_server_read_fomt_ops
static
Initial value:
= {
}
static int io_fop_server_read_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: bulkio_ut.c:1209

Definition at line 83 of file bulkio_ut.c.

◆ bulkio_server_read_fop_ut_ops

const struct m0_fop_type_ops bulkio_server_read_fop_ut_ops
static
Initial value:
= {
.fto_fop_replied = io_fop_replied,
.fto_io_coalesce = io_fop_coalesce,
.fto_io_desc_get = io_fop_desc_get,
}
static void io_fop_desc_get(struct m0_fop *fop, struct m0_net_buf_desc_data **desc)
Definition: io_fops.c:1799
static void io_fop_replied(struct m0_fop *fop, struct m0_fop *bkpfop)
Definition: io_fops.c:1773
static int io_fop_coalesce(struct m0_fop *res_fop, uint64_t size)
Definition: io_fops.c:1614

Definition at line 73 of file bulkio_ut.c.

◆ bulkio_server_ut

struct m0_ut_suite bulkio_server_ut

Definition at line 1816 of file bulkio_ut.c.

◆ bulkio_server_write_fom_ops

const struct m0_fom_ops bulkio_server_write_fom_ops
static
Initial value:
= {
.fo_home_locality = m0_io_fom_cob_rw_locality_get
}
static int bulkio_server_write_fom_tick(struct m0_fom *fom)
Definition: bulkio_ut.c:132
static void m0_io_fom_cob_rw_fini(struct m0_fom *fom)
Definition: io_foms.c:2396
static size_t m0_io_fom_cob_rw_locality_get(const struct m0_fom *fom)
Definition: io_foms.c:2478

Definition at line 1134 of file bulkio_ut.c.

◆ bulkio_server_write_fomt_ops

const struct m0_fom_type_ops bulkio_server_write_fomt_ops
static
Initial value:
= {
}
static int io_fop_server_write_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: bulkio_ut.c:1167

Definition at line 79 of file bulkio_ut.c.

◆ bulkio_server_write_fop_ut_ops

const struct m0_fop_type_ops bulkio_server_write_fop_ut_ops
static
Initial value:
= {
.fto_fop_replied = io_fop_replied,
.fto_io_coalesce = io_fop_coalesce,
.fto_io_desc_get = io_fop_desc_get,
}
static void io_fop_desc_get(struct m0_fop *fop, struct m0_net_buf_desc_data **desc)
Definition: io_fops.c:1799
static void io_fop_replied(struct m0_fop *fop, struct m0_fop *bkpfop)
Definition: io_fops.c:1773
static int io_fop_coalesce(struct m0_fop *res_fop, uint64_t size)
Definition: io_fops.c:1614

Definition at line 67 of file bulkio_ut.c.

◆ bulkio_stob_create_fom_ops

const struct m0_fom_ops bulkio_stob_create_fom_ops
static
Initial value:
= {
.fo_home_locality = m0_io_fom_cob_rw_locality_get
}
static void bulkio_stob_fom_fini(struct m0_fom *fom)
Definition: bulkio_ut.c:95
static int bulkio_stob_create_fom_tick(struct m0_fom *fom)
Definition: bulkio_ut.c:1060
static size_t m0_io_fom_cob_rw_locality_get(const struct m0_fom *fom)
Definition: io_foms.c:2478

Definition at line 1128 of file bulkio_ut.c.

◆ bulkio_stob_create_fomt_ops

const struct m0_fom_type_ops bulkio_stob_create_fomt_ops
static
Initial value:
= {
}
static int io_fop_stob_create_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: bulkio_ut.c:1152

Definition at line 87 of file bulkio_ut.c.

◆ bulkio_stob_create_ops

const struct m0_fop_type_ops bulkio_stob_create_ops
static
Initial value:
= {
.fto_fop_replied = io_fop_replied,
.fto_io_coalesce = io_fop_coalesce,
.fto_io_desc_get = io_fop_desc_get,
}
static void io_fop_desc_get(struct m0_fop *fop, struct m0_net_buf_desc_data **desc)
Definition: io_fops.c:1799
static void io_fop_replied(struct m0_fop *fop, struct m0_fop *bkpfop)
Definition: io_fops.c:1773
static int io_fop_coalesce(struct m0_fop *res_fop, uint64_t size)
Definition: io_fops.c:1614

Definition at line 61 of file bulkio_ut.c.

◆ bulkio_stob_created

bool bulkio_stob_created = false
static

Definition at line 42 of file bulkio_ut.c.

◆ fol_check_enabled

bool fol_check_enabled = false
static

Definition at line 47 of file bulkio_ut.c.

◆ nb_list

struct m0_net_buffer* nb_list[64]
static

Definition at line 260 of file bulkio_ut.c.

◆ nb_nr

int nb_nr = 0
static

Definition at line 259 of file bulkio_ut.c.

◆ next_read_test

int next_read_test = TEST00
static

Definition at line 263 of file bulkio_ut.c.

◆ next_write_test

int next_write_test = TEST00
static

Definition at line 262 of file bulkio_ut.c.

◆ payload_buf

struct m0_buf payload_buf = M0_BUF_INIT0
static

Definition at line 46 of file bulkio_ut.c.

◆ ut_io_fom_cob_rw_ops

const struct m0_fom_ops ut_io_fom_cob_rw_ops
static
Initial value:
= {
.fo_home_locality = m0_io_fom_cob_rw_locality_get
}
static int ut_io_fom_cob_rw_state(struct m0_fom *fom)
Definition: bulkio_ut.c:242
static void m0_io_fom_cob_rw_fini(struct m0_fom *fom)
Definition: io_foms.c:2396
static size_t m0_io_fom_cob_rw_locality_get(const struct m0_fom *fom)
Definition: io_foms.c:2478

Definition at line 1140 of file bulkio_ut.c.

◆ ut_io_fom_cob_rw_type_ops

const struct m0_fom_type_ops ut_io_fom_cob_rw_type_ops
static
Initial value:
= {
.fto_create = ut_io_fom_cob_rw_create,
}
static int ut_io_fom_cob_rw_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: bulkio_ut.c:1185

Definition at line 91 of file bulkio_ut.c.