Motr  M0
Copy Packet
Collaboration diagram for Copy Packet:

Modules

 Copy packet internal
 

Data Structures

struct  m0_cm_cp_fop
 
struct  m0_cm_cp
 
struct  m0_cm_cp_ops
 

Enumerations

enum  { M0_CP_SIZE = 4096 }
 
enum  m0_cm_cp_priority { M0_CM_CP_PRIORITY_MIN = 0, M0_CM_CP_PRIORITY_MAX = 3, M0_CM_CP_PRIORITY_NR }
 
enum  m0_cm_cp_io_op { M0_CM_CP_READ, M0_CM_CP_WRITE }
 
enum  m0_cm_cp_phase {
  M0_CCP_INIT = M0_FOM_PHASE_INIT, M0_CCP_FINI = M0_FOM_PHASE_FINISH, M0_CCP_READ, M0_CCP_WRITE_PRE,
  M0_CCP_TX_OPEN, M0_CCP_WRITE, M0_CCP_TX_DONE, M0_CCP_IO_WAIT,
  M0_CCP_XFORM, M0_CCP_SW_CHECK, M0_CCP_SEND, M0_CCP_SEND_WAIT,
  M0_CCP_RECV_INIT, M0_CCP_RECV_WAIT, M0_CCP_FAIL, M0_CCP_NR
}
 

Functions

M0_INTERNAL void m0_cm_cp_init (struct m0_cm_type *cmtype, const struct m0_fom_type_ops *ft_ops)
 
M0_INTERNAL bool m0_cm_cp_invariant (const struct m0_cm_cp *cp)
 
M0_INTERNAL void m0_cm_cp_only_init (struct m0_cm *cm, struct m0_cm_cp *cp)
 
M0_INTERNAL void m0_cm_cp_fom_init (struct m0_cm *cm, struct m0_cm_cp *cp, struct m0_fop *fop, struct m0_fop *r_fop)
 
 M0_TL_DECLARE (rpcbulk, M0_INTERNAL, struct m0_rpc_bulk_buf)
 
 M0_TL_DESCR_DECLARE (rpcbulk, M0_EXTERN)
 
M0_INTERNAL void m0_cm_cp_only_fini (struct m0_cm_cp *cp)
 
M0_INTERNAL void m0_cm_cp_fini (struct m0_cm_cp *cp)
 
M0_INTERNAL int m0_cm_cp_enqueue (struct m0_cm *cm, struct m0_cm_cp *cp)
 
M0_INTERNAL void m0_cm_cp_buf_add (struct m0_cm_cp *cp, struct m0_net_buffer *nb)
 
M0_INTERNAL void m0_cm_cp_buf_release (struct m0_cm_cp *cp)
 
M0_INTERNAL uint64_t m0_cm_cp_nr (struct m0_cm_cp *cp)
 
M0_INTERNAL int m0_cm_cp_bufvec_merge (struct m0_cm_cp *cp)
 
M0_INTERNAL int m0_cm_cp_bufvec_split (struct m0_cm_cp *cp)
 
M0_INTERNAL void m0_cm_cp_buf_move (struct m0_cm_cp *src, struct m0_cm_cp *dest)
 
M0_INTERNAL int m0_cm_cp_dup (struct m0_cm_cp *src, struct m0_cm_cp **dest)
 
M0_INTERNAL void m0_cm_cp_data_copy (struct m0_cm_cp *src, struct m0_cm_cp *dst)
 
M0_INTERNAL int m0_cm_cp_fom_create (struct m0_fop *fop, struct m0_fop *r_fop, struct m0_fom **m, struct m0_reqh *reqh)
 
M0_INTERNAL void m0_cm_cp_fom_fini (struct m0_fom *fom)
 
 M0_TL_DESCR_DECLARE (cp_data_buf, M0_EXTERN)
 
 M0_TL_DECLARE (cp_data_buf, M0_INTERNAL, struct m0_net_buffer)
 

Variables

static struct m0_sm_state_descr m0_cm_cp_state_descr []
 
