Motr  M0
RPC link

Data Structures

struct  rpc_link_state_transition
 
struct  m0_rpc_link
 

Macros

#define CONN_STATE(conn)   ((conn)->c_sm.sm_state)
 
#define CONN_RC(conn)   ((conn)->c_sm.sm_rc)
 
#define CONN_CHAN(conn)   ((conn)->c_sm.sm_chan)
 
#define SESS_STATE(sess)   ((sess)->s_sm.sm_state)
 
#define SESS_RC(sess)   ((sess)->s_sm.sm_rc)
 
#define SESS_CHAN(sess)   ((sess)->s_sm.sm_chan)
 

Typedefs

typedef void(* rpc_link_cb_t) (struct m0_rpc_link *, m0_time_t, struct m0_clink *)
 

Enumerations

enum  m0_rpc_link_states {
  M0_RLS_INIT = M0_FOM_PHASE_INIT, M0_RLS_FINI = M0_FOM_PHASE_FINISH, M0_RLS_CONN_FAILURE, M0_RLS_SESS_FAILURE,
  M0_RLS_CONN_CONNECTING, M0_RLS_SESS_ESTABLISHING, M0_RLS_SESS_WAIT_IDLE, M0_RLS_SESS_TERMINATING,
  M0_RLS_CONN_TERMINATING
}
 

Functions

static int rpc_link_conn_fom_tick (struct m0_fom *fom)
 
static void rpc_link_conn_fom_fini (struct m0_fom *fom)
 
static int rpc_link_disc_fom_tick (struct m0_fom *fom)
 
static void rpc_link_disc_fom_fini (struct m0_fom *fom)
 
static size_t rpc_link_fom_locality (const struct m0_fom *fom)
 
static void rpc_link_conn_fom_wait_on (struct m0_fom *fom, struct m0_rpc_link *rlink)
 
static int rpc_link_conn_establish (struct m0_rpc_link *rlink)
 
static int rpc_link_sess_establish (struct m0_rpc_link *rlink)
 
static int rpc_link_sess_established (struct m0_rpc_link *rlink)
 
static int rpc_link_disc_init (struct m0_rpc_link *rlink)
 
static int rpc_link_conn_terminate (struct m0_rpc_link *rlink)
 
static int rpc_link_conn_terminated (struct m0_rpc_link *rlink)
 
static int rpc_link_sess_terminate (struct m0_rpc_link *rlink)
 
static void rpc_link_sess_cleanup (struct m0_rpc_link *rlink)
 
static int rpc_link_conn_failure (struct m0_rpc_link *rlink)
 
static int rpc_link_sess_failure (struct m0_rpc_link *rlink)
 
static void rpc_link_sess_fom_wait_on (struct m0_fom *fom, struct m0_rpc_link *rlink)
 
static void rpc_link_fom_fini_common (struct m0_fom *fom, bool connected)
 
M0_INTERNAL int m0_rpc_link_module_init (void)
 
M0_INTERNAL void m0_rpc_link_module_fini (void)
 
M0_INTERNAL int m0_rpc_link_init (struct m0_rpc_link *rlink, struct m0_rpc_machine *mach, struct m0_fid *svc_fid, const char *ep, uint64_t max_rpcs_in_flight)
 
M0_INTERNAL void m0_rpc_link_fini (struct m0_rpc_link *rlink)
 
M0_INTERNAL void m0_rpc_link_reset (struct m0_rpc_link *rlink)
 
static void rpc_link_fom_queue (struct m0_rpc_link *rlink, struct m0_clink *wait_clink, const struct m0_fom_type *fom_type, const struct m0_fom_ops *fom_ops)
 
static int rpc_link_call_sync (struct m0_rpc_link *rlink, m0_time_t abs_timeout, rpc_link_cb_t cb)
 
M0_INTERNAL void m0_rpc_link_connect_async (struct m0_rpc_link *rlink, m0_time_t abs_timeout, struct m0_clink *wait_clink)
 
M0_INTERNAL int m0_rpc_link_connect_sync (struct m0_rpc_link *rlink, m0_time_t abs_timeout)
 
M0_INTERNAL void m0_rpc_link_disconnect_async (struct m0_rpc_link *rlink, m0_time_t abs_timeout, struct m0_clink *wait_clink)
 
M0_INTERNAL int m0_rpc_link_disconnect_sync (struct m0_rpc_link *rlink, m0_time_t abs_timeout)
 
