Motr  M0
m0_rpc_frm Struct Reference

#include <formation2_internal.h>

Collaboration diagram for m0_rpc_frm:
Collaboration graph

Data Fields

enum frm_state f_state
 
struct m0_tl f_itemq [FRMQ_NR_QUEUES]
 
uint64_t f_nr_items
 
m0_bcount_t f_nr_bytes_accumulated
 
uint64_t f_nr_packets_enqed
 
struct m0_rpc_frm_constraints f_constraints
 
const struct m0_rpc_frm_opsf_ops
 
uint64_t f_magic
 

Detailed Description

Formation state machine.

There is one instance of m0_rpc_frm for each destination end-point.

Events in which the formation state machine is interested are:

  • RPC item is posted for sending
  • RPC packet has been sent or packet sending is failed
  • deadline timer of WAITING item is expired

Events that formation machine triggers for rest of RPC are:

  • Packet is ready for sending
                FRM_UNINITIALISED
                      |  ^
     m0_rpc_frm_init()|  |
                      |  | m0_rpc_frm_fini()
                      V  |
                    FRM_IDLE
                      |  ^
 m0_rpc_frm_enq_item()|  | frm_itemq_remove() or m0_rpc_frm_packet_done()
   [frm_is_idle()]    |  | [!frm_is_idle()]
                      V  |
                    FRM_BUSY

Concurrency and Existence:
Access to m0_rpc_frm instance is synchronised by m0_rpc_machine::rm_sm_grp::s_lock.

m0_rpc_frm is not reference counted. It is responsibility of user to free m0_rpc_frm. Ensuring that m0_rpc_frm is in IDLE state, before finalising it, is left to user.

See also
frm_invariant()

Definition at line 194 of file formation2_internal.h.

Field Documentation

◆ f_constraints

struct m0_rpc_frm_constraints f_constraints

Limits that formation should respect

Definition at line 228 of file formation2_internal.h.

◆ f_itemq

struct m0_tl f_itemq[FRMQ_NR_QUEUES]

Lists of items enqueued to Formation that are not yet added to any Packet.

See also
m0_rpc_frm_itemq_type itemq are sorted by m0_rpc_item::ri_prio (highest priority first). All items having equal priority are sorted by m0_rpc_item::ri_deadline (earlier first). An item is removed from itemq immediately upon adding the item to any packet. link: m0_rpc_item::ri_iq_link descriptor: itemq

Definition at line 216 of file formation2_internal.h.

◆ f_magic

uint64_t f_magic

FRM_MAGIC

Definition at line 233 of file formation2_internal.h.

◆ f_nr_bytes_accumulated

m0_bcount_t f_nr_bytes_accumulated

Sum of on-wire size of all the items in itemq

Definition at line 222 of file formation2_internal.h.

◆ f_nr_items

uint64_t f_nr_items

Total number of items waiting in itemq

Definition at line 219 of file formation2_internal.h.

◆ f_nr_packets_enqed

uint64_t f_nr_packets_enqed

Number of packets for which "Packet done" callback is pending

Definition at line 225 of file formation2_internal.h.

◆ f_ops

const struct m0_rpc_frm_ops* f_ops

Definition at line 230 of file formation2_internal.h.

◆ f_state

enum frm_state f_state

Current state.

Note: Because of very simple nature of formation state machine, currently we are not using generic sm framework. If need arises in future, we should implement formation state machine using m0_sm framework.

Definition at line 203 of file formation2_internal.h.


The documentation for this struct was generated from the following file: