NewMadeleine

Documentation

« back to PM2 home.
nm_core_inline.h File Reference

Inline functions for nmad core. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define nm_pw_ref_inc(P_PW, LABEL)   nm_refcount_inc(&(P_PW)->refcount, (LABEL))
 increment refcount for pw; make it a macro to be able to capture file/func/line in refcount tracking
 

Functions

static struct nm_trk_snm_gate_trk_get (nm_gate_t p_gate, nm_drv_t p_drv)
 Get the track per-gate data.
 
static struct nm_trk_snm_trk_get_by_index (nm_gate_t p_gate, int index)
 Get a driver given its id.
 
static nm_len_t nm_drv_max_small (const struct nm_drv_s *const p_drv)
 get maximum size for small messages for the given driver
 
static int nm_trk_can_recv (const struct nm_trk_s *p_trk)
 checks whether we can post one more recv pw on this trk
 
static int nm_trk_can_send (const struct nm_trk_s *p_trk)
 checks whether we can post one more send pw on this trk
 
static void nm_pw_assign (struct nm_pkt_wrap_s *p_pw, nm_trk_id_t trk_id, struct nm_drv_s *p_drv, nm_gate_t p_gate)
 assign packet to given driver, gate, and track
 
static void nm_pw_ref_dec (struct nm_pkt_wrap_s *p_pw, const char *label)
 decrement ref_count for pw; free if ref_count reaches 0
 
static void nm_pw_ref_dec_free (struct nm_pkt_wrap_s *p_pw, const char *label)
 decrement ref_count for pw, supposed to reach 0
 
static void nm_header_global_finalize (struct nm_pkt_wrap_s *p_pw)
 
static uint16_t nm_header_global_v0len (const struct nm_pkt_wrap_s *p_pw)
 
static int nm_gate_isactive (struct nm_gate_s *p_gate)
 
static int nm_gate_is_in_active_list (struct nm_core *p_core, struct nm_gate_s *p_gate)
 
static void nm_gate_set_active (struct nm_gate_s *p_gate)
 mark gate as having active requests
 
static void nm_core_task_enqueue (struct nm_core *p_core, int holding_lock, struct nm_core_task_s *p_core_task)
 
static void nm_pw_completed_enqueue (struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw)
 enqueue a pw completion
 
static void nm_req_chunk_submit (struct nm_core *p_core, struct nm_req_chunk_s *p_req_chunk)
 
static void nm_req_chunk_destroy (struct nm_core *p_core, struct nm_req_chunk_s *p_req_chunk)
 
static struct nm_req_chunk_snm_req_chunk_alloc (struct nm_core *p_core)
 
static void nm_req_chunk_init (struct nm_req_chunk_s *p_req_chunk, struct nm_req_s *p_req, nm_len_t chunk_offset, nm_len_t chunk_len)
 
static void nm_req_chunk_update (struct nm_req_chunk_s *p_req_chunk)
 update req chunk properties after it has been modified (split, trim, ...)
 
static void nm_core_post_req_chunk (nm_core_t p_core, nm_gate_t p_gate, struct nm_req_chunk_s *p_req_chunk)
 Post a req chunk for sending; it will later be scheduled by the strategy.
 
static void nm_core_post_ctrl (nm_gate_t p_gate, nm_header_ctrl_generic_t *p_header, const void *p_payload, nm_len_t payload_size)
 Post a generic control header to the given gate.
 
static void nm_core_post_rtr (nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq, nm_trk_id_t trk_id, nm_len_t chunk_offset, nm_len_t chunk_len, const void *p_rdv_data, nm_len_t size)
 Post a ready-to-receive to accept chunk on given trk_id.
 
static void nm_core_post_ack (nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq)
 Post an ACK.
 
static void nm_core_post_msg (nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq, nm_len_t msg_len)
 
static void nm_core_polling_level (struct nm_core *p_core)
 dynamically adapt pioman polling frequency level depending on the number of pending requests
 
static struct nm_matching_wildcard_snm_matching_wildcard_bytag (struct nm_core *p_core, nm_core_tag_t core_tag)
 
static struct nm_matching_gsession_snm_matching_gsession_bytag (struct nm_gate_s *p_gate, nm_core_tag_t core_tag)
 

Detailed Description

Inline functions for nmad core.

These functions are defined inlined for performance.

Definition in file nm_core_inline.h.

Macro Definition Documentation

◆ nm_pw_ref_inc

#define nm_pw_ref_inc (   P_PW,
  LABEL 
)    nm_refcount_inc(&(P_PW)->refcount, (LABEL))

increment refcount for pw; make it a macro to be able to capture file/func/line in refcount tracking

Definition at line 101 of file nm_core_inline.h.

Function Documentation

◆ nm_core_polling_level()

static void nm_core_polling_level ( struct nm_core p_core)
inlinestatic

dynamically adapt pioman polling frequency level depending on the number of pending requests

Definition at line 356 of file nm_core_inline.h.

References assert(), nm_core::n_packs, nm_core::n_unpacks, nm_core_lock_assert(), and nm_core::pending_tasks.