M0_INTERNAL bool m0_rpc_link_is_connected (const struct m0_rpc_link *rlink)
 
M0_INTERNAL const char * m0_rpc_link_end_point (const struct m0_rpc_link *rlink)
 

Variables

struct m0_fom_type rpc_link_conn_fom_type
 
struct m0_fom_type rpc_link_disc_fom_type
 
const struct m0_fom_ops rpc_link_conn_fom_ops
 
const struct m0_fom_ops rpc_link_disc_fom_ops
 
static const struct m0_fom_type_ops rpc_link_conn_fom_type_ops
 
static const struct m0_fom_type_ops rpc_link_disc_fom_type_ops
 
static struct rpc_link_state_transition rpc_link_conn_states []
 
static struct rpc_link_state_transition rpc_link_disc_states []
 
static struct m0_sm_state_descr rpc_link_conn_state_descr []
 
static const struct m0_sm_conf rpc_link_conn_sm_conf
 
static struct m0_sm_state_descr rpc_link_disc_state_descr []
 
static const struct m0_sm_conf rpc_link_disc_sm_conf
 
struct m0_reqh_service_type m0_rpc_service_type
 

Detailed Description

Macro Definition Documentation

◆ CONN_CHAN

#define CONN_CHAN (   conn)    ((conn)->c_sm.sm_chan)

Definition at line 49 of file link.c.

◆ CONN_RC

#define CONN_RC (   conn)    ((conn)->c_sm.sm_rc)

Definition at line 48 of file link.c.

◆ CONN_STATE

#define CONN_STATE (   conn)    ((conn)->c_sm.sm_state)

Definition at line 47 of file link.c.

◆ SESS_CHAN

#define SESS_CHAN (   sess)    ((sess)->s_sm.sm_chan)

Definition at line 53 of file link.c.

◆ SESS_RC

#define SESS_RC (   sess)    ((sess)->s_sm.sm_rc)

Definition at line 52 of file link.c.

◆ SESS_STATE

#define SESS_STATE (   sess)    ((sess)->s_sm.sm_state)

Definition at line 51 of file link.c.

Typedef Documentation

◆ rpc_link_cb_t

typedef void(* rpc_link_cb_t) (struct m0_rpc_link *, m0_time_t, struct m0_clink *)

Definition at line 64 of file link.c.

Enumeration Type Documentation

◆ m0_rpc_link_states

Enumerator
M0_RLS_INIT 
M0_RLS_FINI 
M0_RLS_CONN_FAILURE 
M0_RLS_SESS_FAILURE 
M0_RLS_CONN_CONNECTING 
M0_RLS_SESS_ESTABLISHING 
M0_RLS_SESS_WAIT_IDLE 
M0_RLS_SESS_TERMINATING 
M0_RLS_CONN_TERMINATING 

Definition at line 58 of file link.h.

Function Documentation

◆ m0_rpc_link_connect_async()

M0_INTERNAL void m0_rpc_link_connect_async ( struct m0_rpc_link rlink,
m0_time_t  abs_timeout,
struct m0_clink wait_clink 
)

Makes asynchronous rpc_conn and rpc_session establishing.

Parameters
wait_clinkIf not NULL, signalled when session is established. Must be 'oneshot'.

Definition at line 710 of file link.c.

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

◆ m0_rpc_link_connect_sync()

M0_INTERNAL int m0_rpc_link_connect_sync ( struct m0_rpc_link rlink,
m0_time_t  abs_timeout 
)

Definition at line 723 of file link.c.

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

◆ m0_rpc_link_disconnect_async()

M0_INTERNAL void m0_rpc_link_disconnect_async ( struct m0_rpc_link rlink,
m0_time_t  abs_timeout,
struct m0_clink wait_clink 
)

Makes asynchronous rpc_session and rpc_conn termination.

Parameters
wait_clinkIf not NULL, signalled when connection is terminated. Must be 'oneshot'.

Definition at line 730 of file link.c.

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

◆ m0_rpc_link_disconnect_sync()

M0_INTERNAL int m0_rpc_link_disconnect_sync ( struct m0_rpc_link rlink,
m0_time_t  abs_timeout 
)

Definition at line 743 of file link.c.

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

◆ m0_rpc_link_end_point()

M0_INTERNAL const char * m0_rpc_link_end_point ( const struct m0_rpc_link rlink)

