Motr  M0
net.c File Reference
#include <unistd.h>
#include "lib/trace.h"
#include "sns/cm/repair/ag.h"
#include "sns/cm/repair/ut/cp_common.h"
#include "ioservice/fid_convert.h"
#include "ioservice/io_service.h"
#include "rpc/rpclib.h"
#include "rpc/rpc_opcodes.h"
#include "lib/fs.h"
#include "lib/finject.h"
#include "ut/ut_rpc_machine.h"
#include "ut/stob.h"
#include "ut/misc.h"
#include "ut/ut.h"
#include "sns/cm/repair/ag.c"
#include "ha/msg.h"
Include dependency graph for net.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM
 
#define DUMMY_DBNAME   "dummy-db"
 
#define DUMMY_COB_ID   20
 
#define DUMMY_SERVER_ADDR   "0@lo:12345:34:10"
 

Enumerations

enum  {
  CLIENT_COB_DOM_ID = 44, MAX_RPCS_IN_FLIGHT = 5, STOB_UPDATE_DELAY = 1, MAX_RETRIES = 5,
  CP_SINGLE = 1, FAIL_NR = 1, BUF_NR = 4, START_DATA = 101,
  DEV_ID = 1, KEY = 1
}
 

Functions

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)
 
M0_INTERNAL void cob_delete (struct m0_cob_domain *cdom, struct m0_be_domain *bedom, uint64_t cont, const struct m0_fid *gfid)
 
M0_INTERNAL int m0_sns_cm_repair_cp_send (struct m0_cm_cp *cp)
 
static void fail_device (struct m0_cm *cm)
 
static uint64_t cp_single_get (const struct m0_cm_aggr_group *ag)
 
static void cp_ag_fini (struct m0_cm_aggr_group *ag)
 
static bool cp_ag_can_fini (const struct m0_cm_aggr_group *ag)
 
static void dummy_fom_fini (struct m0_fom *fom)
 
static uint64_t dummy_fom_locality (const struct m0_fom *fom)
 
static int dummy_fom_tick (struct m0_fom *fom)
 
static int dummy_cp_init (struct m0_cm_cp *cp)
 
static int dummy_cp_phase (struct m0_cm_cp *cp)
 
static void dummy_cp_complete (struct m0_cm_cp *cp)
 
static uint64_t dummy_home_loc_helper (const struct m0_cm_cp *cp)
 
static void cm_cp_free (struct m0_cm_cp *cp)
 
static bool sender_cm_cp_invariant (const struct m0_cm_cp *cp)
 
static int dummy_read_fom_tick (struct m0_fom *fom)
 
static void dummy_read_fom_fini (struct m0_fom *fom)
 
static int dummy_read_cp_init (struct m0_cm_cp *cp)
 
static int dummy_read_cp_phase (struct m0_cm_cp *cp)
 
static void buffers_verify ()
 
static int dummy_read_cp_xform (struct m0_cm_cp *cp)
 
static int dummy_cp_write_io_wait (struct m0_cm_cp *cp)
 
static int dummy_cp_write (struct m0_cm_cp *cp)
 
static void ag_setup (struct m0_sns_cm_ag *sag, struct m0_cm *cm)
 
static void read_and_verify ()
 
static void receiver_ag_create (struct m0_cm *cm)
 
static void receiver_stob_create ()
 
static void cm_ready (struct m0_cm *cm)
 
static void receiver_init (void)
 
static struct m0_cm_cpsender_cm_cp_alloc (struct m0_cm *cm)
 
static int sender_cm_setup (struct m0_cm *cm)
 
static int sender_cm_start (struct m0_cm *cm)
 
static void sender_cm_stop (struct m0_cm *cm)
 
static int sender_cm_data_next (struct m0_cm *cm, struct m0_cm_cp *cp)
 
static void sender_cm_fini (struct m0_cm *cm)
 
static int sender_cm_prepare (struct m0_cm *cm)
 
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)
 
