Inline functions for nmad core. More...

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_s * | nm_gate_trk_get (nm_gate_t p_gate, nm_drv_t p_drv) |
| Get the track per-gate data. | |
| static struct nm_trk_s * | nm_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_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_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_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) |
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()
|
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.

◆ nm_core_post_ack()
|
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.

◆ nm_core_post_ctrl()
|
inlinestatic |
Post a generic control header to the given gate.
Definition at line 309 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_ctrl_chunk_s::p_payload, payload_size, and nm_ctrl_chunk_s::size.
Referenced by nm_core_post_ack(), nm_core_post_msg(), and nm_core_post_rtr().

◆ nm_core_post_msg()
|
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.

◆ nm_core_post_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.

◆ nm_core_post_rtr()
|
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.

◆ nm_core_task_enqueue()
|
inlinestatic |
Definition at line 168 of file nm_core_inline.h.
References assert(), nm_core_task_s::kind, nm_core_lock_assert(), nm_core_nolock_assert(), nm_core_task_flush(), NM_CORE_TASK_NONE, nm_core_trylock(), nm_core_unlock(), and nm_core::pending_tasks.
Referenced by nm_pw_completed_enqueue(), and nm_req_chunk_submit().

◆ nm_drv_max_small()
get maximum size for small messages for the given driver
Definition at line 50 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.
◆ nm_gate_is_in_active_list()
|
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()
|
inlinestatic |
Definition at line 140 of file nm_core_inline.h.
References nm_gate_s::ctrl_chunk_list, p_gate, nm_gate_s::pending_large_recv, and nm_gate_s::req_chunk_list.
Referenced by nm_gate_set_active().
◆ nm_gate_set_active()
|
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().

◆ nm_gate_trk_get()
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.

◆ nm_header_global_finalize()
|
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.

◆ nm_header_global_v0len()
|
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.

◆ nm_matching_gsession_bytag()
|
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.

◆ nm_matching_wildcard_bytag()
|
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.

◆ nm_pw_assign()
|
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.

◆ nm_pw_completed_enqueue()
|
inlinestatic |
enqueue a pw completion
Definition at line 207 of file nm_core_inline.h.
References assert(), 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_CORE_TASK_NONE, NM_PW_COMPLETED, nm_pw_ref_inc, nm_pw_refcount_completion, nm_core_task_s::p_pw, and nm_core::pw_poll_list.

◆ nm_pw_ref_dec()
|
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().

◆ nm_pw_ref_dec_free()
|
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.

◆ nm_req_chunk_alloc()
|
inlinestatic |
Definition at line 255 of file nm_core_inline.h.
References nm_core::req_chunk_allocator.
◆ nm_req_chunk_destroy()
|
inlinestatic |
Definition at line 237 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.
◆ nm_req_chunk_init()
|
inlinestatic |
Definition at line 262 of file nm_core_inline.h.
References assert(), nm_req_chunk_s::chunk_len, chunk_len, nm_req_chunk_s::chunk_offset, chunk_offset, nm_req_chunk_s::chunk_props, nm_req_chunk_s::core_task, nm_req_s::data, nm_req_s::flags, nm_core_task_s::kind, nm_req_s::len, NM_CORE_TASK_NONE, 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.

◆ nm_req_chunk_submit()
|
inlinestatic |
Definition at line 227 of file nm_core_inline.h.
References assert(), 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_NONE, 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.

◆ nm_req_chunk_update()
|
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.

◆ nm_trk_can_recv()
|
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.

◆ nm_trk_can_send()
|
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.

◆ nm_trk_get_by_index()
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.
