Motr  M0
RPC Sessions

Data Structures

struct  m0_rpc_conn
 
struct  m0_rpc_conn_ha_ops
 
struct  m0_rpc_conn_ha_cfg
 
struct  fop_session_establish_ctx
 
struct  m0_rpc_session
 
struct  m0_rpc_connection_session_specific_fom
 
struct  m0_rpc_fop_conn_establish_ctx
 
struct  m0_rpc_fop_conn_establish
 
struct  m0_rpc_fop_conn_establish_rep
 
struct  m0_rpc_fop_conn_terminate
 
struct  m0_rpc_fop_conn_terminate_rep
 
struct  m0_rpc_fop_session_establish
 
struct  m0_rpc_fop_session_establish_rep
 
struct  m0_rpc_fop_session_terminate
 
struct  m0_rpc_fop_session_terminate_rep
 

Macros

#define S_CASE(x)   case x: return #x;
 

Enumerations

enum  { RPC_HA_INTERVAL = 500 * M0_TIME_ONE_MSEC }
 
enum  m0_rpc_conn_state {
  M0_RPC_CONN_INITIALISED, M0_RPC_CONN_CONNECTING, M0_RPC_CONN_ACTIVE, M0_RPC_CONN_FAILED,
  M0_RPC_CONN_TERMINATING, M0_RPC_CONN_TERMINATED, M0_RPC_CONN_FINALISED
}
 
enum  m0_rpc_conn_flags { RCF_SENDER_END = 1 << 0, RCF_RECV_END = 1 << 1, RCF_TRANSIENT_SENT = 1 << 2 }
 
enum  { SENDER_ID_INVALID = UINT64_MAX }
 
enum  m0_rpc_session_state {
  M0_RPC_SESSION_INITIALISED, M0_RPC_SESSION_ESTABLISHING, M0_RPC_SESSION_IDLE, M0_RPC_SESSION_BUSY,
  M0_RPC_SESSION_FAILED, M0_RPC_SESSION_TERMINATING, M0_RPC_SESSION_TERMINATED, M0_RPC_SESSION_FINALISED
}
 
enum  m0_rpc_fom_conn_establish_phase { M0_FOPH_CONN_ESTABLISHING = M0_FOPH_NR + 1 }
 
enum  m0_rpc_fom_session_establish_phase { M0_FOPH_SESSION_ESTABLISHING = M0_FOPH_NR + 1 }
 
enum  m0_rpc_fom_session_terminate_phase { M0_FOPH_SESSION_TERMINATING = M0_FOPH_NR + 1 }
 
enum  m0_rpc_fom_conn_terminate_phase { M0_FOPH_CONN_TERMINATING = M0_FOPH_NR + 1 }
 
enum  m0_rpc_conn_sess_terminate_phases { M0_RPC_CONN_SESS_TERMINATE_INIT = M0_FOM_PHASE_INIT, M0_RPC_CONN_SESS_TERMINATE_DONE = M0_FOM_PHASE_FINISH, M0_RPC_CONN_SESS_TERMINATE_WAIT }
 
enum  { SESSION_ID_0 = 0, SESSION_ID_INVALID = UINT64_MAX, SESSION_ID_MIN = SESSION_ID_0 + 1, SESSION_ID_MAX = SESSION_ID_INVALID - 1 }
 

Functions

M0_INTERNAL struct m0_rpc_chanrpc_chan_get (struct m0_rpc_machine *machine, struct m0_net_end_point *dest_ep, uint64_t max_rpcs_in_flight)
 
M0_INTERNAL void rpc_chan_put (struct m0_rpc_chan *chan)
 
static bool rpc_conn__on_service_event_cb (struct m0_clink *clink)
 
static void rpc_conn_sessions_cleanup_fail (struct m0_rpc_conn *conn, bool fail)
 
static bool rpc_conn__on_cache_expired_cb (struct m0_clink *clink)
 
static bool rpc_conn__on_cache_ready_cb (struct m0_clink *clink)
 
static struct m0_confcrpc_conn2confc (const struct m0_rpc_conn *conn)
 
static void rpc_conn_ha_timer_cb (struct m0_sm_timer *timer)
 
static void reqh_service_ha_state_set (struct m0_rpc_conn *conn, uint8_t state)
 
static int session_zero_attach (struct m0_rpc_conn *conn)
 
static void session_zero_detach (struct m0_rpc_conn *conn)
 
static int __conn_init (struct m0_rpc_conn *conn, struct m0_net_end_point *ep, struct m0_rpc_machine *machine, uint64_t max_rpcs_in_flight)
 
static void __conn_fini (struct m0_rpc_conn *conn)
 
static void conn_failed (struct m0_rpc_conn *conn, int32_t error)
 
static void deregister_all_item_sources (struct m0_rpc_conn *conn)
 
M0_INTERNAL void conn_state_set (struct m0_rpc_conn *conn, int state)
 
M0_INTERNAL bool m0_rpc_conn_invariant (const struct m0_rpc_conn *conn)
 
M0_INTERNAL bool m0_rpc_conn_is_snd (const struct m0_rpc_conn *conn)
 
M0_INTERNAL bool m0_rpc_conn_is_rcv (const struct m0_rpc_conn *conn)
 
M0_INTERNAL int m0_rpc_conn_init (struct m0_rpc_conn *conn, struct m0_fid *svc_fid, struct m0_net_end_point *ep, struct m0_rpc_machine *machine, uint64_t max_rpcs_in_flight)
 
M0_INTERNAL struct m0_conf_objm0_rpc_conn2svc (const struct m0_rpc_conn *conn)
 
static void __conn_ha_subscribe (struct m0_rpc_conn *conn)
 
static void __conn_ha_unsubscribe (struct m0_rpc_conn *conn)
 
M0_INTERNAL void m0_rpc_conn_reset (struct m0_rpc_conn *conn)
 
M0_INTERNAL int m0_rpc_rcv_conn_init (struct m0_rpc_conn *conn, struct m0_net_end_point *ep, struct m0_rpc_machine *machine, const struct m0_uint128 *uuid)
 
M0_INTERNAL void m0_rpc_conn_fini (struct m0_rpc_conn *conn)
 
M0_INTERNAL int m0_rpc_conn_ha_subscribe (struct m0_rpc_conn *conn, struct m0_fid *svc_fid)
 
M0_INTERNAL void m0_rpc_conn_ha_unsubscribe (struct m0_rpc_conn *conn)
 
M0_INTERNAL void m0_rpc_conn_fini_locked (struct m0_rpc_conn *conn)
 
M0_INTERNAL int m0_rpc_conn_timedwait (struct m0_rpc_conn *conn, uint64_t states, const m0_time_t timeout)
 
M0_INTERNAL void m0_rpc_conn_add_session (struct m0_rpc_conn *conn, struct m0_rpc_session *session)
 
M0_INTERNAL void m0_rpc_conn_remove_session (struct m0_rpc_session *session)
 
M0_INTERNAL struct m0_rpc_sessionm0_rpc_conn_session0 (const struct m0_rpc_conn *conn)
 
M0_INTERNAL struct m0_rpc_sessionm0_rpc_session_search (const struct m0_rpc_conn *conn, uint64_t session_id)
 
M0_INTERNAL struct m0_rpc_sessionm0_rpc_session_search_and_pop (const struct m0_rpc_conn *conn, uint64_t session_id)
 
M0_INTERNAL struct m0_rpc_sessionm0_rpc_session_pop (const struct m0_rpc_conn *conn)
 
M0_INTERNAL int m0_rpc_conn_create (struct m0_rpc_conn *conn, struct m0_fid *svc_fid, struct m0_net_end_point *ep, struct m0_rpc_machine *rpc_machine, uint64_t max_rpcs_in_flight, m0_time_t abs_timeout)
 
M0_INTERNAL int m0_rpc_conn_establish_sync (struct m0_rpc_conn *conn, m0_time_t abs_timeout)
 
M0_INTERNAL int m0_rpc_conn_establish (struct m0_rpc_conn *conn, m0_time_t abs_timeout)
 
M0_INTERNAL void m0_rpc_conn_establish_reply_received (struct m0_rpc_item *item)
 
int m0_rpc_conn_destroy (struct m0_rpc_conn *conn, m0_time_t abs_timeout)
 
M0_INTERNAL int m0_rpc_conn_terminate_sync (struct m0_rpc_conn *conn, m0_time_t abs_timeout)
 
M0_INTERNAL int m0_rpc_conn_terminate (struct m0_rpc_conn *conn, m0_time_t abs_timeout)
 
M0_INTERNAL void m0_rpc_conn_terminate_reply_received (struct m0_rpc_item *item)
 
M0_INTERNAL void m0_rpc_conn_cleanup_all_sessions (struct m0_rpc_conn *conn)
 
M0_INTERNAL int m0_rpc_rcv_conn_terminate (struct m0_rpc_conn *conn)
 
M0_INTERNAL void m0_rpc_conn_terminate_reply_sent (struct m0_rpc_conn *conn)
 
M0_INTERNAL bool m0_rpc_item_is_conn_establish (const struct m0_rpc_item *item)
 
M0_INTERNAL bool m0_rpc_item_is_sess_establish (const struct m0_rpc_item *item)
 
M0_INTERNAL int m0_rpc_machine_conn_list_dump (struct m0_rpc_machine *machine, int dir)
 
M0_INTERNAL int m0_rpc_conn_session_list_dump (const struct m0_rpc_conn *conn)
 
M0_INTERNAL const char * m0_rpc_conn_addr (const struct m0_rpc_conn *conn)
 
M0_INTERNAL bool m0_rpc_conn_is_known_dead (const struct m0_rpc_conn *conn)
 
M0_INTERNAL void m0_rpc_conn_sessions_cancel (struct m0_rpc_conn *conn)
 
M0_INTERNAL int m0_rpc_conn_ha_timer_start (struct m0_rpc_conn *conn)
 
M0_INTERNAL void m0_rpc_conn_ha_timer_stop (struct m0_rpc_conn *conn)
 
M0_INTERNAL void m0_rpc_conn_ha_cfg_set (struct m0_rpc_conn *conn, const struct m0_rpc_conn_ha_cfg *cfg)
 
M0_INTERNAL const char * m0_rpc_conn_state_to_str (enum m0_rpc_conn_state state)
 
static int conn_state (const struct m0_rpc_conn *conn)
 
static void conn_flag_set (struct m0_rpc_conn *conn, uint64_t flag)
 
static void conn_flag_unset (struct m0_rpc_conn *conn, uint64_t flag)
 
static bool conn_flag_is_set (const struct m0_rpc_conn *conn, uint64_t flag)
 
M0_INTERNAL void m0_rpc_fop_conn_establish_ctx_init (struct m0_rpc_item *item, struct m0_net_end_point *ep)
 
static void __session_fini (struct m0_rpc_session *session)
 
static void session_failed (struct m0_rpc_session *session, int32_t error)
 
static void session_idle_x_busy (struct m0_rpc_session *session)
 
static void session_establish_fop_release (struct m0_ref *ref)
 
 M0_TL_DESCR_DEFINE (rpc_session, "rpc-sessions", M0_INTERNAL, struct m0_rpc_session, s_link, s_magic, M0_RPC_SESSION_MAGIC, M0_RPC_SESSION_HEAD_MAGIC)
 
 M0_TL_DEFINE (rpc_session, M0_INTERNAL, struct m0_rpc_session)
 
M0_INTERNAL void session_state_set (struct m0_rpc_session *session, int state)
 
M0_INTERNAL int session_state (const struct m0_rpc_session *session)
 
M0_INTERNAL struct m0_rpc_machinesession_machine (const struct m0_rpc_session *s)
 
M0_INTERNAL bool m0_rpc_session_invariant (const struct m0_rpc_session *session)
 
M0_INTERNAL bool m0_rpc_session_is_idle (const struct m0_rpc_session *session)
 
M0_INTERNAL int m0_rpc_session_init (struct m0_rpc_session *session, struct m0_rpc_conn *conn)
 
M0_INTERNAL int m0_rpc_session_init_locked (struct m0_rpc_session *session, struct m0_rpc_conn *conn)
 
M0_INTERNAL void m0_rpc_session_reset (struct m0_rpc_session *session)
 
M0_INTERNAL void m0_rpc_session_fini (struct m0_rpc_session *session)
 
M0_INTERNAL void m0_rpc_session_fini_locked (struct m0_rpc_session *session)
 
M0_INTERNAL int m0_rpc_session_timedwait (struct m0_rpc_session *session, uint64_t states, const m0_time_t abs_timeout)
 
M0_INTERNAL int m0_rpc_session_create (struct m0_rpc_session *session, struct m0_rpc_conn *conn, m0_time_t abs_timeout)
 
M0_INTERNAL int m0_rpc_session_establish_sync (struct m0_rpc_session *session, m0_time_t abs_timeout)
 
M0_INTERNAL int m0_rpc_session_establish (struct m0_rpc_session *session, m0_time_t abs_timeout)
 
M0_INTERNAL void m0_rpc_session_establish_reply_received (struct m0_rpc_item *item)
 
int m0_rpc_session_destroy (struct m0_rpc_session *session, m0_time_t abs_timeout)
 
M0_INTERNAL int m0_rpc_session_validate (struct m0_rpc_session *session)
 
M0_INTERNAL int m0_rpc_session_terminate_sync (struct m0_rpc_session *session, m0_time_t abs_timeout)
 
M0_INTERNAL int m0_rpc_session_terminate (struct m0_rpc_session *session, m0_time_t abs_timeout)
 
M0_INTERNAL void m0_rpc_session_terminate_reply_received (struct m0_rpc_item *item)
 
M0_INTERNAL m0_bcount_t m0_rpc_session_get_max_item_size (const struct m0_rpc_session *session)
 
M0_INTERNAL m0_bcount_t m0_rpc_session_get_max_item_payload_size (const struct m0_rpc_session *session)
 
M0_INTERNAL void m0_rpc_session_hold_busy (struct m0_rpc_session *session)
 
M0_INTERNAL void m0_rpc_session_release (struct m0_rpc_session *session)
 
M0_INTERNAL int m0_rpc_rcv_session_terminate (struct m0_rpc_session *session)
 
M0_INTERNAL void m0_rpc_session_quiesce (struct m0_rpc_session *session)
 
M0_INTERNAL void m0_rpc_session_cancel (struct m0_rpc_session *session)
 
M0_INTERNAL bool m0_rpc_session_is_cancelled (struct m0_rpc_session *session)
 
M0_INTERNAL void m0_rpc_session_item_failed (struct m0_rpc_item *item)
 
M0_INTERNAL const char * m0_rpc_session_state_to_str (enum m0_rpc_session_state state)
 
 M0_TL_DESCR_DECLARE (pending_item, M0_EXTERN)
 
 M0_TL_DECLARE (pending_item, M0_INTERNAL, struct m0_rpc_item)
 
static void session_gen_fom_fini (struct m0_fom *fom)
 
static int session_gen_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
 
static int rpc_tick_ret (struct m0_rpc_session *session, struct m0_fom *fom, int next_state)
 
M0_INTERNAL size_t m0_rpc_session_default_home_locality (const struct m0_fom *fom)
 
M0_INTERNAL int m0_rpc_fom_conn_establish_tick (struct m0_fom *fom)
 
M0_INTERNAL int m0_rpc_fom_session_establish_tick (struct m0_fom *fom)
 
M0_INTERNAL int m0_rpc_fom_session_terminate_tick (struct m0_fom *fom)
 