static void sender_cm_ha_msg (struct m0_cm *cm, struct m0_ha_msg *msg, int rc)
 
static int sender_cm_service_start (struct m0_reqh_service *service)
 
static void sender_cm_service_stop (struct m0_reqh_service *service)
 
static void sender_cm_service_fini (struct m0_reqh_service *service)
 
static int sender_cm_service_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
 
 M0_CM_TYPE_DECLARE (sender_cm, M0_CM_UT_SENDER_OPCODE, &sender_cm_service_type_ops, "sender_cm", 0)
 
void sender_service_alloc_init ()
 
 M0_TL_DECLARE (proxy_cp, M0_EXTERN, struct m0_cm_cp)
 
static void sender_ag_create ()
 
static void bp_below_threshold (struct m0_net_buffer_pool *bp)
 
static void buf_available (struct m0_net_buffer_pool *pool)
 
static void sender_init ()
 
static void receiver_fini ()
 
static void sender_fini ()
 
static void test_fini ()
 
static void test_init (bool ag_create)
 
static void test_cp_send_mismatch_epoch ()
 
static void test_cp_send_recv_verify ()
 

Variables

static struct m0_reqhs0_reqh
 
static struct m0_cmrecv_cm
 
static struct m0_sns_cmrecv_scm
 
static struct m0_reqh_servicescm_service
 
static struct m0_cm_aggr_groupag_cpy
 
static struct m0_sns_cm_repair_ag rag
 
static struct m0_sns_cm_file_ctx fctx
 
static struct m0_sns_cm_repair_ag r_rag
 
static struct m0_sns_cm_cp r_sns_cp
 
static struct m0_net_buffer r_buf
 
static struct m0_net_buffer_pool r_nbp
 
static struct m0_net_domain client_net_dom
 
static struct m0_semaphore sem
 
static struct m0_semaphore cp_sem
 
static struct m0_semaphore read_cp_sem
 
static struct m0_semaphore write_cp_sem
 
static const char client_addr [] = "0@lo:12345:34:2"
 
static const char server_addr [] = "0@lo:12345:34:1"
 
static struct m0_rpc_client_ctx cctx
 
struct m0_cm_type sender_cm_cmt
 
static struct m0_ut_rpc_mach_ctx rmach_ctx
 
static struct m0_cm sender_cm
 
static struct m0_reqh_servicesender_cm_service
 
static struct m0_cm_cp sender_cm_cp
 
static struct m0_motr sender_motr = { .cc_pool_width = 10 }
 
static struct m0_reqh_context sender_rctx = { .rc_motr = &sender_motr }
 
static struct m0_sns_cm_repair_ag s_rag
 
static struct m0_sns_cm_cp s_sns_cp
 
static struct m0_net_buffer_pool nbp
 
static struct m0_cm_proxysender_cm_proxy
 
static struct m0_cm_proxyrecv_cm_proxy
 
static struct m0_rpc_conn conn
 
static struct m0_rpc_session session
 
static struct m0_fid gob_fid
 
static struct m0_fid cob_fid
 
static m0_bcount_t seg_size
 
static uint32_t seg_nr
 
static struct m0_cm_ag_id ag_id
 
static const struct m0_fid M0_SNS_CM_NET_UT_PVER = M0_FID_TINIT('v', 1, 8)
 
static const struct m0_cm_aggr_group_ops group_ops
 
static struct m0_fom_ops cp_fom_ops
 
static const struct m0_cm_cp_ops sender_cm_cp_ops
 
const struct m0_cm_cp_ops cp_dummy_ops
 
static struct m0_fom_ops read_cp_fom_ops
 
const struct m0_cm_cp_ops read_cp_ops
 
static const struct m0_cm_ops sender_cm_ops
 
static const struct m0_reqh_service_ops sender_cm_service_ops
 
static const struct m0_reqh_service_type_ops sender_cm_service_type_ops
 