static const struct m0_sm_conf m0_cm_cp_sm_conf
 

Detailed Description

See also
The Copy Packet its Copy Packet Functional Specification

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Todo:
replace this hard coded size with actual number from confc.
Enumerator
M0_CP_SIZE 

Definition at line 76 of file cp.h.

◆ m0_cm_cp_io_op

Distinguishes IO operation for a copy packet.

Enumerator
M0_CM_CP_READ 
M0_CM_CP_WRITE 

Definition at line 94 of file cp.h.

◆ m0_cm_cp_phase

Copy packet FOM generic phases.

Enumerator
M0_CCP_INIT 

Copy packet specific initialisation.

M0_CCP_FINI 

Releases resources associated with the packet, finalises members and free the packet.

M0_CCP_READ 

Read and fill up the packet.

M0_CCP_WRITE_PRE 

Some specific pre-write routines for copy packet.

M0_CCP_TX_OPEN 

Open BE transaction if needed.

M0_CCP_WRITE 

Write packet data.

M0_CCP_TX_DONE 

BE transaction is done.

M0_CCP_IO_WAIT 

Wait for IO completion.

M0_CCP_XFORM 

Transform the packet.

M0_CCP_SW_CHECK 

Checks if the copy packet is in sliding window. If it is not, then waits in this phase till it fits in the sliding window.

M0_CCP_SEND 

Send packet over network.

M0_CCP_SEND_WAIT 

Wait for copy packet to be sent and ack to be received.

M0_CCP_RECV_INIT 

Received packet from network. Initialise zero copy.

M0_CCP_RECV_WAIT 

Wait for zero copy to be completed.

M0_CCP_FAIL 
M0_CCP_NR 

Definition at line 100 of file cp.h.

◆ m0_cm_cp_priority

Copy packet priority.

Copy packets are assigned a priority (greater numerical value corresponds to higher priority). When multiple copy packets are ready to be processed, higher priority ones have a preference.

Enumerator
M0_CM_CP_PRIORITY_MIN 
M0_CM_CP_PRIORITY_MAX 
M0_CM_CP_PRIORITY_NR 

Definition at line 87 of file cp.h.

Function Documentation

◆ m0_cm_cp_buf_add()

M0_INTERNAL void m0_cm_cp_buf_add ( struct m0_cm_cp cp,
struct m0_net_buffer nb 
)

Definition at line 703 of file cp.c.

Here is the caller graph for this function:

◆ m0_cm_cp_buf_move()

M0_INTERNAL void m0_cm_cp_buf_move ( struct m0_cm_cp src,
struct m0_cm_cp dest 
)

Definition at line 793 of file cp.c.

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

◆ m0_cm_cp_buf_release()

M0_INTERNAL void m0_cm_cp_buf_release ( struct m0_cm_cp cp)

Definition at line 713 of file cp.c.

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

◆ m0_cm_cp_bufvec_merge()

M0_INTERNAL int m0_cm_cp_bufvec_merge ( struct m0_cm_cp cp)

If there are multiple network buffers associated with a copy packet, merges all corresponding bufvecs to the bufvec of first network buffer. This is required in order to use RS code APIs.

Definition at line 752 of file cp.c.

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

◆ m0_cm_cp_bufvec_split()

M0_INTERNAL int m0_cm_cp_bufvec_split ( struct m0_cm_cp cp)

Definition at line 768 of file cp.c.

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

◆ m0_cm_cp_data_copy()

M0_INTERNAL void m0_cm_cp_data_copy ( struct m0_cm_cp src,
struct m0_cm_cp dst 
)

Definition at line 828 of file cp.c.

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

◆ m0_cm_cp_dup()

M0_INTERNAL int m0_cm_cp_dup ( struct m0_cm_cp src,
struct m0_cm_cp **  dest 
)

The meta-data of the is copied to and the data buffers are detached from and attached to to avoid data copy. After this call, is no longer usable and should be finalized immediately to avoid misuse.