static void conn_cleanup_ast (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
static void conn_terminate_reply_sent_cb (struct m0_rpc_item *item)
 
M0_INTERNAL int m0_rpc_fom_conn_terminate_tick (struct m0_fom *fom)
 
M0_INTERNAL void m0_rpc_fom_conn_establish_fini (struct m0_fom *fom)
 
M0_INTERNAL void m0_rpc_fom_session_establish_fini (struct m0_fom *fom)
 
M0_INTERNAL void m0_rpc_fom_session_terminate_fini (struct m0_fom *fom)
 
M0_INTERNAL void m0_rpc_fom_conn_terminate_fini (struct m0_fom *fom)
 
static void conn_establish_fop_release (struct m0_ref *ref)
 
static int conn_establish_item_decode (const struct m0_rpc_item_type *item_type, struct m0_rpc_item **item, struct m0_bufvec_cursor *cur)
 
M0_INTERNAL void m0_rpc_session_fop_fini (void)
 
M0_INTERNAL int m0_rpc_session_fop_init (void)
 
struct m0_rpc_fop_conn_establish M0_XCA_DOMAIN (rpc)
 
 M0_TL_DESCR_DECLARE (rpc_session, M0_EXTERN)
 
 M0_TL_DECLARE (rpc_session, M0_INTERNAL, struct m0_rpc_session)
 
M0_INTERNAL int m0_rpc_session_module_init (void)
 
M0_INTERNAL void m0_rpc_session_module_fini (void)
 
M0_INTERNAL int m0_rpc__post_locked (struct m0_rpc_item *item)
 
M0_INTERNAL int m0_rpc__fop_post (struct m0_fop *fop, struct m0_rpc_session *session, const struct m0_rpc_item_ops *ops, m0_time_t abs_timeout)
 
M0_INTERNAL uint64_t m0_rpc_id_generate (const struct m0_fid *uniq_fid)
 
M0_INTERNAL int m0_rpc_item_dispatch (struct m0_rpc_item *item)
 

Variables

static struct m0_rpc_conn_ha_cfg rpc_conn_ha_cfg
 
static const struct m0_rpc_item_ops conn_establish_item_ops
 
static const struct m0_rpc_item_ops conn_terminate_item_ops
 
static struct m0_sm_state_descr conn_states []
 
static const struct m0_sm_conf conn_conf
 
static const struct m0_rpc_item_ops session_establish_item_ops
 
static const struct m0_rpc_item_ops session_terminate_item_ops
 
static struct m0_sm_state_descr session_states []
 
static const struct m0_sm_conf session_conf
 
const struct m0_fom_ops m0_rpc_fom_conn_establish_ops
 
struct m0_fom_type_ops m0_rpc_fom_conn_establish_type_ops
 
const struct m0_fom_ops m0_rpc_fom_session_establish_ops
 
struct m0_fom_type_ops m0_rpc_fom_session_establish_type_ops
 
const struct m0_fom_ops m0_rpc_fom_session_terminate_ops
 
struct m0_fom_type_ops m0_rpc_fom_session_terminate_type_ops
 
const struct m0_fom_ops m0_rpc_fom_conn_terminate_ops
 
struct m0_fom_type_ops m0_rpc_fom_conn_terminate_type_ops
 
static const struct m0_rpc_item_ops conn_terminate_reply_item_ops
 
struct m0_fom_type m0_rpc_fom_conn_establish_type
 
const struct m0_fom_ops m0_rpc_fom_conn_establish_ops
 
struct m0_fom_type m0_rpc_fom_session_establish_type
 
const struct m0_fom_ops m0_rpc_fom_session_establish_ops
 
struct m0_fom_type m0_rpc_fom_session_terminate_type
 
const struct m0_fom_ops m0_rpc_fom_session_terminate_ops
 
struct m0_fom_type m0_rpc_fom_conn_terminate_type
 
const struct m0_fom_ops m0_rpc_fom_conn_terminate_ops
 
static struct m0_sm_state_descr m0_rpc_fom_sess_conn_term_phases []
 
M0_INTERNAL const struct m0_sm_conf m0_rpc_fom_sess_conn_term_phases_sm_conf
 
static struct m0_rpc_item_type_ops conn_establish_item_type_ops
 
struct m0_fop_type m0_rpc_fop_conn_establish_fopt
 
struct m0_fop_type m0_rpc_fop_conn_establish_rep_fopt
 
struct m0_fop_type m0_rpc_fop_conn_terminate_fopt
 
struct m0_fop_type m0_rpc_fop_conn_terminate_rep_fopt
 
struct m0_fop_type m0_rpc_fop_session_establish_fopt
 
struct m0_fop_type m0_rpc_fop_session_establish_rep_fopt
 
struct m0_fop_type m0_rpc_fop_session_terminate_fopt
 
struct m0_fop_type m0_rpc_fop_session_terminate_rep_fopt
 
struct m0_fom_type_ops m0_rpc_fom_conn_establish_type_ops
 
struct m0_fom_type_ops m0_rpc_fom_session_establish_type_ops
 
struct m0_fom_type_ops m0_rpc_fom_conn_terminate_type_ops
 
struct m0_fom_type_ops m0_rpc_fom_session_terminate_type_ops
 
struct m0_reqh_service_type m0_rpc_service_type
 
const struct m0_fop_type_ops m0_rpc_fop_conn_establish_ops
 
const struct m0_fop_type_ops m0_rpc_fop_conn_terminate_ops
 
const struct m0_fop_type_ops m0_rpc_fop_session_establish_ops
 
const struct m0_fop_type_ops m0_rpc_fop_session_terminate_ops
 
struct m0_fop_type m0_rpc_fop_conn_establish_fopt
 
struct m0_fop_type m0_rpc_fop_conn_establish_rep_fopt
 
struct m0_fop_type m0_rpc_fop_conn_terminate_fopt
 
struct m0_fop_type m0_rpc_fop_conn_terminate_rep_fopt
 
struct m0_fop_type m0_rpc_fop_session_establish_fopt
 
struct m0_fop_type m0_rpc_fop_session_establish_rep_fopt
 
struct m0_fop_type m0_rpc_fop_session_terminate_fopt
 
struct m0_fop_type m0_rpc_fop_session_terminate_rep_fopt
 
enum { ... }  M0_XCA_DOMAIN
 

Detailed Description

Overview

Session module of rpc layer has two objectives:

Aproach taken by session module to achive these two objectives, is similar to session-slot implementation in NFSv4.1

See section 2.10.6 of rfc 5661 NFSv4.1 http://tools.ietf.org/html/rfc5661#section-2.10.6

Session module defines following types of objects:

Session module uses following types of objects:

Rpc connection has a list of rpc sessions, which are created on this connection. A rpc connection cannot be terminated until all the sessions created on the connection are terminated.

Each object of type [m0_rpc_conn|m0_rpc_session] on sender has counterpart object of same type on receiver. (Note: same structure definitions are used on both sender and receiver side)

Using two identifiers for session and conn

Todo:
currently, receiver assigns identifiers to connections and sessions and these identifiers are used by both parties. What we can do, is to allow sender to assign identifiers to sessions (this identifier is sent in SESSION_ESTABLISH). Then, whenever receiver uses the session to send a reply, it uses this identifier (instead of receiver assigned session-id). The advantage of this, is that sender can use an identifier that allows quick lookup (e.g., an index in some session array or simply a pointer). Similarly for connections (i.e., another sender generated identifier in addition to uuid, that is not guaranteed to be globally unique)
Todo:
  • Generate ADDB data points for important session events
  • store replies in FOL
  • Optimization: Cache misordered items at receiver, rather than discarding them.

This file implements functions related to m0_rpc_conn.

This file defines functions related to m0_rpc_session.

Definitions of foms that execute conn establish, conn terminate, session establish and session terminate fops.

This file contains, fom declarations for [conn|session]_[establish|terminate].

This file contains definitions of fop types and rpc item types, of fops belonging to rpc-session module

Declarations of all the fops belonging to rpc-session module along with associated item types.

Macro Definition Documentation

◆ S_CASE

#define S_CASE (   x)    case x: return #x;

Definition at line 1531 of file conn.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RPC_HA_INTERVAL 

Interval being elapsed after rpc item sending has to result in sending M0_NC_TRANSIENT state to HA.

default value, in milliseconds

Definition at line 65 of file conn.c.

◆ anonymous enum

anonymous enum
Enumerator
SENDER_ID_INVALID 

Definition at line 41 of file conn_internal.h.

◆ anonymous enum

anonymous enum
Enumerator
SESSION_ID_0 

[conn|session]_[create|terminate] items go on session 0

SESSION_ID_INVALID 
SESSION_ID_MIN 

Range of valid session ids

SESSION_ID_MAX 

Definition at line 39 of file session_internal.h.

◆ m0_rpc_conn_flags

RPC Connection flags

See also
m0_rpc_conn::c_flags
Enumerator
RCF_SENDER_END 
RCF_RECV_END 
RCF_TRANSIENT_SENT 

M0_NC_TRANSIENT state has been already sent to HA.

Definition at line 99 of file conn.h.

◆ m0_rpc_conn_sess_terminate_phases

Enumerator
M0_RPC_CONN_SESS_TERMINATE_INIT 
M0_RPC_CONN_SESS_TERMINATE_DONE 
M0_RPC_CONN_SESS_TERMINATE_WAIT 

Definition at line 44 of file session_fops.h.

◆ m0_rpc_conn_state

Enumerator
M0_RPC_CONN_INITIALISED 

All the fields of conn are initialised locally. But the connection is not yet established.

M0_RPC_CONN_CONNECTING 

Connection establish request is sent to receiver but its reply is not yet received.

M0_RPC_CONN_ACTIVE 

Receiver replied with a successful connection establish reply. Connection is established and ready to be used.

M0_RPC_CONN_FAILED 

If conn init or terminate fails or time-outs connection enters in FAILED state. m0_rpc_conn::c_sm::sm_rc contains reason for failure.

M0_RPC_CONN_TERMINATING 

When sender calls m0_rpc_conn_terminate() on m0_rpc_conn object a FOP is sent to the receiver side to terminate the rpc connection. Until reply is received, m0_rpc_conn object stays in TERMINATING state

M0_RPC_CONN_TERMINATED 

When sender receives reply for conn_terminate FOP and reply FOP specifies the conn_terminate operation is successful then the object of m0_rpc_conn enters in TERMINATED state

M0_RPC_CONN_FINALISED 

After m0_rpc_conn_fini() the RPC connection instance is moved to FINALISED state.

Definition at line 50 of file conn.h.

◆ m0_rpc_fom_conn_establish_phase

Enumerator
M0_FOPH_CONN_ESTABLISHING 

Definition at line 47 of file session_foms.h.

◆ m0_rpc_fom_conn_terminate_phase

Enumerator
M0_FOPH_CONN_TERMINATING 

Definition at line 91 of file session_foms.h.

◆ m0_rpc_fom_session_establish_phase

Enumerator
M0_FOPH_SESSION_ESTABLISHING 

Definition at line 63 of file session_foms.h.

◆ m0_rpc_fom_session_terminate_phase

Enumerator
M0_FOPH_SESSION_TERMINATING 

Definition at line 77 of file session_foms.h.

◆ m0_rpc_session_state

Possible states of a session object

Enumerator
M0_RPC_SESSION_INITIALISED 

all lists, mutex and channels of session are initialised. No actual session is established with any end point

M0_RPC_SESSION_ESTABLISHING 

When sender sends a SESSION_ESTABLISH FOP to reciever it is in ESTABLISHING state

M0_RPC_SESSION_IDLE 

A session can be terminated only if it is IDLE.

M0_RPC_SESSION_BUSY 

A session is busy if any of following is true

  • There is item for which the reply is not received yet (on receive side).
  • Formation queue has item associated with this session.
M0_RPC_SESSION_FAILED 

Creation/termination of session failed

M0_RPC_SESSION_TERMINATING 

When sender sends SESSION_TERMINATE fop to receiver and is waiting for reply, then it is in state TERMINATING.

M0_RPC_SESSION_TERMINATED 

When sender gets reply to session_terminate fop and reply informs the session termination is successful then the session enters in TERMINATED state

M0_RPC_SESSION_FINALISED 

After m0_rpc_session_fini() the RPC session instance is moved to FINALISED state.

Definition at line 112 of file session.h.

Function Documentation

◆ __conn_fini()

static void __conn_fini ( struct m0_rpc_conn conn)
static

Common code in m0_rpc_conn_fini() and init failed case in __conn_init()

Definition at line 500 of file conn.c.

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

◆ __conn_ha_subscribe()

static void __conn_ha_subscribe ( struct m0_rpc_conn conn)
static

Definition at line 365 of file conn.c.

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

◆ __conn_ha_unsubscribe()

static void __conn_ha_unsubscribe ( struct m0_rpc_conn conn)
static

Definition at line 385 of file conn.c.

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

◆ __conn_init()

static int __conn_init ( struct m0_rpc_conn conn,
struct m0_net_end_point ep,
struct m0_rpc_machine machine,
uint64_t  max_rpcs_in_flight 
)
static

Definition at line 399 of file conn.c.

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

◆ __session_fini()

static void __session_fini ( struct m0_rpc_session session)
static

Finalises session. Used by m0_rpc_session_init(), when initialisation fails. m0_rpc_session_fini() for cleanup

Definition at line 283 of file session.c.

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

◆ conn_cleanup_ast()

static void conn_cleanup_ast ( struct m0_sm_group grp,
struct m0_sm_ast ast 
)
static

Definition at line 558 of file session_foms.c.

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

◆ conn_establish_fop_release()

static void conn_establish_fop_release ( struct m0_ref ref)
static

Definition at line 65 of file session_fops.c.

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

◆ conn_establish_item_decode()

static int conn_establish_item_decode ( const struct m0_rpc_item_type item_type,
struct m0_rpc_item **  item,
struct m0_bufvec_cursor cur 
)
static

No need to allocate fop->f_data.fd_data since xcode allocates top level object also.

Definition at line 81 of file session_fops.c.

Here is the call graph for this function:

◆ conn_failed()

static void conn_failed ( struct m0_rpc_conn conn,
int32_t  error 
)
static

Moves conn to M0_RPC_CONN_FAILED state, setting error code to error.

Definition at line 916 of file conn.c.

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

◆ conn_flag_is_set()

static bool conn_flag_is_set ( const struct m0_rpc_conn conn,
uint64_t  flag 
)
inlinestatic

Definition at line 81 of file conn_internal.h.

Here is the caller graph for this function:

◆ conn_flag_set()

static void conn_flag_set ( struct m0_rpc_conn conn,
uint64_t  flag 
)
inlinestatic

Definition at line 71 of file conn_internal.h.

Here is the caller graph for this function:

◆ conn_flag_unset()

static void conn_flag_unset ( struct m0_rpc_conn conn,
uint64_t  flag 
)
inlinestatic

Definition at line 76 of file conn_internal.h.

Here is the caller graph for this function:

◆ conn_state()

static int conn_state ( const struct m0_rpc_conn conn)
inlinestatic

Definition at line 66 of file conn_internal.h.

Here is the caller graph for this function:

◆ conn_state_set()

M0_INTERNAL void conn_state_set ( struct m0_rpc_conn conn,
int  state 
)

Definition at line 167 of file conn.c.

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

◆ conn_terminate_reply_sent_cb()

static void conn_terminate_reply_sent_cb ( struct m0_rpc_item item)
static

Definition at line 566 of file session_foms.c.

Here is the call graph for this function:

◆ deregister_all_item_sources()

static void deregister_all_item_sources ( struct m0_rpc_conn conn)
static

Definition at line 1114 of file conn.c.

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

◆ m0_rpc__fop_post()

M0_INTERNAL int m0_rpc__fop_post ( struct m0_fop fop,
struct m0_rpc_session session,
const struct m0_rpc_item_ops ops,
m0_time_t  abs_timeout 
)

Initialises rpc item and posts it to rpc-layer

Definition at line 62 of file session_utils.c.

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

◆ m0_rpc__post_locked()

M0_INTERNAL int m0_rpc__post_locked ( struct m0_rpc_item item)

Posts rpc item while having rpc machine already locked.

Definition at line 83 of file rpc.c.

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

◆ m0_rpc_conn2svc()

M0_INTERNAL struct m0_conf_obj * m0_rpc_conn2svc ( const struct m0_rpc_conn conn)

Definition at line 349 of file conn.c.

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

◆ m0_rpc_conn_add_session()

M0_INTERNAL void m0_rpc_conn_add_session ( struct m0_rpc_conn conn,
struct m0_rpc_session session 
)

Definition at line 722 of file conn.c.

Here is the caller graph for this function:

◆ m0_rpc_conn_addr()

M0_INTERNAL const char * m0_rpc_conn_addr ( const struct m0_rpc_conn conn)

Definition at line 1306 of file conn.c.

Here is the caller graph for this function:

◆ m0_rpc_conn_cleanup_all_sessions()

M0_INTERNAL void m0_rpc_conn_cleanup_all_sessions ( struct m0_rpc_conn conn)

Definition at line 1174 of file conn.c.

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

◆ m0_rpc_conn_create()

M0_INTERNAL int m0_rpc_conn_create ( struct m0_rpc_conn conn,
struct m0_fid svc_fid,
struct m0_net_end_point ep,
struct m0_rpc_machine rpc_machine,
uint64_t  max_rpcs_in_flight,
m0_time_t  abs_timeout 
)

A combination of m0_rpc_conn_init() and m0_rpc_conn_establish_sync() in a single routine - initialize connection object, establish a connection and wait until it become active.

Conf object svc_obj is allowed to be NULL in case HA notification monitoring is not required on the established connection. Otherwise it should be from confc instance ultimately added to HA clients list to let HA notifications be handled proper way.

Definition at line 809 of file conn.c.

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

◆ m0_rpc_conn_destroy()

int m0_rpc_conn_destroy ( struct m0_rpc_conn conn,
m0_time_t  abs_timeout 
)

A combination of m0_rpc_conn_terminate_sync() and m0_rpc_conn_fini() in a single routine - terminate the connection, wait until it switched to terminated state and finalize connection object.

Definition at line 974 of file conn.c.

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

◆ m0_rpc_conn_establish()

M0_INTERNAL int m0_rpc_conn_establish ( struct m0_rpc_conn conn,
m0_time_t  abs_timeout 
)

Sends handshake CONN_ESTABLISH fop to the remote end.

Use m0_rpc_conn_timedwait() to wait until conn moves to ESTABLISHED or FAILED state.

Precondition
conn_state(conn) == M0_RPC_CONN_INITIALISED
Postcondition
ergo(result != 0, conn_state(conn) == M0_RPC_CONN_FAILED)

Definition at line 857 of file conn.c.

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

◆ m0_rpc_conn_establish_reply_received()

M0_INTERNAL void m0_rpc_conn_establish_reply_received ( struct m0_rpc_item req)

Callback routine called through item->ri_ops->rio_replied().

The routine is executed when reply to conn create fop is received

Definition at line 926 of file conn.c.

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

◆ m0_rpc_conn_establish_sync()

M0_INTERNAL int m0_rpc_conn_establish_sync ( struct m0_rpc_conn conn,
m0_time_t  abs_timeout 
)

Same as m0_rpc_conn_establish(), but in addition uses m0_rpc_conn_timedwait() to ensure that connection is in active state after m0_rpc_conn_establish() call.

Parameters
connA connection object to operate on.
abs_timeoutAbsolute timeout after which connection establishing is given up and conn is moved to FAILED state.
Precondition
conn_state(conn) == M0_RPC_CONN_INITIALISED
Postcondition
conn_state(conn) == M0_RPC_CONN_ACTIVE

Definition at line 836 of file conn.c.

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

◆ m0_rpc_conn_fini()

M0_INTERNAL void m0_rpc_conn_fini ( struct m0_rpc_conn conn)

Finalises m0_rpc_conn. No network communication involved.

Precondition
conn_state(conn) == M0_RPC_CONN_FAILED || conn_state(conn) == M0_RPC_CONN_INITIALISED || conn_state(conn) == M0_RPC_CONN_TERMINATED

Definition at line 558 of file conn.c.

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

◆ m0_rpc_conn_fini_locked()

M0_INTERNAL void m0_rpc_conn_fini_locked ( struct m0_rpc_conn conn)

Definition at line 659 of file conn.c.

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

◆ m0_rpc_conn_ha_cfg_set()

M0_INTERNAL void m0_rpc_conn_ha_cfg_set ( struct m0_rpc_conn conn,
const struct m0_rpc_conn_ha_cfg cfg 
)

Sets configuration of HA notifications for the connection. The function internally takes lock on RPC machine. A caller shouldn't care about concurrency.

Definition at line 1523 of file conn.c.

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

◆ m0_rpc_conn_ha_subscribe()

M0_INTERNAL int m0_rpc_conn_ha_subscribe ( struct m0_rpc_conn conn,
struct m0_fid svc_fid 
)

Late binding to service object. To be used with rpc connection possibly established to the moment, but originally not subscribed to HA notifications.

Precondition
conn->c_svc_obj == NULL

Definition at line 585 of file conn.c.

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

◆ m0_rpc_conn_ha_timer_start()

M0_INTERNAL int m0_rpc_conn_ha_timer_start ( struct m0_rpc_conn conn)

Definition at line 1417 of file conn.c.

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

◆ m0_rpc_conn_ha_timer_stop()

M0_INTERNAL void m0_rpc_conn_ha_timer_stop ( struct m0_rpc_conn conn)

Definition at line 1438 of file conn.c.

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

◆ m0_rpc_conn_ha_unsubscribe()

M0_INTERNAL void m0_rpc_conn_ha_unsubscribe ( struct m0_rpc_conn conn)

Takes conf cache and rpc machine lock before unsubscribing connection from service object.

Definition at line 632 of file conn.c.

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

◆ m0_rpc_conn_init()

M0_INTERNAL int m0_rpc_conn_init ( struct m0_rpc_conn conn,
struct m0_fid svc_obj,
struct m0_net_end_point ep,
struct m0_rpc_machine machine,
uint64_t  max_rpcs_in_flight 
)

Initialises object and associates it with . No network communication is involved.

Service fid can be provided to the call as an option. In case svc_fid is not NULL, connection gets subscribed to HA notifications on the object. Death notification under the circumstances is to result in cancelling all rpc items registered with the connection and still remaining unsent unless protection is set up on item explicitly by client with m0_rpc_item_ha_autocancel_set().

Note: m0_rpc_conn_init() can fail with -ENOMEM, -EINVAL. if m0_rpc_conn_init() fails, conn is left in undefined state.

Precondition
conn != NULL && ep != NULL && machine != NULL
Postcondition
ergo(rc == 0, conn_state(conn) == M0_RPC_CONN_INITIALISED && conn->c_machine == machine && conn->c_sender_id == SENDER_ID_INVALID && (conn->c_flags & RCF_SENDER_END) != 0)

Definition at line 293 of file conn.c.

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

◆ m0_rpc_conn_invariant()

M0_INTERNAL bool m0_rpc_conn_invariant ( const struct m0_rpc_conn conn)

Checks connection object invariant.

Function is also called from session_foms.c, hence cannot be static.

Definition at line 183 of file conn.c.

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

◆ m0_rpc_conn_is_known_dead()

M0_INTERNAL bool m0_rpc_conn_is_known_dead ( const struct m0_rpc_conn conn)

Tests connection object for remote service being known dead to the moment, i.e. having related conf service object bearing M0_NC_FAILED state. In case no HA subsctiption exists on the connection, reports the assertion false.

Definition at line 1311 of file conn.c.

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

◆ m0_rpc_conn_is_rcv()

M0_INTERNAL bool m0_rpc_conn_is_rcv ( const struct m0_rpc_conn conn)

Returns true iff is receiver end of rpc connection.

Return true iff is receiver side object of rpc-connection.

Definition at line 288 of file conn.c.

Here is the caller graph for this function:

◆ m0_rpc_conn_is_snd()

M0_INTERNAL bool m0_rpc_conn_is_snd ( const struct m0_rpc_conn conn)

Returns true iff is sender end of rpc connection.

Return true iff is sender side object of rpc-connection.

Definition at line 280 of file conn.c.

Here is the caller graph for this function:

◆ m0_rpc_conn_remove_session()

M0_INTERNAL void m0_rpc_conn_remove_session ( struct m0_rpc_session session)

Definition at line 736 of file conn.c.

Here is the caller graph for this function:

◆ m0_rpc_conn_reset()

M0_INTERNAL void m0_rpc_conn_reset ( struct m0_rpc_conn conn)

Definition at line 452 of file conn.c.

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

◆ m0_rpc_conn_session0()

M0_INTERNAL struct m0_rpc_session* m0_rpc_conn_session0 ( const struct m0_rpc_conn conn)

Searches and returns session with session id 0. Note: Every rpc connection always has exactly one active session with session id 0.

Searches and returns session with session_id 0. Each rpc connection always has exactly one instance of session with SESSION_ID_0 in its c_sessions list.

Postcondition
result != NULL && result->s_session_id == SESSION_ID_0

Definition at line 749 of file conn.c.

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

◆ m0_rpc_conn_session_list_dump()

M0_INTERNAL int m0_rpc_conn_session_list_dump ( const struct m0_rpc_conn conn)

Definition at line 1294 of file conn.c.

Here is the call graph for this function:

◆ m0_rpc_conn_sessions_cancel()

M0_INTERNAL void m0_rpc_conn_sessions_cancel ( struct m0_rpc_conn conn)

Walks through all sessions on the connection and cancels rpc items placed onto session request cache.

Note
Only non-protected rpc items are canceled automatically. See m0_rpc_session_cancel() internals for details.

Definition at line 1324 of file conn.c.

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

◆ m0_rpc_conn_state_to_str()

M0_INTERNAL const char * m0_rpc_conn_state_to_str ( enum m0_rpc_conn_state  state)

Definition at line 1532 of file conn.c.

◆ m0_rpc_conn_terminate()

M0_INTERNAL int m0_rpc_conn_terminate ( struct m0_rpc_conn conn,
m0_time_t  abs_timeout 
)

Sends "conn_terminate" FOP to receiver. m0_rpc_conn_terminate() is a no-op if is already in TERMINATING state.

Use m0_rpc_conn_timedwait() to wait until conn is moved to TERMINATED or FAILED state.

Precondition
(conn_state(conn) == M0_RPC_CONN_ACTIVE && conn->c_nr_sessions == 0 && conn->c_service == NULL) || conn_state(conn) == M0_RPC_CONN_TERMINATING
Postcondition
ergo(rc != 0, conn_state(conn) == M0_RPC_CONN_FAILED)

Definition at line 1009 of file conn.c.

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

◆ m0_rpc_conn_terminate_reply_received()

M0_INTERNAL void m0_rpc_conn_terminate_reply_received ( struct m0_rpc_item req)

Callback routine called through item->ri_ops->rio_replied().

The routine is executed when reply to conn terminate fop is received

Definition at line 1126 of file conn.c.

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

◆ m0_rpc_conn_terminate_reply_sent()

M0_INTERNAL void m0_rpc_conn_terminate_reply_sent ( struct m0_rpc_conn conn)

Cleans up in memory state of rpc connection.

The conn_terminate FOM cannot free in-memory state of rpc connection. Because it needs to send conn_terminate_reply fop, by using session-0 of the rpc connection being terminated. Hence we cleanup in memory state of the conn when conn_terminate_reply has been sent.

Precondition
conn_state(conn) == M0_RPC_CONN_TERMINATING

Definition at line 1237 of file conn.c.

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

◆ m0_rpc_conn_terminate_sync()

M0_INTERNAL int m0_rpc_conn_terminate_sync ( struct m0_rpc_conn conn,
m0_time_t  abs_timeout 
)

Same as m0_rpc_conn_terminate(), but in addition uses m0_rpc_conn_timedwait() to ensure that connection is in terminated state after m0_rpc_conn_terminate() call.

Parameters
connA connection object to operate on.
abs_timeoutAbsolute time after which conn-terminate operation considered as failed and conn is moved to FAILED state.
Precondition
(conn_state(conn) == M0_RPC_CONN_ACTIVE && conn->c_nr_sessions == 0) || conn_state(conn) == M0_RPC_CONN_TERMINATING
Postcondition
conn_state(conn) == M0_RPC_CONN_TERMINATED

Definition at line 988 of file conn.c.

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

◆ m0_rpc_conn_timedwait()

M0_INTERNAL int m0_rpc_conn_timedwait ( struct m0_rpc_conn conn,
uint64_t  states,
const m0_time_t  abs_timeout 
)

Waits until reaches in any one of states specified by .

Parameters
state_flagscan specify multiple states by using M0_BITS().
abs_timeoutshould not sleep past abs_timeout waiting for conn to reach in desired state.
Returns
0 if reaches in one of the state(s) specified by -ETIMEDOUT if time out has occured before reaches in desired state.

Definition at line 700 of file conn.c.

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

◆ m0_rpc_fom_conn_establish_fini()

M0_INTERNAL void m0_rpc_fom_conn_establish_fini ( struct m0_fom fom)

◆ m0_rpc_fom_conn_establish_tick()

M0_INTERNAL int m0_rpc_fom_conn_establish_tick ( struct m0_fom fom)

Definition at line 175 of file session_foms.c.

Here is the call graph for this function:

◆ m0_rpc_fom_conn_terminate_fini()

M0_INTERNAL void m0_rpc_fom_conn_terminate_fini ( struct m0_fom fom)

◆ m0_rpc_fom_conn_terminate_tick()

M0_INTERNAL int m0_rpc_fom_conn_terminate_tick ( struct m0_fom fom)

Definition at line 591 of file session_foms.c.

Here is the call graph for this function:

◆ m0_rpc_fom_session_establish_fini()

M0_INTERNAL void m0_rpc_fom_session_establish_fini ( struct m0_fom fom)

◆ m0_rpc_fom_session_establish_tick()

M0_INTERNAL int m0_rpc_fom_session_establish_tick ( struct m0_fom fom)

Definition at line 318 of file session_foms.c.

Here is the call graph for this function:

◆ m0_rpc_fom_session_terminate_fini()

M0_INTERNAL void m0_rpc_fom_session_terminate_fini ( struct m0_fom fom)

◆ m0_rpc_fom_session_terminate_tick()

M0_INTERNAL int m0_rpc_fom_session_terminate_tick ( struct m0_fom fom)

Definition at line 436 of file session_foms.c.

Here is the call graph for this function:

◆ m0_rpc_fop_conn_establish_ctx_init()

M0_INTERNAL void m0_rpc_fop_conn_establish_ctx_init ( struct m0_rpc_item item,
struct m0_net_end_point ep 
)
See also
m0_rpc_fop_conn_establish_ctx for more information.

Definition at line 209 of file session_fops.c.

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

◆ m0_rpc_id_generate()

M0_INTERNAL uint64_t m0_rpc_id_generate ( const struct m0_fid uniq_fid)

Takes a unique fid and hashes it with id generated from timestamp seed to generate clusterwide unique RPC id.

Definition at line 96 of file session_utils.c.

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

◆ m0_rpc_item_dispatch()

M0_INTERNAL int m0_rpc_item_dispatch ( struct m0_rpc_item item)

Temporary routine to place fop in a global queue, from where it can be selected for execution.

Todo:
this assumes that the item is a fop.

Definition at line 112 of file session_utils.c.

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

◆ m0_rpc_item_is_conn_establish()

M0_INTERNAL bool m0_rpc_item_is_conn_establish ( const struct m0_rpc_item item)

Returns true iff given rpc item is conn_establish.

Definition at line 1258 of file conn.c.

Here is the caller graph for this function:

◆ m0_rpc_item_is_sess_establish()

M0_INTERNAL bool m0_rpc_item_is_sess_establish ( const struct m0_rpc_item item)

Returns true if given rpc item is session_establish.

Definition at line 1264 of file conn.c.

◆ m0_rpc_machine_conn_list_dump()

M0_INTERNAL int m0_rpc_machine_conn_list_dump ( struct m0_rpc_machine machine,
int  dir 
)

Just for debugging purpose. Useful in gdb.

dir = 1, to print incoming conn list dir = 0, to print outgoing conn list

Definition at line 1276 of file conn.c.

Here is the call graph for this function:

◆ m0_rpc_rcv_conn_init()

M0_INTERNAL int m0_rpc_rcv_conn_init ( struct m0_rpc_conn conn,
struct m0_net_end_point ep,
struct m0_rpc_machine machine,
const struct m0_uint128 uuid 
)

Initalises receiver end of conn object.

Postcondition
ergo(result == 0, conn_state(conn) == M0_RPC_CONN_INITIALISED && conn->c_rpc_machine == machine && conn->c_sender_id == SENDER_ID_INVALID && (conn->c_flags & RCF_RECV_END) != 0)

Definition at line 525 of file conn.c.

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

◆ m0_rpc_rcv_conn_terminate()

M0_INTERNAL int m0_rpc_rcv_conn_terminate ( struct m0_rpc_conn conn)

Terminates receiver end of rpc connection.

Terminates alive sessions if any.

Precondition
conn_state(conn) == M0_RPC_CONN_ACTIVE
Postcondition
ergo(result == 0, conn_state(conn) == M0_RPC_CONN_TERMINATED)

Definition at line 1217 of file conn.c.

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

◆ m0_rpc_rcv_session_terminate()

M0_INTERNAL int m0_rpc_rcv_session_terminate ( struct m0_rpc_session session)

Terminates receiver end of session.

Precondition
session->s_state == M0_RPC_SESSION_IDLE
Postcondition
ergo(result == 0, session->s_state == M0_RPC_SESSION_TERMINATED)
ergo(result != 0 && session->s_rc != 0, session->s_state == M0_RPC_SESSION_FAILED)

Definition at line 822 of file session.c.

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

◆ m0_rpc_session_cancel()

M0_INTERNAL void m0_rpc_session_cancel ( struct m0_rpc_session session)

Iterates over all the items 'submitted to RPC and which are yet to receive reply' and invokes m0_rpc_item_cancel() for each of those.

Definition at line 850 of file session.c.

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

◆ m0_rpc_session_create()

M0_INTERNAL int m0_rpc_session_create ( struct m0_rpc_session session,
struct m0_rpc_conn conn,
m0_time_t  abs_timeout 
)

A combination of m0_rpc_session_init() and m0_rpc_session_establish_sync() in a single routine - initialize session object, establish a session and wait until it become idle.

Definition at line 352 of file session.c.

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

◆ m0_rpc_session_default_home_locality()

M0_INTERNAL size_t m0_rpc_session_default_home_locality ( const struct m0_fom fom)

Definition at line 167 of file session_foms.c.

Here is the call graph for this function:

◆ m0_rpc_session_destroy()

int m0_rpc_session_destroy ( struct m0_rpc_session session,
m0_time_t  abs_timeout 
)

A combination of m0_rpc_session_terminate_sync() and m0_rpc_session_fini() in a single routine - terminate the session, wait until it switched to terminated state and finalize session object.

Definition at line 559 of file session.c.

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

◆ m0_rpc_session_establish()

M0_INTERNAL int m0_rpc_session_establish ( struct m0_rpc_session session,
m0_time_t  abs_timeout 
)

Sends a SESSION_ESTABLISH fop across pre-defined session-0 in session->s_conn. Use m0_rpc_session_timedwait() to wait until session reaches IDLE or FAILED state.

Precondition
session_state(session) == M0_RPC_SESSION_INITIALISED
conn_state(session->s_conn) == M0_RPC_CONN_ACTIVE
Postcondition
ergo(result != 0, session_state(session) == M0_RPC_SESSION_FAILED)

Definition at line 390 of file session.c.

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

◆ m0_rpc_session_establish_reply_received()

M0_INTERNAL void m0_rpc_session_establish_reply_received ( struct m0_rpc_item req)

Callback routine called through item->ri_ops->rio_replied().

The routine is executed when reply to session create fop is received

Definition at line 487 of file session.c.

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

◆ m0_rpc_session_establish_sync()

M0_INTERNAL int m0_rpc_session_establish_sync ( struct m0_rpc_session session,
m0_time_t  abs_timeout 
)

Same as m0_rpc_session_establish(), but in addition uses m0_rpc_session_timedwait() to ensure that session is in idle state after m0_rpc_session_establish() call.

Parameters
sessionA session object to operate on.
abs_timeoutAbsolute time after which session establish operation is aborted and session is moved to FAILED state.
Precondition
session_state(session) == M0_RPC_SESSION_INITIALISED
conn_state(session->s_conn) == M0_RPC_CONN_ACTIVE
Postcondition
session_state(session) == M0_RPC_SESSION_IDLE

Definition at line 370 of file session.c.

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

◆ m0_rpc_session_fini()

M0_INTERNAL void m0_rpc_session_fini ( struct m0_rpc_session session)

Finalises session object

Precondition
M0_IN(session_state(session), (M0_RPC_SESSION_TERMINATED, M0_RPC_SESSION_FAILED, M0_RPC_SESSION_INITIALISED))

Definition at line 292 of file session.c.

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

◆ m0_rpc_session_fini_locked()

M0_INTERNAL void m0_rpc_session_fini_locked ( struct m0_rpc_session session)

Definition at line 310 of file session.c.

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

◆ m0_rpc_session_fop_fini()

M0_INTERNAL void m0_rpc_session_fop_fini ( void  )

Definition at line 129 of file session_fops.c.

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

◆ m0_rpc_session_fop_init()

M0_INTERNAL int m0_rpc_session_fop_init ( void  )

Definition at line 147 of file session_fops.c.

Here is the caller graph for this function:

◆ m0_rpc_session_get_max_item_payload_size()

M0_INTERNAL m0_bcount_t m0_rpc_session_get_max_item_payload_size ( const struct m0_rpc_session session)

Returns maximum possible size of RPC item payload.

Definition at line 775 of file session.c.

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

◆ m0_rpc_session_get_max_item_size()

M0_INTERNAL m0_bcount_t m0_rpc_session_get_max_item_size ( const struct m0_rpc_session session)

Returns maximum size of an RPC item allowed on this session.

Definition at line 767 of file session.c.

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

◆ m0_rpc_session_hold_busy()

M0_INTERNAL void m0_rpc_session_hold_busy ( struct m0_rpc_session session)

Holds a session in BUSY state. Every call to m0_rpc_session_hold_busy() must accompany call to m0_rpc_session_release()

Precondition
M0_IN(session_state(session), (M0_RPC_SESSION_IDLE, M0_RPC_SESSION_BUSY))
m0_rpc_machine_is_locked(session_machine(session))
Postcondition
session_state(session) == M0_RPC_SESSION_BUSY

Definition at line 782 of file session.c.

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

◆ m0_rpc_session_init()

M0_INTERNAL int m0_rpc_session_init ( struct m0_rpc_session session,
struct m0_rpc_conn conn 
)

Initialises all fields of session. No network communication is involved.

Parameters
sessionsession being initialised
connrpc connection with which this session is associated
Postcondition
ergo(rc == 0, session_state(session) == M0_RPC_SESSION_INITIALISED && session->s_conn == conn && session->s_session_id == SESSION_ID_INVALID)

Definition at line 204 of file session.c.

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

◆ m0_rpc_session_init_locked()

M0_INTERNAL int m0_rpc_session_init_locked ( struct m0_rpc_session session,
struct m0_rpc_conn conn 
)

Definition at line 223 of file session.c.

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

◆ m0_rpc_session_invariant()

M0_INTERNAL bool m0_rpc_session_invariant ( const struct m0_rpc_session session)

The routine is also called from session_foms.c, hence can't be static

checks internal consistency of session

Definition at line 155 of file session.c.

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

◆ m0_rpc_session_is_cancelled()

M0_INTERNAL bool m0_rpc_session_is_cancelled ( struct m0_rpc_session session)

Checks if a session is marked as cancelled.

Definition at line 875 of file session.c.

Here is the caller graph for this function:

◆ m0_rpc_session_is_idle()

M0_INTERNAL bool m0_rpc_session_is_idle ( const struct m0_rpc_session session)

Definition at line 199 of file session.c.

Here is the caller graph for this function:

◆ m0_rpc_session_item_failed()

M0_INTERNAL void m0_rpc_session_item_failed ( struct m0_rpc_item item)

Definition at line 880 of file session.c.

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

◆ m0_rpc_session_module_fini()

M0_INTERNAL void m0_rpc_session_module_fini ( void  )

Finalises all session realted fop types

Definition at line 52 of file session_utils.c.

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

◆ m0_rpc_session_module_init()

M0_INTERNAL int m0_rpc_session_module_init ( void  )

Initialises all the session related fop types

Definition at line 47 of file session_utils.c.

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

◆ m0_rpc_session_pop()

M0_INTERNAL struct m0_rpc_session * m0_rpc_session_pop ( const struct m0_rpc_conn conn)

Pops first valid session from conn->c_sessions list

See also
m0_rpc_session_search for more details

Definition at line 790 of file conn.c.

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

◆ m0_rpc_session_quiesce()

M0_INTERNAL void m0_rpc_session_quiesce ( struct m0_rpc_session session)

Does forced session state transition: ESTABLISHING –> IDLE Intended to prepare non-established session for termination.

Definition at line 836 of file session.c.

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

◆ m0_rpc_session_release()

M0_INTERNAL void m0_rpc_session_release ( struct m0_rpc_session session)

Decrements hold count. Moves session to IDLE state if it becomes idle.

Precondition
session_state(session) == M0_RPC_SESSION_BUSY
session->s_hold_cnt > 0
m0_rpc_machine_is_locked(session_machine(session))
Postcondition
ergo(m0_rpc_session_is_idle(session), session_state(session) == M0_RPC_SESSION_IDLE)

Definition at line 791 of file session.c.

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

◆ m0_rpc_session_reset()

M0_INTERNAL void m0_rpc_session_reset ( struct m0_rpc_session session)

Definition at line 260 of file session.c.

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

◆ m0_rpc_session_search()

M0_INTERNAL struct m0_rpc_session * m0_rpc_session_search ( const struct m0_rpc_conn conn,
uint64_t  session_id 
)

Searches in conn->c_sessions list, a session object whose session id matches with given .

Caller is expected to decide whether conn will be locked or not The function is also called from session_foms.c, that's why is not static.

Returns
pointer to session if found, NULL otherwise
Postcondition
ergo(result != NULL, result->s_session_id == session_id)

Definition at line 760 of file conn.c.

Here is the caller graph for this function:

◆ m0_rpc_session_search_and_pop()

M0_INTERNAL struct m0_rpc_session * m0_rpc_session_search_and_pop ( const struct m0_rpc_conn conn,
uint64_t  session_id 
)

Searches in conn->c_sessions list, a session object whose session id matches with given and pops it from this list.

See also
m0_rpc_session_search for more details

Definition at line 772 of file conn.c.

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

◆ m0_rpc_session_state_to_str()

M0_INTERNAL const char * m0_rpc_session_state_to_str ( enum m0_rpc_session_state  state)

Transforms m0_rpc_session_state value to string

Definition at line 892 of file session.c.

Here is the caller graph for this function:

◆ m0_rpc_session_terminate()

M0_INTERNAL int m0_rpc_session_terminate ( struct m0_rpc_session session,
m0_time_t  abs_timeout 
)

Sends terminate session fop to receiver. Acts as no-op if session is already in TERMINATING state. Does not wait for reply. Use m0_rpc_session_timedwait() to wait until session reaches TERMINATED or FAILED state.

Precondition
M0_IN(session_state(session), (M0_RPC_SESSION_IDLE, M0_RPC_SESSION_TERMINATING))
Postcondition
ergo(rc != 0, session_state(session) == M0_RPC_SESSION_FAILED)

Definition at line 622 of file session.c.

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

◆ m0_rpc_session_terminate_reply_received()

M0_INTERNAL void m0_rpc_session_terminate_reply_received ( struct m0_rpc_item req)

Callback routine called through item->ri_ops->rio_replied().

The routine is executed when reply to session terminate fop is received

Definition at line 715 of file session.c.

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

◆ m0_rpc_session_terminate_sync()

M0_INTERNAL int m0_rpc_session_terminate_sync ( struct m0_rpc_session session,
m0_time_t  abs_timeout 
)

Same as m0_rpc_session_terminate(), but in addition uses m0_rpc_session_timedwait() to ensure that session is in terminated state after m0_rpc_session_terminate() call.

Parameters
sessionA session object to operate on.
abs_timeoutAbsolute time after which session terminate operation is considered as failed and session is moved to FAILED state.
Precondition
M0_IN(session_state(session), (M0_RPC_SESSION_IDLE, M0_RPC_SESSION_BUSY, M0_RPC_SESSION_TERMINATING))
Postcondition
M0_IN(session_state(session), (M0_RPC_SESSION_TERMINATED, M0_RPC_SESSION_FAILED))

Definition at line 592 of file session.c.

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

◆ m0_rpc_session_timedwait()

M0_INTERNAL int m0_rpc_session_timedwait ( struct m0_rpc_session session,
uint64_t  states,
const m0_time_t  abs_timeout 
)

Waits until object reaches in one of states given by .

Parameters
statescan specify multiple states by using M0_BITS()
abs_timeoutthread does not sleep past abs_timeout waiting for conn to reach in desired state.
Returns
0 if session reaches in one of the state(s) specified by -ETIMEDOUT if time out has occured before session reaches in desired state.

Definition at line 332 of file session.c.

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

◆ m0_rpc_session_validate()

M0_INTERNAL int m0_rpc_session_validate ( struct m0_rpc_session session)

Validates if session allows posting items. Validation includes testing session state as well as connection and rpc machine pointers being not NULL.

Definition at line 573 of file session.c.

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

◆ M0_TL_DECLARE() [1/2]

M0_TL_DECLARE ( rpc_session  ,
M0_INTERNAL  ,
struct m0_rpc_session   
)

◆ M0_TL_DECLARE() [2/2]

M0_TL_DECLARE ( pending_item  ,
M0_INTERNAL  ,
struct m0_rpc_item   
)

◆ M0_TL_DEFINE()

M0_TL_DEFINE ( rpc_session  ,
M0_INTERNAL  ,
struct m0_rpc_session   
)

◆ M0_TL_DESCR_DECLARE() [1/2]

M0_TL_DESCR_DECLARE ( rpc_session  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DECLARE() [2/2]

M0_TL_DESCR_DECLARE ( pending_item  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DEFINE()

M0_TL_DESCR_DEFINE ( rpc_session  ,
"rpc-sessions"  ,
M0_INTERNAL  ,
struct m0_rpc_session  ,
s_link  ,
s_magic  ,
M0_RPC_SESSION_MAGIC  ,
M0_RPC_SESSION_HEAD_MAGIC   
)

◆ M0_XCA_DOMAIN()

struct m0_rpc_fop_conn_establish M0_XCA_DOMAIN ( rpc  )

◆ reqh_service_ha_state_set()

static void reqh_service_ha_state_set ( struct m0_rpc_conn conn,
uint8_t  state 
)
static

Definition at line 1480 of file conn.c.

Here is the call graph for this function:

◆ rpc_chan_get()

M0_INTERNAL struct m0_rpc_chan* rpc_chan_get ( struct m0_rpc_machine machine,
struct m0_net_end_point dest_ep,
uint64_t  max_rpcs_in_flight 
)

Definition at line 635 of file rpc_machine.c.

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

◆ rpc_chan_put()

M0_INTERNAL void rpc_chan_put ( struct m0_rpc_chan chan)

Definition at line 729 of file rpc_machine.c.

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

◆ rpc_conn2confc()

static struct m0_confc * rpc_conn2confc ( const struct m0_rpc_conn conn)
static

Definition at line 343 of file conn.c.

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

◆ rpc_conn__on_cache_expired_cb()

static bool rpc_conn__on_cache_expired_cb ( struct m0_clink clink)
static

Definition at line 1390 of file conn.c.

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

◆ rpc_conn__on_cache_ready_cb()

static bool rpc_conn__on_cache_ready_cb ( struct m0_clink clink)
static
Todo:
See if we can act any smarter than just log the subscription error. Please note, -ENOENT code is normal in the situation when the connection previously was established to a service that appears abandoned when conf updates.

Definition at line 1367 of file conn.c.

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

◆ rpc_conn__on_service_event_cb()

static bool rpc_conn__on_service_event_cb ( struct m0_clink clink)
static

Callback called on HA notification for conf service object the connection is established to. In case service found dead, all outgoing requests in all sessions associated with the connection are canceled.

Todo:
See if to __conn_ha_unsubscribe() right now, but not wait until rpc connection getting finalised.
Todo:
See if anything, or what and when otherwise, we need to do on getting M0_NC_ONLINE notification.

Definition at line 1342 of file conn.c.

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

◆ rpc_conn_ha_timer_cb()

static void rpc_conn_ha_timer_cb ( struct m0_sm_timer timer)
static

HA needs to be notified in case rpc item is not replied within the timer's interval. This is to indicate that peered service may experience issues with networking, and thus the service status has to be considered M0_NC_TRANSIENT until reply comes back to sender.

Note
The update is to be sent on every timer triggering, i.e. on every re-send of the item.

See item__on_reply_postprocess() for complimentary part of the item's processing.

Definition at line 1459 of file conn.c.

Here is the call graph for this function:

◆ rpc_conn_sessions_cleanup_fail()

static void rpc_conn_sessions_cleanup_fail ( struct m0_rpc_conn conn,
bool  fail 
)
static

Connection's session list cleanup omitting session0. When instructed to fail, all finalising sessions are put to failed state. Otherwise are waited for getting to idle state before being finalised.

Note
Currently, sessions are to fail in case rpc connection is found dead while terminating. See m0_rpc_conn_terminate().

Definition at line 1187 of file conn.c.

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

◆ rpc_tick_ret()

static int rpc_tick_ret ( struct m0_rpc_session session,
struct m0_fom fom,
int  next_state 
)
static

Definition at line 134 of file session_foms.c.

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

◆ session_establish_fop_release()

static void session_establish_fop_release ( struct m0_ref ref)
static

Definition at line 548 of file session.c.

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

◆ session_failed()

static void session_failed ( struct m0_rpc_session session,
int32_t  error 
)
static

Moves session to FAILED state and take it out of conn->c_sessions list.

Precondition
m0_mutex_is_locked(&session->s_mutex)
M0_IN(session_state(session), (M0_RPC_SESSION_INITIALISED, M0_RPC_SESSION_ESTABLISHING, M0_RPC_SESSION_IDLE, M0_RPC_SESSION_BUSY, M0_RPC_SESSION_TERMINATING))

Definition at line 474 of file session.c.

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

◆ session_gen_fom_create()

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

implementation of fop->f_type->ft_fom_type.ft_ops->fto_create for conn establish, conn terminate, session establish, session terminate fop types.

Definition at line 61 of file session_foms.c.

Here is the call graph for this function:

◆ session_gen_fom_fini()

static void session_gen_fom_fini ( struct m0_fom fom)
static

Common implementation of m0_fom::fo_ops::fo_fini() for conn establish, conn terminate, session establish and session terminate foms

See also
session_gen_fom_create

Definition at line 50 of file session_foms.c.

Here is the call graph for this function:

◆ session_idle_x_busy()

static void session_idle_x_busy ( struct m0_rpc_session session)
static

Perform (IDLE -> BUSY) or (BUSY -> IDLE) transition if required

Definition at line 804 of file session.c.

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

◆ session_machine()

M0_INTERNAL struct m0_rpc_machine * session_machine ( const struct m0_rpc_session s)

Definition at line 147 of file session.c.

Here is the caller graph for this function:

◆ session_state()

M0_INTERNAL int session_state ( const struct m0_rpc_session session)

Definition at line 141 of file session.c.

Here is the caller graph for this function:

◆ session_state_set()

M0_INTERNAL void session_state_set ( struct m0_rpc_session session,
int  state 
)

Definition at line 131 of file session.c.

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

◆ session_zero_attach()

static int session_zero_attach ( struct m0_rpc_conn conn)
static

Attaches session 0 object to conn object.

Definition at line 470 of file conn.c.

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

◆ session_zero_detach()

static void session_zero_detach ( struct m0_rpc_conn conn)
static

Detaches session 0 from conn

Definition at line 682 of file conn.c.

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

Variable Documentation

◆ conn_conf

const struct m0_sm_conf conn_conf
static
Initial value:
= {
.scf_name = "Conn states",
.scf_nr_states = ARRAY_SIZE(conn_states),
.scf_state = conn_states
}
static struct m0_sm_state_descr conn_states[]
Definition: conn.c:119
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 161 of file conn.c.

◆ conn_establish_item_ops

const struct m0_rpc_item_ops conn_establish_item_ops
static
Initial value:
= {
}
M0_INTERNAL void m0_rpc_conn_establish_reply_received(struct m0_rpc_item *item)
Definition: conn.c:926

Definition at line 111 of file conn.c.

◆ conn_establish_item_type_ops

struct m0_rpc_item_type_ops conn_establish_item_type_ops
static
Initial value:
= {
}
static int conn_establish_item_decode(const struct m0_rpc_item_type *item_type, struct m0_rpc_item **item, struct m0_bufvec_cursor *cur)
Definition: session_fops.c:81
#define M0_FOP_DEFAULT_ITEM_TYPE_OPS
Definition: fop.h:184

Definition at line 115 of file session_fops.c.

◆ conn_states

struct m0_sm_state_descr conn_states[]
static

Definition at line 119 of file conn.c.

◆ conn_terminate_item_ops

const struct m0_rpc_item_ops conn_terminate_item_ops
static
Initial value:
= {
}
M0_INTERNAL void m0_rpc_conn_terminate_reply_received(struct m0_rpc_item *item)
Definition: conn.c:1126

Definition at line 115 of file conn.c.

◆ conn_terminate_reply_item_ops

const struct m0_rpc_item_ops conn_terminate_reply_item_ops
static
Initial value:
= {
}
static void conn_terminate_reply_sent_cb(struct m0_rpc_item *item)
Definition: session_foms.c:566

Definition at line 587 of file session_foms.c.

◆ m0_rpc_fom_conn_establish_ops [1/2]

const struct m0_fom_ops m0_rpc_fom_conn_establish_ops
Initial value:
= {
}
M0_INTERNAL size_t m0_rpc_session_default_home_locality(const struct m0_fom *fom)
Definition: session_foms.c:167
static void session_gen_fom_fini(struct m0_fom *fom)
Definition: session_foms.c:50
M0_INTERNAL int m0_rpc_fom_conn_establish_tick(struct m0_fom *fom)
Definition: session_foms.c:175

Definition at line 157 of file session_foms.c.

◆ m0_rpc_fom_conn_establish_ops [2/2]

const struct m0_fom_ops m0_rpc_fom_conn_establish_ops

Definition at line 157 of file session_foms.c.

◆ m0_rpc_fom_conn_establish_type

struct m0_fom_type m0_rpc_fom_conn_establish_type

◆ m0_rpc_fom_conn_establish_type_ops [1/2]

struct m0_fom_type_ops m0_rpc_fom_conn_establish_type_ops

Definition at line 163 of file session_foms.c.

◆ m0_rpc_fom_conn_establish_type_ops [2/2]

struct m0_fom_type_ops m0_rpc_fom_conn_establish_type_ops
Initial value:
= {
.fto_create = session_gen_fom_create
}
static int session_gen_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: session_foms.c:61

Definition at line 163 of file session_foms.c.

◆ m0_rpc_fom_conn_terminate_ops [1/2]

const struct m0_fom_ops m0_rpc_fom_conn_terminate_ops

Definition at line 548 of file session_foms.c.

◆ m0_rpc_fom_conn_terminate_ops [2/2]

const struct m0_fom_ops m0_rpc_fom_conn_terminate_ops
Initial value:
= {
}
M0_INTERNAL int m0_rpc_fom_conn_terminate_tick(struct m0_fom *fom)
Definition: session_foms.c:591
M0_INTERNAL size_t m0_rpc_session_default_home_locality(const struct m0_fom *fom)
Definition: session_foms.c:167
static void session_gen_fom_fini(struct m0_fom *fom)
Definition: session_foms.c:50

Definition at line 548 of file session_foms.c.

◆ m0_rpc_fom_conn_terminate_type

struct m0_fom_type m0_rpc_fom_conn_terminate_type

◆ m0_rpc_fom_conn_terminate_type_ops [1/2]

struct m0_fom_type_ops m0_rpc_fom_conn_terminate_type_ops

Definition at line 554 of file session_foms.c.

◆ m0_rpc_fom_conn_terminate_type_ops [2/2]

struct m0_fom_type_ops m0_rpc_fom_conn_terminate_type_ops
Initial value:
= {
.fto_create = session_gen_fom_create
}
static int session_gen_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: session_foms.c:61

Definition at line 554 of file session_foms.c.

◆ m0_rpc_fom_sess_conn_term_phases

struct m0_sm_state_descr m0_rpc_fom_sess_conn_term_phases[]
static
Initial value:
= {
.sd_name = "m0_rpc_fom_sess_conn_term_phases init",
.sd_flags = M0_SDF_INITIAL
},
.sd_name = "m0_rpc_fom_sess_conn_term_phases wait",
},
.sd_name = "m0_rpc_fom_sess_conn_term_phases done",
.sd_flags = M0_SDF_TERMINAL
}
}
#define M0_BITS(...)
Definition: misc.h:236

Definition at line 42 of file session_fops.c.

◆ m0_rpc_fom_sess_conn_term_phases_sm_conf

M0_INTERNAL const struct m0_sm_conf m0_rpc_fom_sess_conn_term_phases_sm_conf
Initial value:
= {
.scf_name = "rpc_fom_session_terminate fom",
}
static struct m0_sm_state_descr m0_rpc_fom_sess_conn_term_phases[]
Definition: session_fops.c:42
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 59 of file session_fops.c.

◆ m0_rpc_fom_session_establish_ops [1/2]

const struct m0_fom_ops m0_rpc_fom_session_establish_ops

Definition at line 308 of file session_foms.c.

◆ m0_rpc_fom_session_establish_ops [2/2]

const struct m0_fom_ops m0_rpc_fom_session_establish_ops
Initial value:
= {
}
M0_INTERNAL size_t m0_rpc_session_default_home_locality(const struct m0_fom *fom)
Definition: session_foms.c:167
static void session_gen_fom_fini(struct m0_fom *fom)
Definition: session_foms.c:50
M0_INTERNAL int m0_rpc_fom_session_establish_tick(struct m0_fom *fom)
Definition: session_foms.c:318

Definition at line 308 of file session_foms.c.

◆ m0_rpc_fom_session_establish_type

