NewMadeleine

Documentation

« back to PM2 home.

This is the internal interface for packet wrappers, bellow the scheduler. More...

#include <sys/uio.h>
Include dependency graph for nm_pkt_wrap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nm_pkt_wrap_s
 Internal packet wrapper. More...
 
struct  nm_pw_buf_s
 a pw and its associated buffer, allocated together More...
 

Macros

#define INITIAL_PKT_NUM   16
 Fast packet allocator constant for initial number of entries.
 

Functions

 PUK_LIST_TYPE (nm_pw_pending_rtr, struct nm_gate_s *p_gate;struct nm_header_ctrl_rtr_s header;void *p_payload;)
 a pending RTR, not processed immediately because prefetch was in progress
 
 PUK_LIST_DECLARE_TYPE (nm_pkt_wrap)
 generic list containing a pw.
 
 PUK_LIST_DECLARE_TYPE2 (nm_pw_poll, struct nm_pkt_wrap_s)
 list used for pw polling without pioman.
 
 PUK_LIST_CREATE_FUNCS (nm_pkt_wrap)
 
 PUK_LIST_CREATE_FUNCS (nm_pw_poll)
 
 PUK_ALLOCATOR_TYPE_SINGLE (nm_pw_nohd, struct nm_pkt_wrap_s)
 Allocator for headerless pkt wrapper.
 
 PUK_ALLOCATOR_TYPE_SINGLE (nm_pw_buf, struct nm_pw_buf_s)
 Allocator for pkt wrapper with contiguous data block.
 
struct nm_pkt_wrap_snm_pw_alloc_buffer (struct nm_core *p_core)
 
struct nm_pkt_wrap_snm_pw_alloc_noheader (struct nm_core *p_core)
 
struct nm_pkt_wrap_snm_pw_alloc_global_header (struct nm_core *p_core, struct nm_trk_s *p_trk)
 
void nm_pw_free (struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw)
 
void nm_pw_split (struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw, struct nm_pkt_wrap_s **pp_pw2, nm_len_t offset)
 
void nm_pw_add_req_chunk (struct nm_pkt_wrap_s *p_pw, struct nm_req_chunk_s *p_req_chunk, nm_req_chunk_flag_t flags)
 
void nm_pw_add_data_in_header (struct nm_pkt_wrap_s *p_pw, nm_core_tag_t tag, nm_seq_t seq, struct nm_data_s *p_data, nm_len_t len, nm_len_t chunk_offset, nm_proto_t proto_flags)
 
void nm_pw_set_data_raw (struct nm_pkt_wrap_s *p_pw, struct nm_data_s *p_data, nm_len_t chunk_len, nm_len_t chunk_offset, const struct nm_data_properties_s *p_props)
 
struct iovec * nm_pw_grow_iovec (struct nm_pkt_wrap_s *p_pw)
 
void nm_pw_data_to_iovec (struct nm_pkt_wrap_s *p_pw)
 
int nm_pw_add_control (struct nm_pkt_wrap_s *p_pw, const union nm_header_ctrl_generic_s *p_ctrl, const void *p_payload)
 
int nm_pw_finalize (struct nm_pkt_wrap_s *p_pw)
 
static nm_len_t nm_pw_remaining_buf (struct nm_pkt_wrap_s *p_pw)
 remaining space in pw buffer
 

Variables

const char nm_pw_refcount_core []
 reference of nmad core on pw
 
const char nm_pw_refcount_completion []
 ref from completion core_task
 
const char nm_pw_refcount_unexpected []
 ref by an unexpected (nm_unexpected_s)
 
const char nm_pw_refcount_prefetch []
 ref by prefetch
 
const char nm_pw_refcount_pioman []
 ref by pioman ltask
 

Packet wrapper flags.

Flag constants for the flag field of pw.

#define NM_PW_FLAG_NONE   ((nm_pw_flag_t)0x00u)
 empty pw flags
 
#define NM_PW_NOHEADER   ((nm_pw_flag_t)(0x1u << 0))
 Headerless pkt, if set.
 
#define NM_PW_BUFFER   ((nm_pw_flag_t)(0x1u << 1))
 pw allocated with NM_MAX_UNEXPECTED contiguous buffer.
 
#define NM_PW_GLOBAL_HEADER   ((nm_pw_flag_t)(0x1u << 2))
 pw allocated with a contiguous buffer and a global header has been prepared.
 
#define NM_PW_DYNAMIC_V0   ((nm_pw_flag_t)(0x1u << 3))
 v[0] is dynamically allocated
 
#define NM_PW_FINALIZED   ((nm_pw_flag_t)(0x1u << 4))
 Pkt has been finalized- ready to send on the wire.
 
#define NM_PW_PREFETCHING   ((nm_pw_flag_t)(0x1u << 5))
 Pkt marked for prefetching.
 