Definition at line 805 of file cp.c.

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

◆ m0_cm_cp_enqueue()

M0_INTERNAL int m0_cm_cp_enqueue ( struct m0_cm cm,
struct m0_cm_cp cp 
)

Submits copy packet FOM to request handler for processing.

Definition at line 688 of file cp.c.

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

◆ m0_cm_cp_fini()

M0_INTERNAL void m0_cm_cp_fini ( struct m0_cm_cp cp)

Finalises generic copy packet and its copy packet FOM.

Precondition
cp->c_fom.fo_phase == M0_FOPH_FINISH

Definition at line 682 of file cp.c.

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

◆ m0_cm_cp_fom_create()

M0_INTERNAL int m0_cm_cp_fom_create ( struct m0_fop fop,
struct m0_fop r_fop,
struct m0_fom **  m,
struct m0_reqh reqh 
)

Definition at line 454 of file cp.c.

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

◆ m0_cm_cp_fom_fini()

M0_INTERNAL void m0_cm_cp_fom_fini ( struct m0_fom fom)

Definition at line 412 of file cp.c.

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

◆ m0_cm_cp_fom_init()

M0_INTERNAL void m0_cm_cp_fom_init ( struct m0_cm cm,
struct m0_cm_cp cp,
struct m0_fop fop,
struct m0_fop r_fop 
)

Initialises generic copy packet and its corresponding copy packet FOM.

Precondition
cp->c_fom.fo_phase == CCP_INIT
Postcondition
cp->c_fom.fo_phase == M0_FOPH_INIT

Definition at line 610 of file cp.c.

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

◆ m0_cm_cp_init()

M0_INTERNAL void m0_cm_cp_init ( struct m0_cm_type cmtype,
const struct m0_fom_type_ops ft_ops 
)

Definition at line 580 of file cp.c.

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

◆ m0_cm_cp_invariant()

M0_INTERNAL bool m0_cm_cp_invariant ( const struct m0_cm_cp cp)

Definition at line 587 of file cp.c.

Here is the caller graph for this function:

◆ m0_cm_cp_nr()

M0_INTERNAL uint64_t m0_cm_cp_nr ( struct m0_cm_cp cp)

Definition at line 738 of file cp.c.

Here is the call graph for this function:

◆ m0_cm_cp_only_fini()

M0_INTERNAL void m0_cm_cp_only_fini ( struct m0_cm_cp cp)

Finalises generic copy packet only.

Definition at line 626 of file cp.c.

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

◆ m0_cm_cp_only_init()

M0_INTERNAL void m0_cm_cp_only_init ( struct m0_cm cm,
struct m0_cm_cp cp 
)

Initialises generic copy packet only.

Definition at line 597 of file cp.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 ( cp_data_buf  ,
M0_INTERNAL  ,
struct m0_net_buffer   
)

◆ M0_TL_DECLARE() [2/2]

M0_TL_DECLARE ( rpcbulk  ,
M0_INTERNAL  ,
struct m0_rpc_bulk_buf   
)

◆ M0_TL_DESCR_DECLARE() [1/2]

M0_TL_DESCR_DECLARE ( cp_data_buf  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DECLARE() [2/2]

M0_TL_DESCR_DECLARE ( rpcbulk  ,
M0_EXTERN   
)

Variable Documentation

◆ m0_cm_cp_sm_conf

const struct m0_sm_conf m0_cm_cp_sm_conf
static
Initial value:
= {
.scf_name = "sm:cp conf",
.scf_nr_states = ARRAY_SIZE(m0_cm_cp_state_descr),
.scf_state = m0_cm_cp_state_descr
}
#define ARRAY_SIZE(a)
Definition: misc.h:45
static struct m0_sm_state_descr m0_cm_cp_state_descr[]
Definition: cp.c:485

Definition at line 574 of file cp.c.

◆ m0_cm_cp_state_descr

struct m0_sm_state_descr m0_cm_cp_state_descr[]
static

Definition at line 485 of file cp.c.