Motr  M0
link.c File Reference
#include "lib/trace.h"
#include "ha/link.h"
#include "lib/memory.h"
#include "lib/errno.h"
#include "lib/tlist.h"
#include "lib/types.h"
#include "lib/misc.h"
#include "lib/time.h"
#include "sm/sm.h"
#include "rpc/rpc.h"
#include "rpc/rpc_opcodes.h"
#include "fop/fom_generic.h"
#include "ha/link_fops.h"
#include "ha/link_service.h"
Include dependency graph for link.c:

Go to the source code of this file.

Data Structures

struct  ha_link_wait_ctx
 
struct  ha_link_incoming_fom
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_HA
 
#define _ST(name, flags, allowed)
 

Enumerations

enum  { HA_LINK_SUPPRESS_START_NR = 3 }
 
enum  ha_link_send_type { HA_LINK_SEND_QUERY, HA_LINK_SEND_POST, HA_LINK_SEND_REPLY }
 
enum  ha_link_outgoing_fom_state {
  HA_LINK_OUTGOING_STATE_INIT = M0_FOM_PHASE_INIT, HA_LINK_OUTGOING_STATE_FINISH = M0_FOM_PHASE_FINISH, HA_LINK_OUTGOING_STATE_INCOMING_REGISTER, HA_LINK_OUTGOING_STATE_INCOMING_DEREGISTER,
  HA_LINK_OUTGOING_STATE_INCOMING_QUIESCE, HA_LINK_OUTGOING_STATE_INCOMING_QUIESCE_WAIT, HA_LINK_OUTGOING_STATE_RPC_LINK_INIT, HA_LINK_OUTGOING_STATE_RPC_LINK_FINI,
  HA_LINK_OUTGOING_STATE_NOT_CONNECTED, HA_LINK_OUTGOING_STATE_CONNECT, HA_LINK_OUTGOING_STATE_CONNECTING, HA_LINK_OUTGOING_STATE_DISCONNECT,
  HA_LINK_OUTGOING_STATE_DISCONNECTING, HA_LINK_OUTGOING_STATE_IDLE, HA_LINK_OUTGOING_STATE_SEND, HA_LINK_OUTGOING_STATE_WAIT_REPLY,
  HA_LINK_OUTGOING_STATE_WAIT_RELEASE, HA_LINK_OUTGOING_STATE_NR
}
 

Functions

 M0_BASSERT (ARRAY_SIZE(ha_link_sm_states)==M0_HA_LINK_STATE_NR)
 
static void ha_link_outgoing_fom_wakeup (struct m0_ha_link *hl)
 
static bool ha_link_rpc_wait_cb (struct m0_clink *clink)
 
static bool ha_link_quiesce_wait_cb (struct m0_clink *clink)
 
M0_INTERNAL int m0_ha_link_init (struct m0_ha_link *hl, struct m0_ha_link_cfg *hl_cfg)
 
M0_INTERNAL void m0_ha_link_fini (struct m0_ha_link *hl)
 
static int ha_link_conn_cfg_copy (struct m0_ha_link_conn_cfg *dst, const struct m0_ha_link_conn_cfg *src)
 
static void ha_link_conn_cfg_free (struct m0_ha_link_conn_cfg *hl_conn_cfg)
 
static void ha_link_tags_apply (struct m0_ha_link *hl, const struct m0_ha_link_params *lp)
 
M0_INTERNAL void m0_ha_link_start (struct m0_ha_link *hl, struct m0_ha_link_conn_cfg *hl_conn_cfg)
 
M0_INTERNAL void m0_ha_link_stop (struct m0_ha_link *hl, struct m0_clink *clink)
 
M0_INTERNAL void m0_ha_link_reconnect_begin (struct m0_ha_link *hl, struct m0_ha_link_params *lp)
 
M0_INTERNAL void m0_ha_link_reconnect_end (struct m0_ha_link *hl, const struct m0_ha_link_conn_cfg *hl_conn_cfg)
 
M0_INTERNAL void m0_ha_link_reconnect_cancel (struct m0_ha_link *hl)
 
M0_INTERNAL void m0_ha_link_reconnect_params (const struct m0_ha_link_params *lp_alive, struct m0_ha_link_params *lp_alive_new, struct m0_ha_link_params *lp_dead_new, const struct m0_uint128 *id_alive, const struct m0_uint128 *id_dead, const struct m0_uint128 *id_connection)
 
M0_INTERNAL struct m0_chanm0_ha_link_chan (struct m0_ha_link *hl)
 
M0_INTERNAL enum m0_ha_link_state m0_ha_link_state_get (struct m0_ha_link *hl)
 
M0_INTERNAL const char * m0_ha_link_state_name (enum m0_ha_link_state state)
 
M0_INTERNAL void m0_ha_link_send (struct m0_ha_link *hl, const struct m0_ha_msg *msg, uint64_t *tag)
 
M0_INTERNAL struct m0_ha_msgm0_ha_link_recv (struct m0_ha_link *hl, uint64_t *tag)
 
M0_INTERNAL void m0_ha_link_delivered (struct m0_ha_link *hl, struct m0_ha_msg *msg)
 
M0_INTERNAL bool m0_ha_link_msg_is_delivered (struct m0_ha_link *hl, uint64_t tag)
 
M0_INTERNAL uint64_t m0_ha_link_delivered_consume (struct m0_ha_link *hl)
 
M0_INTERNAL uint64_t m0_ha_link_not_delivered_consume (struct m0_ha_link *hl)
 
static void ha_link_wait (struct ha_link_wait_ctx *wait_ctx, bool(*check)(struct m0_clink *clink))
 
static bool ha_link_wait_delivery_check (struct m0_clink *clink)
 
M0_INTERNAL void m0_ha_link_wait_delivery (struct m0_ha_link *hl, uint64_t tag)
 
static bool ha_link_wait_arrival_check (struct m0_clink *clink)
 
M0_INTERNAL void m0_ha_link_wait_arrival (struct m0_ha_link *hl)
 
static bool ha_link_wait_confirmation_check (struct m0_clink *clink)
 
M0_INTERNAL void m0_ha_link_wait_confirmation (struct m0_ha_link *hl, uint64_t tag)
 
M0_INTERNAL void m0_ha_link_flush (struct m0_ha_link *hl)
 
M0_INTERNAL void m0_ha_link_cb_disconnecting (struct m0_ha_link *hl)
 
M0_INTERNAL void m0_ha_link_cb_reused (struct m0_ha_link *hl)
 
static void ha_link_tags_update (struct m0_ha_link *hl, uint64_t out_next, uint64_t in_delivered)
 
static void ha_link_tags_in_out (struct m0_ha_link *hl, uint64_t *out_next, uint64_t *in_delivered)
 
static void ha_link_msg_received (struct m0_ha_link *hl, const struct m0_ha_msg *msg)
 
static void ha_link_msg_recv_or_delivery_broadcast (struct m0_ha_link *hl)
 
static struct ha_link_incoming_fomha_link_incoming_fom_container (struct m0_fom *fom)
 
static int ha_link_incoming_fom_tick (struct m0_fom *fom)
 
static void ha_link_incoming_fom_fini (struct m0_fom *fom)
 
static size_t ha_link_incoming_fom_locality (const struct m0_fom *fom)
 
static int ha_link_incoming_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
 
static void ha_link_outgoing_item_sent (struct m0_rpc_item *item)
 
static void ha_link_outgoing_item_replied (struct m0_rpc_item *item)
 
static void ha_link_outgoing_fop_release (struct m0_ref *ref)
 
static int ha_link_outgoing_fop_send (struct m0_ha_link *hl)
 
static bool ha_link_backoff_check (struct m0_ha_link *hl, int rc, uint64_t *nr, int *old_rc, uint64_t *old_nr)
 
static int ha_link_outgoing_fop_replied (struct m0_ha_link *hl)
 
static bool ha_link_q_in_confirm_all (struct m0_ha_link *hl)
 
static void ha_link_cb_disconnecting_reused (struct m0_ha_link *hl)
 
static void ha_link_outgoing_reconnect_timeout (struct m0_sm_timer *timer)
 
static int ha_link_outgoing_fom_tick (struct m0_fom *fom)
 
static void ha_link_outgoing_fom_wakeup_ast (struct m0_sm_group *gr, struct m0_sm_ast *ast)
 
static void ha_link_outgoing_fom_fini (struct m0_fom *fom)
 
static size_t ha_link_outgoing_fom_locality (const struct m0_fom *fom)
 
static int ha_link_outgoing_fom_create (struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
 
M0_INTERNAL struct m0_rpc_sessionm0_ha_link_rpc_session (struct m0_ha_link *hl)
 
M0_INTERNAL void m0_ha_link_rpc_endpoint (struct m0_ha_link *hl, char *buf, m0_bcount_t buf_len)
 
M0_INTERNAL int m0_ha_link_mod_init (void)
 
M0_INTERNAL void m0_ha_link_mod_fini (void)
 

Variables

static struct m0_sm_state_descr ha_link_sm_states []
 
static struct m0_sm_conf ha_link_sm_conf
 
static struct m0_fom_type ha_link_outgoing_fom_type
 
const struct m0_fom_ops ha_link_outgoing_fom_ops
 
const struct m0_fom_ops ha_link_incoming_fom_ops
 
const struct m0_fom_type_ops m0_ha_link_incoming_fom_type_ops
 
static struct m0_sm_state_descr ha_link_outgoing_fom_states [HA_LINK_OUTGOING_STATE_NR]
 
static const struct m0_sm_conf ha_link_outgoing_fom_conf
 
static const struct m0_rpc_item_ops ha_link_outgoing_item_ops
 
const struct m0_fom_type_ops m0_ha_link_outgoing_fom_type_ops
 

Macro Definition Documentation

◆ _ST

#define _ST (   name,
  flags,
  allowed 
)
Value:
[name] = { \
.sd_flags = flags, \
.sd_name = #name, \
.sd_allowed = allowed \
}
int const char const void size_t int flags
Definition: dir.c:328
const char * name
Definition: trace.c:110