#define NM_PW_PREFETCHED   ((nm_pw_flag_t)(0x1u << 6))
 Pkt has been prefetched.
 
#define NM_PW_POSTING   ((nm_pw_flag_t)(0x1u << 7))
 Pkt is currently being posted.
 
#define NM_PW_POSTED   ((nm_pw_flag_t)(0x1u << 8))
 Pkt has bee posted.
 
#define NM_PW_COMPLETED   ((nm_pw_flag_t)(0x1u << 9))
 send/recv of pw is completed
 
#define NM_PW_SEND   ((nm_pw_flag_t)(0x1u << 10))
 pw used for sending
 
#define NM_PW_RECV   ((nm_pw_flag_t)(0x1u << 11))
 pw used for recv
 
#define NM_PW_DATA_COPY   ((nm_pw_flag_t)(0x1u << 12))
 requests to copy data to contiguous block before sending
 
#define NM_PW_BUF_SEND   ((nm_pw_flag_t)(0x1u << 13))
 use buffer-based driver for send
 
#define NM_PW_BUF_RECV   ((nm_pw_flag_t)(0x1u << 14))
 use buffer-based driver for recv
 
#define NM_PW_BUF_MIRROR   ((nm_pw_flag_t)(0x1u << 15))
 data received in driver buffer has been mirrored in pw buffer
 
#define NM_PW_CLOSED   ((nm_pw_flag_t)(0x1u << 16))
 driver reported gate as closed
 
#define NM_PW_POLL_ANY   ((nm_pw_flag_t)(0x1u << 17))
 pw is polling on any gate (bit cleared once we know the gate)
 
#define NM_PW_CANCELED   ((nm_pw_flag_t)(0x1u << 18))
 pw was canceled
 
#define NM_PW_BLOCKING_CALL   ((nm_pw_flag_t)(0x1u << 19))
 pw is marked for a future blocking syscall
 
