25 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_SNSCM 44 #define DUMMY_DBNAME "dummy-db" 45 #define DUMMY_COB_ID 20 46 #define DUMMY_SERVER_ADDR "0@lo:12345:34:10" 365 for (j = 0; j <
seg_nr; ++j) {
496 aggr_grps_in_tlink_init(ag);
497 aggr_grps_out_tlink_init(ag);
741 char *confstr =
NULL;
786 colours, M0_0VEC_SHIFT,
false);
1104 #undef M0_TRACE_SUBSYSTEM static m0_bcount_t seg_size
static int sender_cm_setup(struct m0_cm *cm)
void cs_fini(struct m0_motr *sctx)
M0_INTERNAL m0_bcount_t m0_net_domain_get_max_buffer_segment_size(struct m0_net_domain *dom)
bool(* co_invariant)(const struct m0_cm_cp *cp)
M0_INTERNAL void m0_cm_cp_buf_release(struct m0_cm_cp *cp)
static struct m0_fid gob_fid
static int dummy_cp_write(struct m0_cm_cp *cp)
struct m0_net_domain rmc_net_dom
struct m0_be_domain * bs_domain
static struct m0_rpc_client_ctx cctx
M0_INTERNAL void m0_cm_lock(struct m0_cm *cm)
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL int m0_reqh_service_start(struct m0_reqh_service *service)
M0_INTERNAL int m0_bitmap_init(struct m0_bitmap *map, size_t nr)
M0_INTERNAL void m0_cm_ag_cp_del(struct m0_cm_aggr_group *ag, struct m0_cm_cp *cp)
M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid, uint32_t container, uint64_t key)
void m0_net_domain_fini(struct m0_net_domain *dom)
M0_INTERNAL void m0_ut_rpc_mach_init_and_add(struct m0_ut_rpc_mach_ctx *ctx)
int(* rso_start)(struct m0_reqh_service *service)
struct m0_net_buffer_pool * nb_pool
static uint64_t dummy_home_loc_helper(const struct m0_cm_cp *cp)
struct m0_reqh * m0_cs_reqh_get(struct m0_motr *cctx)
static void receiver_fini()
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
struct m0_sns_cm_buf_pool sc_obp
static struct m0_motr sender_motr
static const struct m0_fid M0_SNS_CM_NET_UT_PVER
M0_INTERNAL int m0_sns_cm_cp_send_wait(struct m0_cm_cp *cp)
struct m0_bitmap c_xform_cp_indices
struct m0_stob_id sc_stob_id
static void sender_init()
static const struct m0_reqh_service_ops sender_cm_service_ops
static size_t locality(const struct m0_fom *fom)
struct m0_bufvec nb_buffer
M0_INTERNAL struct m0_sns_cm * cm2sns(struct m0_cm *cm)
M0_INTERNAL void cob_delete(struct m0_cob_domain *cdom, struct m0_be_domain *bedom, uint64_t cont, const struct m0_fid *gfid)
static int sender_cm_prepare(struct m0_cm *cm)
static struct m0_sns_cm_cp s_sns_cp
static bool cp_ag_can_fini(const struct m0_cm_aggr_group *ag)
M0_INTERNAL void m0_sns_cm_acc_cp_init(struct m0_sns_cm_cp *scp, struct m0_sns_cm_ag *sag)
const struct m0_cm_ops * cm_ops
struct m0_pool_version * pm_pver
const m0_time_t M0_TIME_NEVER
M0_INTERNAL struct m0_pool_version * m0_pool_version_find(struct m0_pools_common *pc, const struct m0_fid *id)
static struct m0_reqh_context sender_rctx
M0_INTERNAL void m0_cm_aggr_group_add(struct m0_cm *cm, struct m0_cm_aggr_group *ag, bool has_incoming)
const struct m0_net_buffer_pool_ops bp_ops
struct m0_pool_version * pv
M0_INTERNAL void m0_cm_type_deregister(struct m0_cm_type *cmtype)
static struct m0_ut_rpc_mach_ctx rmach_ctx
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
static void buf_available(struct m0_net_buffer_pool *pool)
M0_INTERNAL int m0_file_read(const char *path, char **out)
M0_INTERNAL struct m0_net_buffer * m0_net_buffer_pool_get(struct m0_net_buffer_pool *pool, uint32_t colour)
M0_INTERNAL void m0_net_buffer_pool_unlock(struct m0_net_buffer_pool *pool)
static int dummy_cp_phase(struct m0_cm_cp *cp)
static struct m0_cm_aggr_group * ag_cpy
void(* cmo_stop)(struct m0_cm *cm)
M0_INTERNAL int m0_ut_stob_destroy_by_stob_id(struct m0_stob_id *stob_id)
static struct m0_cm sender_cm
const struct m0_net_buffer_pool_ops * nbp_ops
static const struct m0_cm_aggr_group_ops group_ops
uint32_t rag_acc_inuse_nr
M0_INTERNAL void m0_ios_cdom_get(struct m0_reqh *reqh, struct m0_cob_domain **out)
int m0_rpc_session_destroy(struct m0_rpc_session *session, m0_time_t abs_timeout)
M0_INTERNAL int m0_confc_init(struct m0_confc *confc, struct m0_sm_group *sm_group, const char *confd_addr, struct m0_rpc_machine *rpc_mach, const char *local_conf)
static struct m0_cm * recv_cm
static uint64_t dummy_fom_locality(const struct m0_fom *fom)
struct m0_cob_domain_id rmc_cob_id
static const char server_addr[]
struct m0_layout * sf_layout
M0_INTERNAL void m0_confc_fini(struct m0_confc *confc)
static struct m0_net_buffer_pool r_nbp
static struct m0_fom_ops read_cp_fom_ops
static void test_init(bool ag_create)
static void sender_cm_fini(struct m0_cm *cm)
struct m0_sns_cm_buf_pool sc_ibp
#define container_of(ptr, type, member)
static bool sender_cm_cp_invariant(const struct m0_cm_cp *cp)
M0_INTERNAL void m0_cm_fini(struct m0_cm *cm)
static void sender_cm_ha_msg(struct m0_cm *cm, struct m0_ha_msg *msg, int rc)
struct m0_poolmach * sf_pm
M0_INTERNAL int m0_sns_cm_buf_attach(struct m0_net_buffer_pool *bp, struct m0_cm_cp *cp)
M0_INTERNAL void m0_cm_state_set(struct m0_cm *cm, enum m0_cm_state state)
static int dummy_read_fom_tick(struct m0_fom *fom)
uint64_t(* cago_local_cp_nr)(const struct m0_cm_aggr_group *ag)
M0_INTERNAL void m0_cm_aggr_group_init(struct m0_cm_aggr_group *ag, struct m0_cm *cm, const struct m0_cm_ag_id *id, bool has_incoming, const struct m0_cm_aggr_group_ops *ag_ops)
struct m0_rpc_session * px_session
static struct m0_cm_cp * sender_cm_cp_alloc(struct m0_cm *cm)
M0_INTERNAL struct m0_reqh_service_type * m0_reqh_service_type_find(const char *sname)
static void test_cp_send_mismatch_epoch()
M0_TL_DECLARE(rpcbulk, M0_INTERNAL, struct m0_rpc_bulk_buf)
uint64_t cag_cp_global_nr
M0_INTERNAL int m0_sns_cm_cp_write_pre(struct m0_cm_cp *cp)
M0_INTERNAL void m0_cm_cp_fom_fini(struct m0_fom *fom)
static int sender_cm_data_next(struct m0_cm *cm, struct m0_cm_cp *cp)
M0_INTERNAL int m0_cm_init(struct m0_cm *cm, struct m0_cm_type *cm_type, const struct m0_cm_ops *cm_ops)
M0_INTERNAL void m0_cm_unlock(struct m0_cm *cm)
M0_INTERNAL const char * m0_rpc_conn_addr(const struct m0_rpc_conn *conn)
static struct m0_semaphore cp_sem
M0_INTERNAL void m0_cm_ag_cp_add(struct m0_cm_aggr_group *ag, struct m0_cm_cp *cp)
static struct m0_cm_proxy * sender_cm_proxy
#define DUMMY_SERVER_ADDR
static void sender_ag_create()
static struct m0_sns_cm_ag * sag
static struct m0_cm_ag_id ag_id
static int sender_cm_start(struct m0_cm *cm)
enum m0_cm_cp_io_op c_io_op
M0_INTERNAL void cob_create(struct m0_reqh *reqh, struct m0_cob_domain *cdom, struct m0_be_domain *bedom, uint64_t cont, struct m0_fid *gfid, uint32_t cob_idx)
static struct m0_rpc_conn conn
M0_INTERNAL int m0_rpc_client_connect(struct m0_rpc_conn *conn, struct m0_rpc_session *session, struct m0_rpc_machine *rpc_mach, const char *remote_addr, struct m0_fid *svc_fid, uint64_t max_rpcs_in_flight, m0_time_t abs_timeout)
struct m0_sns_cm_ag rag_base
M0_INTERNAL int m0_sns_cm_cp_recv_init(struct m0_cm_cp *cp)
static struct m0_net_buffer r_buf
struct m0_cm_proxy_in_count sag_proxy_in_count
M0_INTERNAL struct m0_confc * m0_reqh2confc(struct m0_reqh *reqh)
#define M0_FID_TINIT(type, container, key)
static int dummy_read_cp_xform(struct m0_cm_cp *cp)
static const struct socktype stype[]
static struct m0_rpc_session session
static void read_and_verify()
M0_INTERNAL void m0_fi_disable(const char *fp_func, const char *fp_tag)
const struct m0_cm_cp_ops cp_dummy_ops
int(* cmo_prepare)(struct m0_cm *cm)
static struct m0_net_domain client_net_dom
static void m0_fi_enable(const char *func, const char *tag)
static void receiver_ag_create(struct m0_cm *cm)
static struct m0_sns_cm_cp r_sns_cp
static struct m0_confc * confc
M0_INTERNAL bool m0_net_buffer_pool_prune(struct m0_net_buffer_pool *pool)
struct m0_rpc_conn * px_conn
m0_time_t m0_time_now(void)
struct m0_ut_suite snscm_net_ut
struct m0_fid fc_tgt_cobfid
M0_INTERNAL int m0_sns_cm_cp_io_wait(struct m0_cm_cp *cp)
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
M0_INTERNAL int m0_sns_cm_cp_phase_next(struct m0_cm_cp *cp)
M0_INTERNAL void m0_fid_convert_cob2stob(const struct m0_fid *cob_fid, struct m0_stob_id *stob_id)
static void cp_ag_fini(struct m0_cm_aggr_group *ag)
static void cm_cp_free(struct m0_cm_cp *cp)
M0_INTERNAL void m0_cm_cp_fini(struct m0_cm_cp *cp)
const struct m0_cm_cp_ops * c_ops
void(* nbpo_not_empty)(struct m0_net_buffer_pool *)
M0_INTERNAL void m0_cm_cp_buf_add(struct m0_cm_cp *cp, struct m0_net_buffer *nb)
int m0_rpc_conn_destroy(struct m0_rpc_conn *conn, m0_time_t abs_timeout)
static struct m0_fid cob_fid
M0_INTERNAL void m0_net_buffer_pool_lock(struct m0_net_buffer_pool *pool)
static void sender_cm_stop(struct m0_cm *cm)
int m0_rpc_client_stop(struct m0_rpc_client_ctx *cctx)
static int dummy_read_cp_phase(struct m0_cm_cp *cp)
M0_INTERNAL struct m0_cm_aggr_group * m0_cm_aggr_group_locate(struct m0_cm *cm, const struct m0_cm_ag_id *id, bool has_incoming)
struct m0_net_xprt * m0_net_xprt_default_get(void)
int m0_rpc_client_start(struct m0_rpc_client_ctx *cctx)
M0_INTERNAL bool m0_sns_cm_cp_invariant(const struct m0_cm_cp *cp)
int(* co_action[])(struct m0_cm_cp *cp)
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
void * m0_alloc(size_t size)
static struct m0_rpc_server_ctx sctx
static const char client_addr[]
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
M0_INTERNAL uint64_t m0_reqh_nr_localities(const struct m0_reqh *reqh)
struct m0_sns_cm_cp fc_tgt_acc_cp
M0_INTERNAL void m0_cm_proxy_del(struct m0_cm *cm, struct m0_cm_proxy *pxy)
M0_INTERNAL int m0_reqh_service_allocate(struct m0_reqh_service **out, const struct m0_reqh_service_type *stype, struct m0_reqh_context *rctx)
M0_INTERNAL void m0_bitmap_set(struct m0_bitmap *map, size_t idx, bool val)
void sender_service_alloc_init()
struct m0_cm_aggr_group * c_ag
static struct m0_reqh_service * sender_cm_service
M0_INTERNAL void m0_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
static void dummy_fom_fini(struct m0_fom *fom)
static void sender_cm_service_fini(struct m0_reqh_service *service)
struct m0_net_domain * rcx_net_dom
struct m0_chan cm_complete
M0_INTERNAL int m0_cm_setup(struct m0_cm *cm)
static int sender_cm_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
M0_INTERNAL void m0_chan_signal_lock(struct m0_chan *chan)
void layout_destroy(struct m0_pdclust_layout *pdlay)
M0_INTERNAL void m0_reqh_idle_wait(struct m0_reqh *reqh)
uint64_t cag_transformed_cp_nr
M0_INTERNAL int m0_ut_stob_create_by_stob_id(struct m0_stob_id *stob_id, const char *str_cfg)
static struct m0_pool pool
M0_INTERNAL struct m0_layout * m0_pdl_to_layout(struct m0_pdclust_layout *pl)
uint64_t rcx_max_rpcs_in_flight
static struct m0_semaphore sem
static void bp_below_threshold(struct m0_net_buffer_pool *bp)
static struct m0_sns_cm_repair_ag r_rag
struct m0_sns_cm_file_ctx * sag_fctx
static const struct m0_cm_cp_ops sender_cm_cp_ops
M0_INTERNAL struct m0_reqh_service * m0_reqh_service_find(const struct m0_reqh_service_type *st, const struct m0_reqh *reqh)
static int dummy_cp_init(struct m0_cm_cp *cp)
struct m0_sns_cm_repair_ag_failure_ctx * rag_fc
struct m0_cm_proxy * c_cm_proxy
static struct m0_cm_proxy * recv_cm_proxy
M0_INTERNAL int m0_sns_cm_cp_read(struct m0_cm_cp *cp)
static struct m0_fom_ops cp_fom_ops
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
int m0_net_domain_init(struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
struct m0_net_buffer_pool sb_bp
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
struct m0_cm_sw_update cm_sw_update
M0_INTERNAL int m0_sns_cm_repair_cp_send(struct m0_cm_cp *cp)
M0_INTERNAL void m0_cm_aggr_group_fini(struct m0_cm_aggr_group *ag)
static void receiver_init(void)
static struct m0_cm_cp sender_cm_cp
uint32_t sag_local_tgts_nr
static void cm_ready(struct m0_cm *cm)
static struct m0_semaphore write_cp_sem
M0_CM_TYPE_DECLARE(sender_cm, M0_CM_UT_SENDER_OPCODE, &sender_cm_service_type_ops, "sender_cm", 0)
static void sender_fini()
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL void m0_semaphore_fini(struct m0_semaphore *semaphore)
static struct m0_reqh * s0_reqh
static struct m0_semaphore read_cp_sem
int cs_init(struct m0_motr *sctx)
M0_INTERNAL void m0_cm_proxy_fini(struct m0_cm_proxy *pxy)
struct m0_reqh_service cm_service
M0_INTERNAL int m0_cm_proxy_init(struct m0_cm_proxy *proxy, uint64_t px_id, struct m0_cm_ag_id *lo, struct m0_cm_ag_id *hi, const char *endpoint)
static void fail_device(struct m0_cm *cm)
M0_INTERNAL int m0_cm_proxy_in_count_alloc(struct m0_cm_proxy_in_count *pcount, uint32_t nr_proxies)
M0_INTERNAL void m0_ut_rpc_mach_fini(struct m0_ut_rpc_mach_ctx *ctx)
const char * rcx_remote_addr
static void receiver_stob_create()
static struct m0_sns_cm_repair_ag s_rag
struct m0_cm_type sender_cm_cmt
void bv_populate(struct m0_bufvec *b, char data, uint32_t seg_nr, uint32_t seg_size)
M0_INTERNAL int m0_net_buffer_pool_provision(struct m0_net_buffer_pool *pool, uint32_t buf_nr)
static void ag_setup(struct m0_sns_cm_ag *sag, struct m0_cm *cm)
int(* cmo_setup)(struct m0_cm *cm)
static uint64_t cp_single_get(const struct m0_cm_aggr_group *ag)
M0_INTERNAL int m0_sns_cm_cp_fail(struct m0_cm_cp *cp)
int(* co_phase_next)(struct m0_cm_cp *cp)
void bv_free(struct m0_bufvec *b)
M0_INTERNAL int32_t m0_net_domain_get_max_buffer_segments(struct m0_net_domain *dom)
struct m0_be_seg * rh_beseg
struct m0_reqh_service_type ct_stype
M0_INTERNAL void m0_fom_queue(struct m0_fom *fom)
M0_INTERNAL void m0_cm_cp_init(struct m0_cm_type *cmtype, const struct m0_fom_type_ops *ft_ops)
struct m0_mutex cag_mutex
void(* fo_fini)(struct m0_fom *fom)
static void dummy_read_fom_fini(struct m0_fom *fom)
static int dummy_cp_write_io_wait(struct m0_cm_cp *cp)
struct m0_rpc_machine rcx_rpc_machine
static void test_cp_send_recv_verify()
static struct m0_sns_cm_file_ctx fctx
static struct m0_sns_cm_repair_ag rag
static struct bulkio_params * bp
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
static void buffers_verify()
M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid, struct m0_fid *cob_fid, uint32_t device_id)
int(* cmo_start)(struct m0_cm *cm)
struct m0_cm_aggr_group sag_base
void m0_fom_phase_set(struct m0_fom *fom, int phase)
static const struct m0_cm_ops sender_cm_ops
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
struct m0_pools_common cc_pools_common
static void sender_cm_service_stop(struct m0_reqh_service *service)
void layout_gen(struct m0_pdclust_layout **pdlay, struct m0_reqh *reqh)
void cp_prepare(struct m0_cm_cp *cp, struct m0_net_buffer *buf, uint32_t bv_seg_nr, uint32_t bv_seg_size, struct m0_sns_cm_ag *sns_ag, char data, struct m0_fom_ops *cp_fom_ops, struct m0_reqh *reqh, uint64_t cp_ag_idx, bool is_acc_cp, struct m0_cm *cm)
static const struct m0_reqh_service_type_ops sender_cm_service_type_ops
static int sender_cm_service_start(struct m0_reqh_service *service)
static struct m0_reqh_service * scm_service
#define m0_tl_for(name, head, obj)
M0_INTERNAL struct m0_sns_cm_repair_ag * sag2repairag(const struct m0_sns_cm_ag *sag)
M0_INTERNAL int m0_net_buffer_pool_init(struct m0_net_buffer_pool *pool, struct m0_net_domain *ndom, uint32_t threshold, uint32_t seg_nr, m0_bcount_t seg_size, uint32_t colours, unsigned shift, bool dont_dump)
static int dummy_read_cp_init(struct m0_cm_cp *cp)
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
M0_INTERNAL struct m0_motr * m0_cs_ctx_get(struct m0_reqh *reqh)
M0_INTERNAL void m0_cm_proxy_add(struct m0_cm *cm, struct m0_cm_proxy *pxy)
M0_INTERNAL struct m0_sns_cm_ag * ag2snsag(const struct m0_cm_aggr_group *ag)
static struct m0_sns_cm * recv_scm
struct m0_fid g_process_fid
static struct m0_net_buffer_pool nbp
static int sender_cm_ag_next(struct m0_cm *cm, const struct m0_cm_ag_id *id_curr, struct m0_cm_ag_id *id_next)
void pool_mach_transit(struct m0_reqh *reqh, struct m0_poolmach *pm, uint64_t fd, enum m0_pool_nd_state state)
static void dummy_cp_complete(struct m0_cm_cp *cp)
static int dummy_fom_tick(struct m0_fom *fom)
const struct m0_cm_cp_ops read_cp_ops
const struct m0_reqh_service_ops * rs_ops
#define M0_IMPOSSIBLE(fmt,...)
M0_INTERNAL int m0_cm_type_register(struct m0_cm_type *cmtype)