Definition at line 755 of file link.c.

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

◆ m0_rpc_link_fini()

M0_INTERNAL void m0_rpc_link_fini ( struct m0_rpc_link rlink)

Definition at line 637 of file link.c.

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

◆ m0_rpc_link_init()

M0_INTERNAL int m0_rpc_link_init ( struct m0_rpc_link rlink,
struct m0_rpc_machine mach,
struct m0_fid svc_fid,
const char *  ep,
uint64_t  max_rpcs_in_flight 
)

Initialises an rpc_link object.

Parameters
rlinkRpc link object that encapsulates rpc_conn and rpc_session.
epEnd point.
timeoutTimeout for connection/session establishment/termination.

Definition at line 605 of file link.c.

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

◆ m0_rpc_link_is_connected()

M0_INTERNAL bool m0_rpc_link_is_connected ( const struct m0_rpc_link rlink)

Definition at line 750 of file link.c.

Here is the caller graph for this function:

◆ m0_rpc_link_module_fini()

M0_INTERNAL void m0_rpc_link_module_fini ( void  )

Definition at line 601 of file link.c.

Here is the caller graph for this function:

◆ m0_rpc_link_module_init()

M0_INTERNAL int m0_rpc_link_module_init ( void  )

Definition at line 590 of file link.c.

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

◆ m0_rpc_link_reset()

M0_INTERNAL void m0_rpc_link_reset ( struct m0_rpc_link rlink)

Definition at line 653 of file link.c.

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

◆ rpc_link_call_sync()

static int rpc_link_call_sync ( struct m0_rpc_link rlink,
m0_time_t  abs_timeout,
rpc_link_cb_t  cb 
)
static

Definition at line 693 of file link.c.

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

◆ rpc_link_conn_establish()

static int rpc_link_conn_establish ( struct m0_rpc_link rlink)
static

Definition at line 105 of file link.c.

Here is the call graph for this function:

◆ rpc_link_conn_failure()

static int rpc_link_conn_failure ( struct m0_rpc_link rlink)
static

Definition at line 192 of file link.c.

Here is the call graph for this function:

◆ rpc_link_conn_fom_fini()

static void rpc_link_conn_fom_fini ( struct m0_fom fom)
static

Definition at line 480 of file link.c.

Here is the call graph for this function:

◆ rpc_link_conn_fom_tick()

static int rpc_link_conn_fom_tick ( struct m0_fom fom)
static

Definition at line 277 of file link.c.

Here is the call graph for this function:

◆ rpc_link_conn_fom_wait_on()

static void rpc_link_conn_fom_wait_on ( struct m0_fom fom,
struct m0_rpc_link rlink 
)
static

Definition at line 261 of file link.c.

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

◆ rpc_link_conn_terminate()

static int rpc_link_conn_terminate ( struct m0_rpc_link rlink)
static

Definition at line 145 of file link.c.

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

◆ rpc_link_conn_terminated()

static int rpc_link_conn_terminated ( struct m0_rpc_link rlink)
static

Definition at line 159 of file link.c.

Here is the call graph for this function:

◆ rpc_link_disc_fom_fini()

static void rpc_link_disc_fom_fini ( struct m0_fom fom)
static

Definition at line 485 of file link.c.

Here is the call graph for this function:

◆ rpc_link_disc_fom_tick()

static int rpc_link_disc_fom_tick ( struct m0_fom fom)
static

Definition at line 379 of file link.c.

Here is the call graph for this function:

◆ rpc_link_disc_init()

static int rpc_link_disc_init ( struct m0_rpc_link rlink)
static

Definition at line 140 of file link.c.

◆ rpc_link_fom_fini_common()

static void rpc_link_fom_fini_common ( struct m0_fom fom,
bool  connected 
)
static

Definition at line 466 of file link.c.

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

◆ rpc_link_fom_locality()

static size_t rpc_link_fom_locality ( const struct m0_fom fom)
static

Definition at line 98 of file link.c.

◆ rpc_link_fom_queue()

static void rpc_link_fom_queue ( struct m0_rpc_link rlink,
struct m0_clink wait_clink,
const struct m0_fom_type fom_type,
const struct m0_fom_ops fom_ops 
)
static

Definition at line 672 of file link.c.

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

◆ rpc_link_sess_cleanup()

static void rpc_link_sess_cleanup ( struct m0_rpc_link rlink)
static

Definition at line 181 of file link.c.

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