#define NM_PW_RDV_READY   ((nm_pw_flag_t)(0x1u << 20))
 rdv for pw is ready; RTR has been received (but couldn't be processed immediately because prefetch was in progress)

 
#define NM_PW_DATA_IS_CUDA   ((nm_pw_flag_t)(0x1u << 21))
 data in v is on a CUDA GPU
 
#define NM_PW_DATA_IS_HIP   ((nm_pw_flag_t)(0x1u << 22))
 data in v is on a HIP / ROCm GPU
 
typedef uint32_t nm_pw_flag_t
 flags to describe packet wrappers
 

Detailed Description

This is the internal interface for packet wrappers, bellow the scheduler.

It it used internally by the core and strategies.

Definition in file nm_pkt_wrap.h.

Macro Definition Documentation

◆ INITIAL_PKT_NUM

#define INITIAL_PKT_NUM   16

Fast packet allocator constant for initial number of entries.

Definition at line 238 of file nm_pkt_wrap.h.

◆ NM_PW_BLOCKING_CALL

#define NM_PW_BLOCKING_CALL   ((nm_pw_flag_t)(0x1u << 19))

pw is marked for a future blocking syscall

Definition at line 100 of file nm_pkt_wrap.h.

◆ NM_PW_BUF_MIRROR

#define NM_PW_BUF_MIRROR   ((nm_pw_flag_t)(0x1u << 15))

data received in driver buffer has been mirrored in pw buffer

Definition at line 88 of file nm_pkt_wrap.h.

◆ NM_PW_BUF_RECV

#define NM_PW_BUF_RECV   ((nm_pw_flag_t)(0x1u << 14))

use buffer-based driver for recv

Definition at line 85 of file nm_pkt_wrap.h.

◆ NM_PW_BUF_SEND

#define NM_PW_BUF_SEND   ((nm_pw_flag_t)(0x1u << 13))

use buffer-based driver for send

Definition at line 82 of file nm_pkt_wrap.h.

◆ NM_PW_BUFFER

#define NM_PW_BUFFER   ((nm_pw_flag_t)(0x1u << 1))

pw allocated with NM_MAX_UNEXPECTED contiguous buffer.

Used to receive small pw on trk #0

Definition at line 44 of file nm_pkt_wrap.h.

◆ NM_PW_CANCELED

#define NM_PW_CANCELED   ((nm_pw_flag_t)(0x1u << 18))

pw was canceled

Definition at line 97 of file nm_pkt_wrap.h.

◆ NM_PW_CLOSED

#define NM_PW_CLOSED   ((nm_pw_flag_t)(0x1u << 16))

driver reported gate as closed

Definition at line 91 of file nm_pkt_wrap.h.

◆ NM_PW_COMPLETED

#define NM_PW_COMPLETED   ((nm_pw_flag_t)(0x1u << 9))

send/recv of pw is completed

Definition at line 70 of file nm_pkt_wrap.h.

◆ NM_PW_DATA_COPY

#define NM_PW_DATA_COPY   ((nm_pw_flag_t)(0x1u << 12))

requests to copy data to contiguous block before sending

Definition at line 79 of file nm_pkt_wrap.h.

◆ NM_PW_DATA_IS_CUDA

#define NM_PW_DATA_IS_CUDA   ((nm_pw_flag_t)(0x1u << 21))

data in v is on a CUDA GPU

Definition at line 106 of file nm_pkt_wrap.h.

◆ NM_PW_DATA_IS_HIP

#define NM_PW_DATA_IS_HIP   ((nm_pw_flag_t)(0x1u << 22))

data in v is on a HIP / ROCm GPU

Definition at line 109 of file nm_pkt_wrap.h.

◆ NM_PW_DYNAMIC_V0

#define NM_PW_DYNAMIC_V0   ((nm_pw_flag_t)(0x1u << 3))

v[0] is dynamically allocated

Definition at line 52 of file nm_pkt_wrap.h.

◆ NM_PW_FINALIZED

#define NM_PW_FINALIZED   ((nm_pw_flag_t)(0x1u << 4))

Pkt has been finalized- ready to send on the wire.

Definition at line 55 of file nm_pkt_wrap.h.

◆ NM_PW_FLAG_NONE

#define NM_PW_FLAG_NONE   ((nm_pw_flag_t)0x00u)

empty pw flags

Definition at line 36 of file nm_pkt_wrap.h.

◆ NM_PW_GLOBAL_HEADER

#define NM_PW_GLOBAL_HEADER   ((nm_pw_flag_t)(0x1u << 2))

pw allocated with a contiguous buffer and a global header has been prepared.

Used to send small pw on trk #0

Definition at line 49 of file nm_pkt_wrap.h.

◆ NM_PW_NOHEADER

#define NM_PW_NOHEADER   ((nm_pw_flag_t)(0x1u << 0))

Headerless pkt, if set.

Definition at line 39 of file nm_pkt_wrap.h.

◆ NM_PW_POLL_ANY

#define NM_PW_POLL_ANY   ((nm_pw_flag_t)(0x1u << 17))

pw is polling on any gate (bit cleared once we know the gate)

Definition at line 94 of file nm_pkt_wrap.h.

◆ NM_PW_POSTED

#define NM_PW_POSTED   ((nm_pw_flag_t)(0x1u << 8))

Pkt has bee posted.

Definition at line 67 of file nm_pkt_wrap.h.

◆ NM_PW_POSTING

#define NM_PW_POSTING   ((nm_pw_flag_t)(0x1u << 7))

Pkt is currently being posted.

Definition at line 64 of file nm_pkt_wrap.h.

◆ NM_PW_PREFETCHED

#define NM_PW_PREFETCHED   ((nm_pw_flag_t)(0x1u << 6))

Pkt has been prefetched.

Definition at line 61 of file nm_pkt_wrap.h.

◆ NM_PW_PREFETCHING

#define NM_PW_PREFETCHING   ((nm_pw_flag_t)(0x1u << 5))

Pkt marked for prefetching.

Definition at line 58 of file nm_pkt_wrap.h.

◆ NM_PW_RDV_READY

#define NM_PW_RDV_READY   ((nm_pw_flag_t)(0x1u << 20))

rdv for pw is ready; RTR has been received (but couldn't be processed immediately because prefetch was in progress)

Definition at line 103 of file nm_pkt_wrap.h.

◆ NM_PW_RECV

#define NM_PW_RECV   ((nm_pw_flag_t)(0x1u << 11))

pw used for recv

Definition at line 76 of file nm_pkt_wrap.h.

◆ NM_PW_SEND

#define NM_PW_SEND   ((nm_pw_flag_t)(0x1u << 10))

pw used for sending

Definition at line 73 of file nm_pkt_wrap.h.

Typedef Documentation

◆ nm_pw_flag_t

typedef uint32_t nm_pw_flag_t

flags to describe packet wrappers

Definition at line 33 of file nm_pkt_wrap.h.

Function Documentation

◆ nm_pw_add_control()

int nm_pw_add_control ( struct nm_pkt_wrap_s p_pw,
const union nm_header_ctrl_generic_s p_ctrl,
const void *  p_payload 
)

Referenced by nm_tactic_pack_ctrl().

◆ nm_pw_add_data_in_header()

void nm_pw_add_data_in_header ( struct nm_pkt_wrap_s p_pw,
nm_core_tag_t  tag,
nm_seq_t  seq,
struct nm_data_s p_data,
nm_len_t  len,
nm_len_t  chunk_offset,
nm_proto_t  proto_flags 
)

◆ nm_pw_add_req_chunk()

void nm_pw_add_req_chunk ( struct nm_pkt_wrap_s p_pw,
struct nm_req_chunk_s p_req_chunk,
nm_req_chunk_flag_t  flags 
)

◆ nm_pw_alloc_buffer()

struct nm_pkt_wrap_s * nm_pw_alloc_buffer ( struct nm_core p_core)

◆ nm_pw_alloc_global_header()

struct nm_pkt_wrap_s * nm_pw_alloc_global_header ( struct nm_core p_core,
struct nm_trk_s p_trk 
)

◆ nm_pw_alloc_noheader()

struct nm_pkt_wrap_s * nm_pw_alloc_noheader ( struct nm_core p_core)

◆ nm_pw_data_to_iovec()

void nm_pw_data_to_iovec ( struct nm_pkt_wrap_s p_pw)

◆ nm_pw_finalize()

int nm_pw_finalize ( struct nm_pkt_wrap_s p_pw)

◆ nm_pw_free()

void nm_pw_free ( struct nm_core p_core,
struct nm_pkt_wrap_s p_pw 
)

Referenced by nm_pw_ref_dec().

◆ nm_pw_grow_iovec()

struct iovec * nm_pw_grow_iovec ( struct nm_pkt_wrap_s p_pw)

◆ nm_pw_remaining_buf()

static nm_len_t nm_pw_remaining_buf ( struct nm_pkt_wrap_s p_pw)
inlinestatic

remaining space in pw buffer

Definition at line 270 of file nm_pkt_wrap.h.

References assert(), nm_pkt_wrap_s::length, nm_pkt_wrap_s::max_len, and NM_LEN_UNDEFINED.

Referenced by nm_tactic_pack_ctrl().

Here is the call graph for this function:

◆ nm_pw_set_data_raw()

void nm_pw_set_data_raw ( struct nm_pkt_wrap_s p_pw,
struct nm_data_s p_data,
nm_len_t  chunk_len,
nm_len_t  chunk_offset,
const struct nm_data_properties_s p_props 
)

◆ nm_pw_split()

void nm_pw_split ( struct nm_core p_core,
struct nm_pkt_wrap_s p_pw,
struct nm_pkt_wrap_s **  pp_pw2,
nm_len_t  offset 
)

◆ PUK_ALLOCATOR_TYPE_SINGLE() [1/2]

PUK_ALLOCATOR_TYPE_SINGLE ( nm_pw_buf  ,
struct nm_pw_buf_s   
)

Allocator for pkt wrapper with contiguous data block.

Note
single-threaded allocator, needs core lock

◆ PUK_ALLOCATOR_TYPE_SINGLE() [2/2]

PUK_ALLOCATOR_TYPE_SINGLE ( nm_pw_nohd  ,
struct nm_pkt_wrap_s   
)

Allocator for headerless pkt wrapper.

Note
single-threaded allocator, needs core lock

◆ PUK_LIST_CREATE_FUNCS() [1/2]

PUK_LIST_CREATE_FUNCS ( nm_pkt_wrap  )

◆ PUK_LIST_CREATE_FUNCS() [2/2]

PUK_LIST_CREATE_FUNCS ( nm_pw_poll  )

◆ PUK_LIST_DECLARE_TYPE()

PUK_LIST_DECLARE_TYPE ( nm_pkt_wrap  )

generic list containing a pw.

Used to store a pw in: pending_pw_send, prefetch_large_send, pending_large_recv, pending_large_send, lists in strat_prio not for polling

◆ PUK_LIST_DECLARE_TYPE2()

PUK_LIST_DECLARE_TYPE2 ( nm_pw_poll  ,
struct nm_pkt_wrap_s   
)

list used for pw polling without pioman.

Used to store a pw in pw_poll_list.

◆ PUK_LIST_TYPE()

PUK_LIST_TYPE ( nm_pw_pending_rtr  ,
struct nm_gate_s *p_gate;struct nm_header_ctrl_rtr_s header;void *p_payload;   
)

a pending RTR, not processed immediately because prefetch was in progress

Variable Documentation

◆ nm_pw_refcount_completion

const char nm_pw_refcount_completion[]
extern

ref from completion core_task

Referenced by nm_pw_completed_enqueue().

◆ nm_pw_refcount_core

const char nm_pw_refcount_core[]
extern

reference of nmad core on pw

◆ nm_pw_refcount_pioman

const char nm_pw_refcount_pioman[]
extern

ref by pioman ltask

◆ nm_pw_refcount_prefetch

const char nm_pw_refcount_prefetch[]
extern

ref by prefetch

◆ nm_pw_refcount_unexpected

const char nm_pw_refcount_unexpected[]
extern

ref by an unexpected (nm_unexpected_s)