Here is the call graph for this function:

◆ nm_core_post_ack()

static void nm_core_post_ack ( nm_gate_t  p_gate,
nm_core_tag_t  tag,
nm_seq_t  seq 
)
inlinestatic

Post an ACK.

Definition at line 341 of file nm_core_inline.h.

References h, nm_core_post_ctrl(), nm_header_init_ack(), p_gate, seq, and tag.

Here is the call graph for this function:

◆ nm_core_post_ctrl()

static void nm_core_post_ctrl ( nm_gate_t  p_gate,
nm_header_ctrl_generic_t p_header,
const void *  p_payload,
nm_len_t  payload_size 
)
inlinestatic

◆ nm_core_post_msg()

static void nm_core_post_msg ( nm_gate_t  p_gate,
nm_core_tag_t  tag,
nm_seq_t  seq,
nm_len_t  msg_len 
)
inlinestatic

Definition at line 348 of file nm_core_inline.h.

References h, msg_len, nm_core_post_ctrl(), nm_header_init_msg(), p_gate, seq, and tag.

Here is the call graph for this function:

◆ nm_core_post_req_chunk()

static void nm_core_post_req_chunk ( nm_core_t  p_core,
nm_gate_t  p_gate,
struct nm_req_chunk_s p_req_chunk 
)
inlinestatic

Post a req chunk for sending; it will later be scheduled by the strategy.

Definition at line 300 of file nm_core_inline.h.

References nm_core_lock_assert(), nm_gate_set_active(), p_gate, and nm_gate_s::req_chunk_list.

Here is the call graph for this function:

◆ nm_core_post_rtr()

static void nm_core_post_rtr ( nm_gate_t  p_gate,
nm_core_tag_t  tag,
nm_seq_t  seq,
nm_trk_id_t  trk_id,
nm_len_t  chunk_offset,
nm_len_t  chunk_len,
const void *  p_rdv_data,
nm_len_t  size 
)
inlinestatic

Post a ready-to-receive to accept chunk on given trk_id.

Definition at line 326 of file nm_core_inline.h.

References chunk_len, chunk_offset, h, nm_core_post_ctrl(), NM_FATAL, nm_header_init_rtr(), p_gate, seq, size, tag, and trk_id.

Here is the call graph for this function:

◆ nm_core_task_enqueue()

static void nm_core_task_enqueue ( struct nm_core p_core,
int  holding_lock,
struct nm_core_task_s p_core_task 
)
inlinestatic

◆ nm_drv_max_small()

static nm_len_t nm_drv_max_small ( const struct nm_drv_s *const  p_drv)
inlinestatic

◆ nm_gate_is_in_active_list()

static int nm_gate_is_in_active_list ( struct nm_core p_core,
struct nm_gate_s p_gate 
)
inlinestatic

Definition at line 147 of file nm_core_inline.h.

References nm_core::active_gates, and p_gate.

Referenced by nm_gate_set_active().

◆ nm_gate_isactive()

static int nm_gate_isactive ( struct nm_gate_s p_gate)
inlinestatic

◆ nm_gate_set_active()

static void nm_gate_set_active ( struct nm_gate_s p_gate)
inlinestatic

mark gate as having active requests

Definition at line 154 of file nm_core_inline.h.

References nm_core::active_gates, assert(), nm_core_lock_assert(), nm_gate_is_in_active_list(), nm_gate_isactive(), nm_gate_s::p_core, and p_gate.

Referenced by nm_core_post_ctrl(), and nm_core_post_req_chunk().

Here is the call graph for this function:

◆ nm_gate_trk_get()

static struct nm_trk_s * nm_gate_trk_get ( nm_gate_t  p_gate,
nm_drv_t  p_drv 
)
inlinestatic

Get the track per-gate data.

Definition at line 27 of file nm_core_inline.h.

References assert(), nm_gate_s::n_trks, nm_trk_s::p_drv, p_gate, and nm_gate_s::trks.

Here is the call graph for this function:

◆ nm_header_global_finalize()

static void nm_header_global_finalize ( struct nm_pkt_wrap_s p_pw)
inlinestatic

Definition at line 122 of file nm_core_inline.h.

References assert(), h, NM_TRK_SMALL, nm_pkt_wrap_s::trk_id, nm_pkt_wrap_s::v, and v0len.

Here is the call graph for this function:

◆ nm_header_global_v0len()

static uint16_t nm_header_global_v0len ( const struct nm_pkt_wrap_s p_pw)
inlinestatic

Definition at line 131 of file nm_core_inline.h.

References assert(), nm_pkt_wrap_s::flags, h, NM_PW_BUF_SEND, NM_PW_BUFFER, NM_PW_GLOBAL_HEADER, and nm_pkt_wrap_s::v.

Here is the call graph for this function:

◆ nm_matching_gsession_bytag()

static struct nm_matching_gsession_s * nm_matching_gsession_bytag ( struct nm_gate_s p_gate,
nm_core_tag_t  core_tag 
)
inlinestatic

Definition at line 379 of file nm_core_inline.h.

