25 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 36 #if defined(round_down) 49 #define DUMMY_PTR 0xdeafdead 51 #define UT_DEFAULT_BLOCK_SIZE (1ULL << M0_DEFAULT_BUF_SHIFT) 176 ctx->sc_type = M0_CST_IOS;
257 m0_free(
map->pi_databufs[0][0]->db_buf.b_addr);
259 map->pi_databufs[0][0]->db_buf.b_addr =
NULL;
260 map->pi_databufs[0][0]->db_flags |= 777;
379 target_ioreq_bob_init(ti);
380 tioreqht_tlink_init(ti);
537 nw_xfer_request_bob_init(xfer);
630 {
"tioreqs_hash_func",
634 {
"target_ioreq_invariant",
638 {
"target_ioreq_locate",
640 {
"target_ioreq_seg_add",
646 {
"target_ioreq_iofops_prepare",
648 {
"target_ioreq_init",
650 {
"target_ioreq_fini",
652 {
"nw_xfer_request_invariant",
654 {
"nw_xfer_tioreq_get",
656 {
"nw_xfer_io_distribute",
658 {
"nw_xfer_req_complete",
660 {
"nw_xfer_req_dispatch",
662 {
"nw_xfer_tioreq_map",
664 {
"nw_xfer_request_init",
666 {
"nw_xfer_request_fini",
668 {
"dgmode_rwvec_alloc_init",
670 {
"dgmode_rwvec_dealloc_fini",
676 #undef M0_TRACE_SUBSYSTEM
static uint64_t tioreqs_hash_func(const struct m0_htable *htable, const void *k)
static bool target_ioreq_invariant(const struct target_ioreq *ti)
void ut_layout_domain_empty(struct m0_client *cinst)
static void ut_test_nw_xfer_io_distribute(void)
#define M0_ALLOC_ARR(arr, nr)
static void ut_test_nw_xfer_request_invariant(void)
static void ut_test_target_ioreq_fini(void)
static void nw_xfer_req_complete(struct nw_xfer_request *xfer, bool rmw)
void m0_entity_fini(struct m0_entity *entity)
M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid, uint32_t container, uint64_t key)
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
struct m0_atomic64 nxr_rdbulk_nr
static struct m0_client * dummy_instance
struct m0_pool_version * pv
M0_INTERNAL void nw_xfer_request_init(struct nw_xfer_request *xfer)
M0_INTERNAL int m0_io_nw_xfer_ut_fini(void)
static int dgmode_rwvec_alloc_init(struct target_ioreq *ti)
M0_INTERNAL void ut_dummy_pargrp_iomap_delete(struct pargrp_iomap *map, struct m0_client *instance)
#define UT_DEFAULT_BLOCK_SIZE
M0_INTERNAL void ut_dummy_target_ioreq_delete(struct target_ioreq *ti)
M0_INTERNAL int m0_io_nw_xfer_ut_init(void)
struct m0_indexvec_varr ti_bufvec
static void dgmode_rwvec_dealloc_fini(struct dgmode_rwvec *dg)
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
static struct m0_rpc_session * target_session(struct m0_op_io *ioo, struct m0_fid tfid)
static void ut_test_nw_xfer_request_init(void)
struct m0_varr ti_pageattrs
static void ut_test_nw_xfer_req_complete(void)
void ut_layout_domain_fill(struct m0_client *cinst)
static void ut_test_target_ioreq_iofops_prepare(void)
M0_INTERNAL int m0_fid_cmp(const struct m0_fid *fid0, const struct m0_fid *fid1)
M0_INTERNAL int ut_m0_client_init(struct m0_client **instance)
struct m0_pdclust_attr pl_attr
static struct m0_pdclust_layout * dummy_pdclust_layout
static void ut_test_io_di_size(void)
M0_INTERNAL struct nw_xfer_request * ut_dummy_xfer_req_create(void)
static void ut_test_bulk_buffer_add(void)
enum m0_pool_nd_state ti_state
M0_INTERNAL int m0_bufvec_alloc(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size)
static struct target_ioreq * target_ioreq_locate(struct nw_xfer_request *xfer, struct m0_fid *fid)
static uint32_t unit_size
static void ut_test_target_ioreq_seg_add(void)
M0_INTERNAL void m0_bufvec_free(struct m0_bufvec *bufvec)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
M0_INTERNAL void ut_realm_entity_setup(struct m0_realm *realm, struct m0_entity *ent, struct m0_client *cinst)
struct nw_xfer_request ioo_nwxfer
M0_INTERNAL void m0_fid_set(struct m0_fid *fid, uint64_t container, uint64_t key)
static int target_ioreq_init(struct target_ioreq *ti, struct nw_xfer_request *xfer, const struct m0_fid *cobfid, uint64_t ta_obj, struct m0_rpc_session *session, uint64_t size)
M0_INTERNAL bool nw_xfer_request_invariant(const struct nw_xfer_request *xfer)
static int nw_xfer_tioreq_get(struct nw_xfer_request *xfer, struct m0_fid *fid, uint64_t ta_obj, struct m0_rpc_session *session, uint64_t size, struct target_ioreq **out)
M0_INTERNAL void ut_dummy_ioo_delete(struct m0_op_io *ioo, struct m0_client *instance)
M0_INTERNAL void nw_xfer_request_fini(struct nw_xfer_request *xfer)
static void ut_helper_tioreqs_hash_func(uint64_t b_nr, uint64_t key, uint64_t exp_ret)
M0_INTERNAL void ut_m0_client_fini(struct m0_client **instance)
M0_INTERNAL struct target_ioreq * ut_dummy_target_ioreq_create(void)
const struct nw_xfer_ops * nxr_ops
static void ut_test_nw_xfer_request_fini(void)
static void ut_test_tioreqs_hash_func(void)
static void ut_test_dgmode_rwvec_dealloc_fini(void)
struct m0_sm_group * sm_grp
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
M0_INTERNAL void ut_shuffle_test_order(struct m0_ut_suite *suite)
struct m0_pools_common * pv_pc
static void ut_test_irfop_fini(void)
M0_INTERNAL struct pargrp_iomap * ut_dummy_pargrp_iomap_create(struct m0_client *instance, int num_blocks)
struct m0_htable nxr_tioreqs_hash
struct m0_rpc_session * ti_session
struct m0_pool_device_to_service * pc_dev2svc
struct m0_op_common oo_oc
static struct fdmi_ctx ctx
static void ut_test_nw_xfer_tioreq_map(void)
static const struct nw_xfer_ops xfer_ops
const struct target_ioreq_ops * ti_ops
struct m0_reqh_service_ctx * pds_ctx
static struct m0_pdclust_layout * pdlayout_get(const struct io_request *req)
static int64_t m0_atomic64_get(const struct m0_atomic64 *a)
struct m0_pdclust_tgt_addr tgt
struct m0_ut_suite ut_suite_io_nw_xfer
M0_INTERNAL struct m0_pdclust_layout * ut_dummy_pdclust_layout_create(struct m0_client *instance)
M0_INTERNAL struct m0_op_io * ut_dummy_ioo_create(struct m0_client *instance, int num_io_maps)
static void ut_test_nw_xfer_req_dispatch(void)
static void ut_test_nw_xfer_tioreq_get(void)
#define M0_ALLOC_PTR(ptr)
static struct m0_realm realm
struct m0_entity * op_entity
M0_INTERNAL void ut_dummy_xfer_req_delete(struct nw_xfer_request *xfer)
enum nw_xfer_state nxr_state
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
struct m0_atomic64 nxr_iofop_nr
static void ut_test_tioreq_key_eq(void)
static struct m0 instance
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
static void ut_test_target_ioreq_init(void)
static void ut_test_target_session(void)
static void ut_helper_tioreq_key_eq(uint64_t k1, uint64_t k2, bool exp_ret)
static void ut_test_target_ioreq_locate(void)
struct nw_xfer_request * ti_nwxfer
M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid, struct m0_fid *cob_fid, uint32_t device_id)
M0_INTERNAL void m0_client_init_io_op(void)
static bool tioreq_key_eq(const void *key1, const void *key2)
void target_ioreq_fini(struct target_ioreq *ti)
struct m0_indexvec ti_goff_ivec
struct m0_bufvec ti_auxbufvec
static void ut_test_dgmode_rwvec_alloc_init(void)
static void ut_test_target_ioreq_invariant(void)
static const struct target_ioreq_ops tioreq_ops
struct m0_bufvec ioo_attr
struct m0_pdclust_src_addr src
struct dgmode_rwvec * ti_dgvec
struct m0_indexvec ti_ivec
static void target_ioreq_seg_add(struct target_ioreq *ti, const struct m0_pdclust_src_addr *src, const struct m0_pdclust_tgt_addr *tgt, m0_bindex_t gob_offset, m0_bcount_t count, struct pargrp_iomap *map)