const struct m0_net_buffer_pool_ops bp_ops
 
struct m0_ut_suite snscm_net_ut
 

Macro Definition Documentation

◆ DUMMY_COB_ID

#define DUMMY_COB_ID   20

Definition at line 45 of file net.c.

◆ DUMMY_DBNAME

#define DUMMY_DBNAME   "dummy-db"

Definition at line 44 of file net.c.

◆ DUMMY_SERVER_ADDR

#define DUMMY_SERVER_ADDR   "0@lo:12345:34:10"

Definition at line 46 of file net.c.

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM

Definition at line 25 of file net.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CLIENT_COB_DOM_ID 
MAX_RPCS_IN_FLIGHT 
STOB_UPDATE_DELAY 
MAX_RETRIES 
CP_SINGLE 
FAIL_NR 
BUF_NR 
START_DATA 
DEV_ID 
KEY 

Definition at line 67 of file net.c.

Function Documentation

◆ ag_setup()

static void ag_setup ( struct m0_sns_cm_ag sag,
struct m0_cm cm 
)
static

Definition at line 429 of file net.c.

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

◆ bp_below_threshold()

static void bp_below_threshold ( struct m0_net_buffer_pool bp)
static

Definition at line 722 of file net.c.

◆ buf_available()

static void buf_available ( struct m0_net_buffer_pool pool)
static

Definition at line 726 of file net.c.

◆ buffers_verify()

static void buffers_verify ( )
static

Definition at line 354 of file net.c.

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

◆ cm_cp_free()

static void cm_cp_free ( struct m0_cm_cp cp)
static

Definition at line 265 of file net.c.

Here is the call graph for this function:

◆ cm_ready()

static void cm_ready ( struct m0_cm cm)
static

Definition at line 540 of file net.c.

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

◆ cob_create()

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 
)

Definition at line 176 of file cm.c.

Here is the caller graph for this function:

◆ cob_delete()

M0_INTERNAL void cob_delete ( struct m0_cob_domain cdom,
struct m0_be_domain bedom,
uint64_t  cont,
const struct m0_fid gfid 
)

Definition at line 231 of file cm.c.

Here is the caller graph for this function:

◆ cp_ag_can_fini()

static bool cp_ag_can_fini ( const struct m0_cm_aggr_group ag)
static

Definition at line 171 of file net.c.

Here is the call graph for this function:

◆ cp_ag_fini()

static void cp_ag_fini ( struct m0_cm_aggr_group ag)
static

Definition at line 163 of file net.c.

Here is the call graph for this function:

◆ cp_single_get()

static uint64_t cp_single_get ( const struct m0_cm_aggr_group ag)
static

Definition at line 158 of file net.c.

◆ dummy_cp_complete()

static void dummy_cp_complete ( struct m0_cm_cp cp)
static

Definition at line 256 of file net.c.

◆ dummy_cp_init()

static int dummy_cp_init ( struct m0_cm_cp cp)
static

Definition at line 242 of file net.c.

Here is the call graph for this function:

◆ dummy_cp_phase()

static int dummy_cp_phase ( struct m0_cm_cp cp)
static

Definition at line 250 of file net.c.

◆ dummy_cp_write()

static int dummy_cp_write ( struct m0_cm_cp cp)
static

Definition at line 399 of file net.c.

◆ dummy_cp_write_io_wait()

static int dummy_cp_write_io_wait ( struct m0_cm_cp cp)
static

Definition at line 387 of file net.c.

Here is the call graph for this function:

◆ dummy_fom_fini()

static void dummy_fom_fini ( struct m0_fom fom)
static

Definition at line 197 of file net.c.

Here is the call graph for this function:

◆ dummy_fom_locality()

static uint64_t dummy_fom_locality ( const struct m0_fom fom)
static

Definition at line 204 of file net.c.

◆ dummy_fom_tick()

static int dummy_fom_tick ( struct m0_fom fom)
static

Definition at line 210 of file net.c.

Here is the call graph for this function:

◆ dummy_home_loc_helper()

static uint64_t dummy_home_loc_helper ( const struct m0_cm_cp cp)
static

Definition at line 260 of file net.c.

◆ dummy_read_cp_init()

static int dummy_read_cp_init ( struct m0_cm_cp cp)
static

Definition at line 338 of file net.c.

Here is the call graph for this function:

◆ dummy_read_cp_phase()

static int dummy_read_cp_phase ( struct m0_cm_cp cp)
static

Definition at line 346 of file net.c.

Here is the call graph for this function:

◆ dummy_read_cp_xform()

static int dummy_read_cp_xform ( struct m0_cm_cp cp)
static

Definition at line 376 of file net.c.

Here is the call graph for this function:

◆ dummy_read_fom_fini()

static void dummy_read_fom_fini ( struct m0_fom fom)
static

Definition at line 317 of file net.c.

Here is the call graph for this function:

◆ dummy_read_fom_tick()

static int dummy_read_fom_tick ( struct m0_fom fom)
static

Definition at line 310 of file net.c.

◆ fail_device()

static void fail_device ( struct m0_cm cm)
static

Definition at line 144 of file net.c.

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

◆ M0_CM_TYPE_DECLARE()

M0_CM_TYPE_DECLARE ( sender_cm  ,
M0_CM_UT_SENDER_OPCODE  ,
sender_cm_service_type_ops,
"sender_cm"  ,
 
)

◆ M0_TL_DECLARE()

M0_TL_DECLARE ( proxy_cp  ,
M0_EXTERN  ,
struct m0_cm_cp   
)

◆ read_and_verify()

static void read_and_verify ( )
static

Definition at line 447 of file net.c.

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

◆ receiver_ag_create()

static void receiver_ag_create ( struct m0_cm cm)
static

Definition at line 480 of file net.c.

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

◆ receiver_fini()

static void receiver_fini ( )
static

Definition at line 822 of file net.c.

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

◆ receiver_init()

static void receiver_init ( void  )
static

Definition at line 547 of file net.c.

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

◆ receiver_stob_create()

static void receiver_stob_create ( )
static

Definition at line 522 of file net.c.

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

◆ sender_ag_create()

static void sender_ag_create ( )
static

Definition at line 708 of file net.c.

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

◆ sender_cm_ag_next()

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 
)
static

Definition at line 627 of file net.c.

◆ sender_cm_cp_alloc()

static struct m0_cm_cp* sender_cm_cp_alloc ( struct m0_cm cm)
static

Definition at line 593 of file net.c.

◆ sender_cm_cp_invariant()

static bool sender_cm_cp_invariant ( const struct m0_cm_cp cp)
static

Definition at line 275 of file net.c.

◆ sender_cm_data_next()

static int sender_cm_data_next ( struct m0_cm cm,
struct m0_cm_cp cp 
)
static

Definition at line 613 of file net.c.

◆ sender_cm_fini()

static void sender_cm_fini ( struct m0_cm cm)
static

Definition at line 618 of file net.c.

◆ sender_cm_ha_msg()

static void sender_cm_ha_msg ( struct m0_cm cm,
struct m0_ha_msg msg,
int  rc 
)
static

Definition at line 634 of file net.c.

◆ sender_cm_prepare()

static int sender_cm_prepare ( struct m0_cm cm)
static

Definition at line 622 of file net.c.

◆ sender_cm_service_allocate()

static int sender_cm_service_allocate ( struct m0_reqh_service **  service,
const struct m0_reqh_service_type stype 
)
static

Definition at line 674 of file net.c.

Here is the call graph for this function:

◆ sender_cm_service_fini()

static void sender_cm_service_fini ( struct m0_reqh_service service)
static

Definition at line 662 of file net.c.

◆ sender_cm_service_start()

static int sender_cm_service_start ( struct m0_reqh_service service)
static

Definition at line 651 of file net.c.

Here is the call graph for this function:

◆ sender_cm_service_stop()

static void sender_cm_service_stop ( struct m0_reqh_service service)
static

Definition at line 656 of file net.c.

Here is the call graph for this function:

◆ sender_cm_setup()

static int sender_cm_setup ( struct m0_cm cm)
static

Definition at line 599 of file net.c.

◆ sender_cm_start()

static int sender_cm_start ( struct m0_cm cm)
static

Definition at line 604 of file net.c.

◆ sender_cm_stop()

static void sender_cm_stop ( struct m0_cm cm)
static

Definition at line 609 of file net.c.

◆ sender_fini()

static void sender_fini ( )
static

Definition at line 845 of file net.c.

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

◆ sender_init()

static void sender_init ( )
static

Definition at line 735 of file net.c.

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

◆ sender_service_alloc_init()

void sender_service_alloc_init ( )

Definition at line 694 of file net.c.

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

◆ test_cp_send_mismatch_epoch()

static void test_cp_send_mismatch_epoch ( )
static

Definition at line 920 of file net.c.

Here is the call graph for this function:

◆ test_cp_send_recv_verify()

static void test_cp_send_recv_verify ( )
static

Definition at line 1003 of file net.c.

Here is the call graph for this function:

◆ test_fini()

static void test_fini ( void  )
static

Definition at line 879 of file net.c.

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

◆ test_init()

static void test_init ( bool  ag_create)
static

Definition at line 887 of file net.c.

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

Variable Documentation

◆ ag_cpy

struct m0_cm_aggr_group* ag_cpy
static

Definition at line 53 of file net.c.

◆ ag_id

struct m0_cm_ag_id ag_id
static
Initial value:
= {
.ai_hi = {
.u_hi = DEV_ID,
.u_lo = KEY
},
.ai_lo = {
.u_hi = 0,
.u_lo = 1
}
}
Definition: net.c:76
Definition: net.c:77

Definition at line 121 of file net.c.

◆ bp_ops

const struct m0_net_buffer_pool_ops bp_ops
Initial value:
= {
.nbpo_not_empty = buf_available,
.nbpo_below_threshold = bp_below_threshold
}
static void buf_available(struct m0_net_buffer_pool *pool)
Definition: net.c:726
static void bp_below_threshold(struct m0_net_buffer_pool *bp)
Definition: net.c:722

Definition at line 730 of file net.c.

◆ cctx

struct m0_rpc_client_ctx cctx
static
Initial value:
= {
.rcx_net_dom = &client_net_dom,
.rcx_local_addr = client_addr,
.rcx_remote_addr = server_addr,
.rcx_max_rpcs_in_flight = MAX_RPCS_IN_FLIGHT,
.rcx_fid = &g_process_fid,
}
static const char server_addr[]
Definition: net.c:87
static struct m0_net_domain client_net_dom
Definition: net.c:80
static const char client_addr[]
Definition: net.c:86
struct m0_fid g_process_fid
Definition: ut.c:689

Definition at line 89 of file net.c.

◆ client_addr

const char client_addr[] = "0@lo:12345:34:2"
static

Definition at line 86 of file net.c.

◆ client_net_dom

struct m0_net_domain client_net_dom
static

Definition at line 80 of file net.c.

◆ cob_fid

struct m0_fid cob_fid
static

Definition at line 116 of file net.c.

◆ conn

struct m0_rpc_conn conn
static

Definition at line 112 of file net.c.

◆ cp_dummy_ops