struct m0_fom_type m0_rpc_fom_session_establish_type

◆ m0_rpc_fom_session_establish_type_ops [1/2]

struct m0_fom_type_ops m0_rpc_fom_session_establish_type_ops

Definition at line 314 of file session_foms.c.

◆ m0_rpc_fom_session_establish_type_ops [2/2]

struct m0_fom_type_ops m0_rpc_fom_session_establish_type_ops
Initial value:
= {
.fto_create = session_gen_fom_create
}
static int session_gen_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: session_foms.c:61

Definition at line 314 of file session_foms.c.

◆ m0_rpc_fom_session_terminate_ops [1/2]

const struct m0_fom_ops m0_rpc_fom_session_terminate_ops

Definition at line 426 of file session_foms.c.

◆ m0_rpc_fom_session_terminate_ops [2/2]

const struct m0_fom_ops m0_rpc_fom_session_terminate_ops
Initial value:
= {
}
M0_INTERNAL int m0_rpc_fom_session_terminate_tick(struct m0_fom *fom)
Definition: session_foms.c:436
M0_INTERNAL size_t m0_rpc_session_default_home_locality(const struct m0_fom *fom)
Definition: session_foms.c:167
static void session_gen_fom_fini(struct m0_fom *fom)
Definition: session_foms.c:50

Definition at line 426 of file session_foms.c.

◆ m0_rpc_fom_session_terminate_type

struct m0_fom_type m0_rpc_fom_session_terminate_type

◆ m0_rpc_fom_session_terminate_type_ops [1/2]

struct m0_fom_type_ops m0_rpc_fom_session_terminate_type_ops

Definition at line 432 of file session_foms.c.

◆ m0_rpc_fom_session_terminate_type_ops [2/2]

struct m0_fom_type_ops m0_rpc_fom_session_terminate_type_ops
Initial value:
= {
.fto_create = session_gen_fom_create
}
static int session_gen_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: session_foms.c:61

Definition at line 432 of file session_foms.c.

◆ m0_rpc_fop_conn_establish_fopt [1/2]

struct m0_fop_type m0_rpc_fop_conn_establish_fopt

Definition at line 120 of file session_fops.c.

◆ m0_rpc_fop_conn_establish_fopt [2/2]

struct m0_fop_type m0_rpc_fop_conn_establish_fopt

Definition at line 120 of file session_fops.c.

◆ m0_rpc_fop_conn_establish_ops

const struct m0_fop_type_ops m0_rpc_fop_conn_establish_ops

◆ m0_rpc_fop_conn_establish_rep_fopt [1/2]

struct m0_fop_type m0_rpc_fop_conn_establish_rep_fopt

Definition at line 121 of file session_fops.c.

◆ m0_rpc_fop_conn_establish_rep_fopt [2/2]

struct m0_fop_type m0_rpc_fop_conn_establish_rep_fopt

Definition at line 121 of file session_fops.c.

◆ m0_rpc_fop_conn_terminate_fopt [1/2]

struct m0_fop_type m0_rpc_fop_conn_terminate_fopt

Definition at line 122 of file session_fops.c.

◆ m0_rpc_fop_conn_terminate_fopt [2/2]

struct m0_fop_type m0_rpc_fop_conn_terminate_fopt

Definition at line 122 of file session_fops.c.

◆ m0_rpc_fop_conn_terminate_ops

const struct m0_fop_type_ops m0_rpc_fop_conn_terminate_ops

◆ m0_rpc_fop_conn_terminate_rep_fopt [1/2]

struct m0_fop_type m0_rpc_fop_conn_terminate_rep_fopt

Definition at line 123 of file session_fops.c.

◆ m0_rpc_fop_conn_terminate_rep_fopt [2/2]

struct m0_fop_type m0_rpc_fop_conn_terminate_rep_fopt

Definition at line 123 of file session_fops.c.

◆ m0_rpc_fop_session_establish_fopt [1/2]

struct m0_fop_type m0_rpc_fop_session_establish_fopt

Definition at line 124 of file session_fops.c.

◆ m0_rpc_fop_session_establish_fopt [2/2]

struct m0_fop_type m0_rpc_fop_session_establish_fopt

Definition at line 124 of file session_fops.c.

◆ m0_rpc_fop_session_establish_ops

const struct m0_fop_type_ops m0_rpc_fop_session_establish_ops

◆ m0_rpc_fop_session_establish_rep_fopt [1/2]

struct m0_fop_type m0_rpc_fop_session_establish_rep_fopt

Definition at line 125 of file session_fops.c.

◆ m0_rpc_fop_session_establish_rep_fopt [2/2]

struct m0_fop_type m0_rpc_fop_session_establish_rep_fopt

Definition at line 125 of file session_fops.c.

◆ m0_rpc_fop_session_terminate_fopt [1/2]

struct m0_fop_type m0_rpc_fop_session_terminate_fopt

Definition at line 126 of file session_fops.c.

◆ m0_rpc_fop_session_terminate_fopt [2/2]

struct m0_fop_type m0_rpc_fop_session_terminate_fopt

Definition at line 126 of file session_fops.c.

◆ m0_rpc_fop_session_terminate_ops

const struct m0_fop_type_ops m0_rpc_fop_session_terminate_ops

◆ m0_rpc_fop_session_terminate_rep_fopt [1/2]

struct m0_fop_type m0_rpc_fop_session_terminate_rep_fopt

Definition at line 127 of file session_fops.c.

◆ m0_rpc_fop_session_terminate_rep_fopt [2/2]

struct m0_fop_type m0_rpc_fop_session_terminate_rep_fopt

Definition at line 127 of file session_fops.c.

◆ m0_rpc_service_type

struct m0_reqh_service_type m0_rpc_service_type

Definition at line 120 of file service.c.

◆ M0_XCA_DOMAIN

enum { ... } M0_XCA_DOMAIN

◆ rpc_conn_ha_cfg

struct m0_rpc_conn_ha_cfg rpc_conn_ha_cfg
static
Initial value:
= {
.rchc_ops = {
.cho_ha_timer_cb = rpc_conn_ha_timer_cb,
.cho_ha_notify = reqh_service_ha_state_set,
},
.rchc_ha_interval = RPC_HA_INTERVAL
}
static void reqh_service_ha_state_set(struct m0_rpc_conn *conn, uint8_t state)
Definition: conn.c:1480
static void rpc_conn_ha_timer_cb(struct m0_sm_timer *timer)
Definition: conn.c:1459

Definition at line 75 of file conn.c.

◆ session_conf

const struct m0_sm_conf session_conf
static
Initial value:
= {
.scf_name = "Session states",
.scf_nr_states = ARRAY_SIZE(session_states),
.scf_state = session_states
}
static struct m0_sm_state_descr session_states[]
Definition: session.c:78
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 125 of file session.c.

◆ session_establish_item_ops

const struct m0_rpc_item_ops session_establish_item_ops
static
Initial value:
= {
}
M0_INTERNAL void m0_rpc_session_establish_reply_received(struct m0_rpc_item *item)
Definition: session.c:487

Definition at line 65 of file session.c.

◆ session_states

struct m0_sm_state_descr session_states[]
static

Definition at line 78 of file session.c.

◆ session_terminate_item_ops

const struct m0_rpc_item_ops session_terminate_item_ops
static
Initial value:
= {
}
M0_INTERNAL void m0_rpc_session_terminate_reply_received(struct m0_rpc_item *item)
Definition: session.c:715

Definition at line 69 of file session.c.