◆ rpc_link_sess_establish()

static int rpc_link_sess_establish ( struct m0_rpc_link rlink)
static

Definition at line 117 of file link.c.

Here is the call graph for this function:

◆ rpc_link_sess_established()

static int rpc_link_sess_established ( struct m0_rpc_link rlink)
static

Definition at line 128 of file link.c.

◆ rpc_link_sess_failure()

static int rpc_link_sess_failure ( struct m0_rpc_link rlink)
static

Definition at line 199 of file link.c.

Here is the call graph for this function:

◆ rpc_link_sess_fom_wait_on()

static void rpc_link_sess_fom_wait_on ( struct m0_fom fom,
struct m0_rpc_link rlink 
)
static

Definition at line 269 of file link.c.

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

◆ rpc_link_sess_terminate()

static int rpc_link_sess_terminate ( struct m0_rpc_link rlink)
static

Definition at line 165 of file link.c.

Here is the call graph for this function:

Variable Documentation

◆ m0_rpc_service_type

struct m0_reqh_service_type m0_rpc_service_type

Definition at line 120 of file service.c.

◆ rpc_link_conn_fom_ops

const struct m0_fom_ops rpc_link_conn_fom_ops
Initial value:
= {
.fo_home_locality = rpc_link_fom_locality
}

Definition at line 78 of file link.c.

◆ rpc_link_conn_fom_type

struct m0_fom_type rpc_link_conn_fom_type

Definition at line 75 of file link.c.

◆ rpc_link_conn_fom_type_ops

const struct m0_fom_type_ops rpc_link_conn_fom_type_ops
static
Initial value:
= {
.fto_create = NULL,
}
#define NULL
Definition: misc.h:38

Definition at line 90 of file link.c.

◆ rpc_link_conn_sm_conf

const struct m0_sm_conf rpc_link_conn_sm_conf
static
Initial value:
= {
.scf_name = "rpc_link connection state machine",
}
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 533 of file link.c.

◆ rpc_link_conn_state_descr

struct m0_sm_state_descr rpc_link_conn_state_descr[]
static

Definition at line 490 of file link.c.

◆ rpc_link_conn_states

struct rpc_link_state_transition rpc_link_conn_states[]
static
Initial value:
= {
M0_RLS_CONN_FAILURE, "Initialised" },
M0_RLS_SESS_FAILURE, "Connection establish" },
{ &rpc_link_sess_established, M0_RLS_FINI, 0, "Session establishing" },
{ &rpc_link_conn_failure, M0_RLS_FINI, 0, "Failure in connection" },
"Failure in establishing session" },
{ &rpc_link_conn_failure, M0_RLS_FINI, 0, "terminate connection" },
}

Definition at line 212 of file link.c.

◆ rpc_link_disc_fom_ops

const struct m0_fom_ops rpc_link_disc_fom_ops
Initial value:
= {
.fo_home_locality = rpc_link_fom_locality
}

Definition at line 84 of file link.c.

◆ rpc_link_disc_fom_type

struct m0_fom_type rpc_link_disc_fom_type

Definition at line 76 of file link.c.

◆ rpc_link_disc_fom_type_ops

const struct m0_fom_type_ops rpc_link_disc_fom_type_ops
static
Initial value:
= {
.fto_create = NULL,
}
#define NULL
Definition: misc.h:38

Definition at line 94 of file link.c.

◆ rpc_link_disc_sm_conf

const struct m0_sm_conf rpc_link_disc_sm_conf
static
Initial value:
= {
.scf_name = "rpc_link disconnection state machine",
}
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 582 of file link.c.

◆ rpc_link_disc_state_descr

struct m0_sm_state_descr rpc_link_disc_state_descr[]
static

Definition at line 539 of file link.c.

◆ rpc_link_disc_states

struct rpc_link_state_transition rpc_link_disc_states[]
static
Initial value:
= {
{ &rpc_link_disc_init, M0_RLS_SESS_WAIT_IDLE, 0, "Initialised" },
M0_RLS_SESS_FAILURE, "IDLE state wait" },
M0_RLS_CONN_FAILURE, "Session termination" },
{ &rpc_link_conn_terminated, M0_RLS_FINI, 0, "Conn termination" },
{ &rpc_link_conn_failure, M0_RLS_FINI, 0, "Failure in disconnection" },
"Failure in sess termination" },
}

Definition at line 237 of file link.c.