Inline functions for nmad core. More...
#include <nm_private.h>
Go to the source code of this file.
Functions | |
static struct nm_trk_s * | nm_gate_trk_get (nm_gate_t p_gate, nm_drv_t p_drv) |
Get the track per-gate data. More... | |
static struct nm_trk_s * | nm_trk_get_by_index (nm_gate_t p_gate, int index) |
Get a driver given its id. More... | |
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 More... | |
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 More... | |
static void | nm_pw_ref_inc (struct nm_pkt_wrap_s *p_pw) |
static void | nm_pw_ref_dec (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 More... | |
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_strat_submit_req_chunk (nm_core_t p_core, nm_gate_t p_gate, struct nm_req_chunk_s *p_req_chunk, int front) |
static void | nm_strat_rdv_accept (nm_core_t p_core, nm_gate_t p_gate) |
process postponed rdv requests More... | |
static void | nm_strat_gate_schedule (nm_core_t p_core, nm_gate_t p_gate) |
apply strategy on the given gate, for the case where strategy doesn't have global scheduling More... | |
static void | nm_strat_schedule (nm_core_t p_core, nm_gate_t p_gate) |
apply strategy on the given gate (all active gates if p_gate = NULL) More... | |
static void | nm_strat_pack_ctrl (nm_gate_t p_gate, nm_header_ctrl_generic_t *p_header) |
static void | nm_pw_completed_enqueue (struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw) |
enqueue a pw completion, or process immediately if possible More... | |
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_s * | nm_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_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) |
Post a ready-to-receive to accept chunk on given trk_id. More... | |
static void | nm_core_post_ack (nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq) |
Post an ACK. More... | |
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 More... | |
static struct nm_matching_wildcard_s * | nm_matching_wildcard_bytag (struct nm_core *p_core, nm_core_tag_t core_tag) |
static struct nm_matching_gsession_s * | nm_matching_gsession_bytag (struct nm_gate_s *p_gate, nm_core_tag_t core_tag) |
Inline functions for nmad core.
These functions are defined inlined for performance.
Definition in file nm_core_inline.h.
|
inlinestatic |
dynamically adapt pioman polling frequency level depending on the number of pending requests
Definition at line 389 of file nm_core_inline.h.
References nm_core::n_packs, nm_core::n_unpacks, nm_core_lock_assert(), and nm_core::pending_tasks.
|
inlinestatic |
Post an ACK.
Definition at line 374 of file nm_core_inline.h.
References h, nm_header_init_ack(), nm_strat_pack_ctrl(), p_gate, seq, and tag.
|
inlinestatic |
Definition at line 381 of file nm_core_inline.h.
References h, msg_len, nm_header_init_msg(), nm_strat_pack_ctrl(), p_gate, seq, and tag.
|
inlinestatic |
Post a ready-to-receive to accept chunk on given trk_id.
Definition at line 359 of file nm_core_inline.h.
References chunk_len, chunk_offset, h, NM_FATAL, nm_header_init_rtr(), nm_strat_pack_ctrl(), p_gate, seq, tag, and trk_id.
|
inlinestatic |
Definition at line 129 of file nm_core_inline.h.
References nm_core_lock_assert(), nm_core_nolock_assert(), nm_core_task_flush(), nm_core_trylock(), nm_core_unlock(), and nm_core::pending_tasks.
Referenced by nm_pw_completed_enqueue(), and nm_req_chunk_submit().
get maximum size for small messages for the given driver
Definition at line 52 of file nm_core_inline.h.
References nm_minidriver_properties_s::capabilities, nm_minidriver_capabilities_s::max_msg_size, NM_ALIGN_FRONTIER, NM_HEADER_DATA_SIZE, NM_MAX_UNEXPECTED, nm_trk_s::p_drv, and nm_drv_s::props.
|
inlinestatic |
Definition at line 108 of file nm_core_inline.h.
References nm_core::active_gates, and p_gate.
Referenced by nm_gate_set_active().
|
inlinestatic |
Definition at line 100 of file nm_core_inline.h.
References nm_gate_s::ctrl_chunk_list, p_gate, nm_gate_s::pending_large_recv, nm_gate_s::req_chunk_list, and nm_gate_s::strat_todo.
Referenced by nm_gate_set_active(), and nm_strat_schedule().
|
inlinestatic |
mark gate as having active requests
Definition at line 115 of file nm_core_inline.h.
References nm_core::active_gates, nm_core_lock_assert(), nm_gate_is_in_active_list(), nm_gate_isactive(), nm_gate_s::p_core, and p_gate.
Referenced by nm_strat_pack_ctrl(), nm_strat_rdv_accept(), and nm_strat_submit_req_chunk().
Get the track per-gate data.
Definition at line 29 of file nm_core_inline.h.
References nm_gate_s::n_trks, nm_trk_s::p_drv, p_gate, and nm_gate_s::trks.
|
inlinestatic |
Definition at line 412 of file nm_core_inline.h.
References nm_gate_s::gsessions, nm_core_tag_build(), nm_core_tag_get_hashcode(), and p_gate.
|
inlinestatic |
Definition at line 405 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.
|
inlinestatic |
assign packet to given driver, gate, and track
Definition at line 62 of file nm_core_inline.h.
References 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.
|
inlinestatic |
enqueue a pw completion, or process immediately if possible
Definition at line 288 of file nm_core_inline.h.
References nm_core_task_s::completed_pw, nm_core_task_s::content, nm_pkt_wrap_s::core_task, nm_pkt_wrap_s::flags, nm_core_task_s::kind, nm_core_nolock_assert(), NM_CORE_TASK_COMPLETED_PW, nm_core_task_enqueue(), NM_PW_COMPLETED, and nm_core_task_s::p_pw.
|
inlinestatic |
Definition at line 87 of file nm_core_inline.h.
References count, nm_atomic_dec(), nm_pw_free(), nm_drv_s::p_core, nm_pkt_wrap_s::p_drv, and nm_pkt_wrap_s::ref_count.
|
inlinestatic |
Definition at line 83 of file nm_core_inline.h.
References nm_atomic_inc(), and nm_pkt_wrap_s::ref_count.
|
inlinestatic |
Definition at line 330 of file nm_core_inline.h.
References nm_core::req_chunk_allocator.
|
inlinestatic |
Definition at line 313 of file nm_core_inline.h.
References nm_req_chunk_s::chunk_len, nm_req_chunk_s::chunk_offset, NM_LEN_UNDEFINED, nm_req_chunk_s::p_req, nm_req_s::req_chunk, and nm_core::req_chunk_allocator.
|
inlinestatic |
Definition at line 337 of file nm_core_inline.h.
References nm_req_chunk_s::chunk_len, chunk_len, nm_req_chunk_s::chunk_offset, chunk_offset, nm_req_chunk_s::chunk_props, nm_req_s::data, nm_req_s::flags, nm_req_s::len, nm_data_chunk_properties_compute(), NM_PROTO_FLAG_ACKREQ, NM_PROTO_FLAG_LASTCHUNK, NM_REQ_FLAG_PACK_SYNCHRONOUS, nm_req_chunk_s::p_req, nm_req_s::pack, and nm_req_chunk_s::proto_flags.
|
inlinestatic |
Definition at line 304 of file nm_core_inline.h.
References nm_core_task_s::content, nm_req_chunk_s::core_task, nm_core_task_s::kind, nm_core_nolock_assert(), nm_core_task_enqueue(), NM_CORE_TASK_PACK_SUBMISSION, nm_req_chunk_s::p_req, nm_core_task_s::p_req_chunk, and nm_core_task_s::pack_submission.
apply strategy on the given gate, for the case where strategy doesn't have global scheduling
Definition at line 209 of file nm_core_inline.h.
References nm_core_lock_assert(), nm_profile_inc, nm_strat_rdv_accept(), nm_gate_s::p_core, p_gate, nm_strategy_iface_s::schedule, nm_core::strategy_iface, and nm_gate_s::strategy_receptacle.
Referenced by nm_strat_schedule().
|
inlinestatic |
Definition at line 268 of file nm_core_inline.h.
References nm_ctrl_chunk_s::ctrl, nm_core::ctrl_chunk_allocator, nm_gate_s::ctrl_chunk_list, nm_core_lock_assert(), nm_gate_set_active(), nm_gate_s::p_core, p_gate, nm_ctrl_chunk_s::p_gate, nm_core::strategy_context, nm_core::strategy_iface, and nm_strategy_iface_s::submit_ctrl_chunk.
Referenced by nm_core_post_ack(), nm_core_post_msg(), and nm_core_post_rtr().
process postponed rdv requests
Definition at line 194 of file nm_core_inline.h.
References nm_core_lock_assert(), nm_gate_set_active(), p_gate, nm_gate_s::pending_large_recv, and nm_gate_s::strategy_receptacle.
Referenced by nm_strat_gate_schedule().
apply strategy on the given gate (all active gates if p_gate = NULL)
Definition at line 222 of file nm_core_inline.h.
References nm_core::active_gates, nm_core_lock_assert(), nm_gate_isactive(), NM_GATE_STATUS_CONNECTED, nm_strat_gate_schedule(), p_gate, nm_strategy_iface_s::schedule, nm_gate_s::status, nm_core::strategy_context, and nm_core::strategy_iface.
|
inlinestatic |
Definition at line 168 of file nm_core_inline.h.
References nm_core_lock_assert(), nm_gate_set_active(), p_gate, nm_gate_s::req_chunk_list, nm_core::strategy_context, nm_core::strategy_iface, and nm_strategy_iface_s::submit_req_chunk.
Get a driver given its id.
Definition at line 43 of file nm_core_inline.h.
References nm_gate_s::n_trks, p_gate, and nm_gate_s::trks.