const struct m0_cm_cp_ops cp_dummy_ops
Initial value:
= {
.co_action = {
},
.co_action_nr = M0_CCP_NR,
.co_phase_next = &m0_sns_cm_cp_phase_next,
.co_invariant = &m0_sns_cm_cp_invariant,
.co_complete = &dummy_cp_complete,
.co_free = &cm_cp_free,
.co_home_loc_helper = &dummy_home_loc_helper
}
static uint64_t dummy_home_loc_helper(const struct m0_cm_cp *cp)
Definition: net.c:260
M0_INTERNAL int m0_sns_cm_cp_send_wait(struct m0_cm_cp *cp)
Definition: net.c:297
static int dummy_cp_phase(struct m0_cm_cp *cp)
Definition: net.c:250
M0_INTERNAL int m0_sns_cm_cp_write_pre(struct m0_cm_cp *cp)
Definition: storage.c:330
Definition: cp.h:151
M0_INTERNAL int m0_sns_cm_cp_phase_next(struct m0_cm_cp *cp)
Definition: cp.c:261
static void cm_cp_free(struct m0_cm_cp *cp)
Definition: net.c:265
M0_INTERNAL bool m0_sns_cm_cp_invariant(const struct m0_cm_cp *cp)
Definition: cp.c:62
static int dummy_cp_init(struct m0_cm_cp *cp)
Definition: net.c:242
M0_INTERNAL int m0_sns_cm_repair_cp_send(struct m0_cm_cp *cp)
Definition: net.c:37
M0_INTERNAL int m0_sns_cm_cp_fail(struct m0_cm_cp *cp)
Definition: cp.c:216
static void dummy_cp_complete(struct m0_cm_cp *cp)
Definition: net.c:256

Definition at line 285 of file net.c.

◆ cp_fom_ops

struct m0_fom_ops cp_fom_ops
static
Initial value:
= {
.fo_fini = dummy_fom_fini,
.fo_tick = dummy_fom_tick,
.fo_home_locality = dummy_fom_locality,
}
static uint64_t dummy_fom_locality(const struct m0_fom *fom)
Definition: net.c:204
static void dummy_fom_fini(struct m0_fom *fom)
Definition: net.c:197
static int dummy_fom_tick(struct m0_fom *fom)
Definition: net.c:210

Definition at line 235 of file net.c.

◆ cp_sem

struct m0_semaphore cp_sem
static

Definition at line 82 of file net.c.

◆ fctx

struct m0_sns_cm_file_ctx fctx
static

Definition at line 55 of file net.c.

◆ gob_fid

struct m0_fid gob_fid
static

Definition at line 115 of file net.c.

◆ group_ops

const struct m0_cm_aggr_group_ops group_ops
static
Initial value:
= {
.cago_local_cp_nr = &cp_single_get,
.cago_fini = &cp_ag_fini,
.cago_ag_can_fini = &cp_ag_can_fini
}
static bool cp_ag_can_fini(const struct m0_cm_aggr_group *ag)
Definition: net.c:171
static void cp_ag_fini(struct m0_cm_aggr_group *ag)
Definition: net.c:163
static uint64_t cp_single_get(const struct m0_cm_aggr_group *ag)
Definition: net.c:158

Definition at line 190 of file net.c.

◆ M0_SNS_CM_NET_UT_PVER

const struct m0_fid M0_SNS_CM_NET_UT_PVER = M0_FID_TINIT('v', 1, 8)
static

Definition at line 132 of file net.c.

◆ nbp

struct m0_net_buffer_pool nbp
static

Definition at line 109 of file net.c.

◆ r_buf

struct m0_net_buffer r_buf
static

Definition at line 63 of file net.c.

◆ r_nbp

struct m0_net_buffer_pool r_nbp
static

Definition at line 64 of file net.c.

◆ r_rag

struct m0_sns_cm_repair_ag r_rag
static

Definition at line 61 of file net.c.

◆ r_sns_cp

struct m0_sns_cm_cp r_sns_cp
static

Definition at line 62 of file net.c.

◆ rag

struct m0_sns_cm_repair_ag rag
static

Definition at line 54 of file net.c.

◆ read_cp_fom_ops

struct m0_fom_ops read_cp_fom_ops
static
Initial value:
= {
.fo_fini = dummy_read_fom_fini,
.fo_tick = dummy_read_fom_tick,
.fo_home_locality = dummy_fom_locality,
}
static uint64_t dummy_fom_locality(const struct m0_fom *fom)
Definition: net.c:204
static int dummy_read_fom_tick(struct m0_fom *fom)
Definition: net.c:310
static void dummy_read_fom_fini(struct m0_fom *fom)
Definition: net.c:317

Definition at line 327 of file net.c.

◆ read_cp_ops

const struct m0_cm_cp_ops read_cp_ops
Initial value:
= {
.co_action = {
},
.co_action_nr = M0_CCP_NR,
.co_phase_next = &m0_sns_cm_cp_phase_next,
.co_invariant = &m0_sns_cm_cp_invariant,
.co_complete = &dummy_cp_complete,
.co_free = &cm_cp_free
}
static int dummy_cp_write(struct m0_cm_cp *cp)
Definition: net.c:399
M0_INTERNAL int m0_sns_cm_cp_write_pre(struct m0_cm_cp *cp)
Definition: storage.c:330
Definition: cp.h:151
static int dummy_read_cp_xform(struct m0_cm_cp *cp)
Definition: net.c:376
M0_INTERNAL int m0_sns_cm_cp_phase_next(struct m0_cm_cp *cp)
Definition: cp.c:261
static void cm_cp_free(struct m0_cm_cp *cp)
Definition: net.c:265
static int dummy_read_cp_phase(struct m0_cm_cp *cp)
Definition: net.c:346
M0_INTERNAL bool m0_sns_cm_cp_invariant(const struct m0_cm_cp *cp)
Definition: cp.c:62
M0_INTERNAL int m0_sns_cm_cp_read(struct m0_cm_cp *cp)
Definition: storage.c:324
M0_INTERNAL int m0_sns_cm_cp_fail(struct m0_cm_cp *cp)
Definition: cp.c:216
static int dummy_cp_write_io_wait(struct m0_cm_cp *cp)
Definition: net.c:387
static int dummy_read_cp_init(struct m0_cm_cp *cp)
Definition: net.c:338
static void dummy_cp_complete(struct m0_cm_cp *cp)
Definition: net.c:256

Definition at line 406 of file net.c.

◆ read_cp_sem

struct m0_semaphore read_cp_sem
static

Definition at line 83 of file net.c.

◆ recv_cm

struct m0_cm* recv_cm
static

Definition at line 50 of file net.c.

◆ recv_cm_proxy

struct m0_cm_proxy* recv_cm_proxy
static

Definition at line 111 of file net.c.

◆ recv_scm

struct m0_sns_cm* recv_scm
static

Definition at line 51 of file net.c.

◆ rmach_ctx

struct m0_ut_rpc_mach_ctx rmach_ctx
static

Definition at line 99 of file net.c.

◆ s0_reqh

struct m0_reqh* s0_reqh
static

Definition at line 49 of file net.c.

◆ s_rag

struct m0_sns_cm_repair_ag s_rag
static

Definition at line 107 of file net.c.

◆ s_sns_cp

struct m0_sns_cm_cp s_sns_cp
static

Definition at line 108 of file net.c.

◆ scm_service

struct m0_reqh_service* scm_service
static

Definition at line 52 of file net.c.

◆ seg_nr

uint32_t seg_nr
static

Definition at line 119 of file net.c.

◆ seg_size

m0_bcount_t seg_size
static

Definition at line 118 of file net.c.

◆ sem

struct m0_semaphore sem
static

Definition at line 81 of file net.c.

◆ sender_cm

struct m0_cm sender_cm
static

Definition at line 100 of file net.c.

◆ sender_cm_cmt

struct m0_cm_type sender_cm_cmt

◆ sender_cm_cp

struct m0_cm_cp sender_cm_cp
static

Definition at line 102 of file net.c.

◆ sender_cm_cp_ops

const struct m0_cm_cp_ops sender_cm_cp_ops
static
Initial value:
= {
.co_invariant = sender_cm_cp_invariant,
.co_free = cm_cp_free
}
static bool sender_cm_cp_invariant(const struct m0_cm_cp *cp)
Definition: net.c:275
static void cm_cp_free(struct m0_cm_cp *cp)
Definition: net.c:265

Definition at line 280 of file net.c.

◆ sender_cm_ops

const struct m0_cm_ops sender_cm_ops
static
Initial value:
= {
.cmo_setup = sender_cm_setup,
.cmo_prepare = sender_cm_prepare,
.cmo_start = sender_cm_start,
.cmo_stop = sender_cm_stop,
.cmo_cp_alloc = sender_cm_cp_alloc,
.cmo_data_next = sender_cm_data_next,
.cmo_ag_next = sender_cm_ag_next,
.cmo_ha_msg = sender_cm_ha_msg,
.cmo_fini = sender_cm_fini
}
static int sender_cm_setup(struct m0_cm *cm)
Definition: net.c:599
static int sender_cm_prepare(struct m0_cm *cm)
Definition: net.c:622
static void sender_cm_fini(struct m0_cm *cm)
Definition: net.c:618
static void sender_cm_ha_msg(struct m0_cm *cm, struct m0_ha_msg *msg, int rc)
Definition: net.c:634
static struct m0_cm_cp * sender_cm_cp_alloc(struct m0_cm *cm)
Definition: net.c:593
static int sender_cm_data_next(struct m0_cm *cm, struct m0_cm_cp *cp)
Definition: net.c:613
static int sender_cm_start(struct m0_cm *cm)
Definition: net.c:604
static void sender_cm_stop(struct m0_cm *cm)
Definition: net.c:609
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)
Definition: net.c:627

Definition at line 639 of file net.c.

◆ sender_cm_proxy

struct m0_cm_proxy* sender_cm_proxy
static

Definition at line 110 of file net.c.

◆ sender_cm_service

struct m0_reqh_service* sender_cm_service
static

Definition at line 101 of file net.c.

◆ sender_cm_service_ops

const struct m0_reqh_service_ops sender_cm_service_ops
static
Initial value:
= {
}
static void sender_cm_service_fini(struct m0_reqh_service *service)
Definition: net.c:662
static void sender_cm_service_stop(struct m0_reqh_service *service)
Definition: net.c:656
static int sender_cm_service_start(struct m0_reqh_service *service)
Definition: net.c:651

Definition at line 668 of file net.c.

◆ sender_cm_service_type_ops

const struct m0_reqh_service_type_ops sender_cm_service_type_ops
static
Initial value:
= {
.rsto_service_allocate = sender_cm_service_allocate
}
static int sender_cm_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition: net.c:674

Definition at line 687 of file net.c.

◆ sender_motr

struct m0_motr sender_motr = { .cc_pool_width = 10 }
static

Definition at line 103 of file net.c.

◆ sender_rctx

struct m0_reqh_context sender_rctx = { .rc_motr = &sender_motr }
static

Definition at line 104 of file net.c.

◆ server_addr

const char server_addr[] = "0@lo:12345:34:1"
static

Definition at line 87 of file net.c.

◆ session

struct m0_rpc_session session
static

Definition at line 113 of file net.c.

◆ snscm_net_ut

struct m0_ut_suite snscm_net_ut
Initial value:
= {
.ts_name = "snscm_net-ut",
.ts_tests = {
{ "cp-send-recv-verify", test_cp_send_recv_verify },
{ "cp-send-mismatched-epoch", test_cp_send_mismatch_epoch },
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static void test_cp_send_mismatch_epoch()
Definition: net.c:920
static void test_cp_send_recv_verify()
Definition: net.c:1003

Definition at line 1095 of file net.c.

◆ write_cp_sem

struct m0_semaphore write_cp_sem
static

Definition at line 84 of file net.c.