References nm_gate_s::gsessions, nm_core_tag_build(), nm_core_tag_get_hashcode(), and p_gate.

Here is the call graph for this function:

◆ nm_matching_wildcard_bytag()

static struct nm_matching_wildcard_s * nm_matching_wildcard_bytag ( struct nm_core p_core,
nm_core_tag_t  core_tag 
)
inlinestatic

Definition at line 372 of file nm_core_inline.h.

References nm_core_tag_build(), nm_core_tag_get_hashcode(), nm_matching_wildcard_get(), and nm_core::wildcard_table.

Here is the call graph for this function:

◆ nm_pw_assign()

static void nm_pw_assign ( struct nm_pkt_wrap_s p_pw,
nm_trk_id_t  trk_id,
struct nm_drv_s p_drv,
nm_gate_t  p_gate 
)
inlinestatic

assign packet to given driver, gate, and track

Definition at line 79 of file nm_core_inline.h.

References assert(), NM_GATE_NONE, nm_trk_s::p_drv, nm_pkt_wrap_s::p_drv, p_gate, nm_pkt_wrap_s::p_gate, nm_drv_s::p_pw_recv_any, nm_pkt_wrap_s::p_trk, trk_id, nm_pkt_wrap_s::trk_id, and nm_gate_s::trks.

Here is the call graph for this function:

◆ nm_pw_completed_enqueue()

static void nm_pw_completed_enqueue ( struct nm_core p_core,
struct nm_pkt_wrap_s p_pw 
)
inlinestatic

◆ nm_pw_ref_dec()

static void nm_pw_ref_dec ( struct nm_pkt_wrap_s p_pw,
const char *  label 
)
inlinestatic

decrement ref_count for pw; free if ref_count reaches 0

Definition at line 104 of file nm_core_inline.h.

References assert(), count, nm_core_lock_assert(), nm_pw_free(), nm_refcount_dec(), and nm_pkt_wrap_s::refcount.

Referenced by nm_pw_ref_dec_free().

Here is the call graph for this function:

◆ nm_pw_ref_dec_free()

static void nm_pw_ref_dec_free ( struct nm_pkt_wrap_s p_pw,
const char *  label 
)
inlinestatic

decrement ref_count for pw, supposed to reach 0

Definition at line 116 of file nm_core_inline.h.

References assert(), nm_pw_ref_dec(), nm_refcount_get(), and nm_pkt_wrap_s::refcount.

Here is the call graph for this function:

◆ nm_req_chunk_alloc()

static struct nm_req_chunk_s * nm_req_chunk_alloc ( struct nm_core p_core)
inlinestatic

Definition at line 255 of file nm_core_inline.h.

References nm_core::req_chunk_allocator.

◆ nm_req_chunk_destroy()

static void nm_req_chunk_destroy ( struct nm_core p_core,
struct nm_req_chunk_s p_req_chunk 
)
inlinestatic

◆ nm_req_chunk_init()

◆ nm_req_chunk_submit()

static void nm_req_chunk_submit ( struct nm_core p_core,
struct nm_req_chunk_s p_req_chunk 
)
inlinestatic

◆ nm_req_chunk_update()

static void nm_req_chunk_update ( struct nm_req_chunk_s p_req_chunk)
inlinestatic

update req chunk properties after it has been modified (split, trim, ...)

Definition at line 284 of file nm_core_inline.h.

References assert(), nm_req_chunk_s::chunk_len, nm_req_chunk_s::chunk_offset, nm_req_chunk_s::chunk_props, nm_req_s::data, nm_req_s::len, nm_data_chunk_properties_compute(), NM_PROTO_FLAG_LASTCHUNK, nm_req_chunk_s::p_req, nm_req_s::pack, and nm_req_chunk_s::proto_flags.

Here is the call graph for this function:

◆ nm_trk_can_recv()

static int nm_trk_can_recv ( const struct nm_trk_s p_trk)
inlinestatic

checks whether we can post one more recv pw on this trk

Definition at line 57 of file nm_core_inline.h.

References nm_trk_s::active_pw_recv, assert(), nm_minidriver_properties_s::capabilities, nm_minidriver_capabilities_s::max_pkt_recvs, nm_trk_s::p_drv, and nm_drv_s::props.

Here is the call graph for this function:

◆ nm_trk_can_send()

static int nm_trk_can_send ( const struct nm_trk_s p_trk)
inlinestatic

checks whether we can post one more send pw on this trk

Definition at line 67 of file nm_core_inline.h.

References nm_trk_s::active_pw_send, assert(), nm_minidriver_properties_s::capabilities, nm_minidriver_capabilities_s::max_pkt_sends, nm_trk_s::p_drv, and nm_drv_s::props.

Here is the call graph for this function:

◆ nm_trk_get_by_index()

static struct nm_trk_s * nm_trk_get_by_index ( nm_gate_t  p_gate,
int  index 
)
inlinestatic

Get a driver given its id.

Definition at line 41 of file nm_core_inline.h.

References assert(), nm_gate_s::n_trks, p_gate, and nm_gate_s::trks.

Here is the call graph for this function: