This is the internal interface for packet wrappers, bellow the scheduler. More...
#include <sys/uio.h>
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. More... | |
Functions | |
PUK_LIST_TYPE (nm_pw_pending_rtr, struct nm_pkt_wrap_s *p_rtr_pw;const struct nm_header_ctrl_rtr_s *p_header;) | |
a pending RTR, not processed immediately because prefetch was in progress More... | |
PUK_LIST_DECLARE_TYPE (nm_pkt_wrap) | |
PUK_LIST_CREATE_FUNCS (nm_pkt_wrap) | |
NM_ALLOCATOR_TYPE (nm_pw_nohd, struct nm_pkt_wrap_s) | |
Allocator for headerless pkt wrapper. More... | |
NM_ALLOCATOR_TYPE (nm_pw_buf, struct nm_pw_buf_s) | |
Allocator for pkt wrapper with contiguous data block. More... | |
struct nm_pkt_wrap_s * | nm_pw_alloc_buffer (struct nm_core *p_core) |
struct nm_pkt_wrap_s * | nm_pw_alloc_noheader (struct nm_core *p_core) |
struct nm_pkt_wrap_s * | nm_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) |
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) |
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 More... | |
Packet wrapper flags. | |
Flag constants for the flag field of pw. | |
#define | NM_PW_FLAG_NONE ((nm_pw_flag_t)0x00000000) |
empty pw flags More... | |
#define | NM_PW_NOHEADER ((nm_pw_flag_t)0x00000001) |
Headerless pkt, if set. More... | |
#define | NM_PW_BUFFER ((nm_pw_flag_t)0x00000002) |
pw allocated with NM_MAX_UNEXPECTED contiguous buffer. More... | |
#define | NM_PW_GLOBAL_HEADER ((nm_pw_flag_t)0x00000004) |
pw allocated with a contiguous buffer and a global header has been prepared. More... | |
#define | NM_PW_DYNAMIC_V0 ((nm_pw_flag_t)0x00000008) |
v[0] is dynamically allocated More... | |
#define | NM_PW_FINALIZED ((nm_pw_flag_t)0x00000010) |
Pkt has been finalized- ready to send on the wire. More... | |
#define | NM_PW_PREFETCHING ((nm_pw_flag_t)0x00000020) |
Pkt marked for prefetching. More... | |
#define | NM_PW_PREFETCHED ((nm_pw_flag_t)0x00000040) |
Pkt has been prefetched. More... | |
#define | NM_PW_POSTED ((nm_pw_flag_t)0x00000080) |
Pkt has bee posted. More... | |
#define | NM_PW_COMPLETED ((nm_pw_flag_t)0x00000100) |
send/recv of pw is completed More... | |
#define | NM_PW_SEND ((nm_pw_flag_t)0x00000200) |
pw used for sending More... | |
#define | NM_PW_RECV ((nm_pw_flag_t)0x00000400) |
pw used for recv More... | |
#define | NM_PW_DATA_COPY ((nm_pw_flag_t)0x00000800) |
requests to copy data to contiguous block before sending More... | |
#define | NM_PW_BUF_SEND ((nm_pw_flag_t)0x00001000) |
use buffer-based driver for send More... | |
#define | NM_PW_BUF_RECV ((nm_pw_flag_t)0x00002000) |
use buffer-based driver for recv More... | |
#define | NM_PW_BUF_MIRROR ((nm_pw_flag_t)0x00004000) |
data received in driver buffer has been mirrored in pw buffer More... | |
#define | NM_PW_CLOSED ((nm_pw_flag_t)0x00008000) |
driver reported gate as closed More... | |
#define | NM_PW_POLL_ANY ((nm_pw_flag_t)0x00010000) |
pw is polling on any gate (bit cleared once we know the gate) More... | |
#define | NM_PW_CANCELED ((nm_pw_flag_t)0x00020000) |
pw was canceled More... | |
#define | NM_PW_BLOCKING_CALL ((nm_pw_flag_t)0x00040000) |
pw is marked for a future blocking syscall More... | |
#define | NM_PW_RDV_READY ((nm_pw_flag_t)0x00080000) |
rdv for pw is ready; RTR has been received (but couldn't be processed immediately because prefetch was in progress) More... | |
typedef uint32_t | nm_pw_flag_t |
flags to describe packet wrappers More... | |
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.
#define INITIAL_PKT_NUM 16 |
Fast packet allocator constant for initial number of entries.
Definition at line 197 of file nm_pkt_wrap.h.
#define NM_PW_BLOCKING_CALL ((nm_pw_flag_t)0x00040000) |
pw is marked for a future blocking syscall
Definition at line 98 of file nm_pkt_wrap.h.
#define NM_PW_BUF_MIRROR ((nm_pw_flag_t)0x00004000) |
data received in driver buffer has been mirrored in pw buffer
Definition at line 86 of file nm_pkt_wrap.h.
#define NM_PW_BUF_RECV ((nm_pw_flag_t)0x00002000) |
use buffer-based driver for recv
Definition at line 83 of file nm_pkt_wrap.h.
#define NM_PW_BUF_SEND ((nm_pw_flag_t)0x00001000) |
use buffer-based driver for send
Definition at line 80 of file nm_pkt_wrap.h.
#define NM_PW_BUFFER ((nm_pw_flag_t)0x00000002) |
pw allocated with NM_MAX_UNEXPECTED contiguous buffer.
Used to receive small pw on trk #0
Definition at line 45 of file nm_pkt_wrap.h.
#define NM_PW_CANCELED ((nm_pw_flag_t)0x00020000) |
pw was canceled
Definition at line 95 of file nm_pkt_wrap.h.
#define NM_PW_CLOSED ((nm_pw_flag_t)0x00008000) |
driver reported gate as closed
Definition at line 89 of file nm_pkt_wrap.h.
#define NM_PW_COMPLETED ((nm_pw_flag_t)0x00000100) |
send/recv of pw is completed
Definition at line 68 of file nm_pkt_wrap.h.
#define NM_PW_DATA_COPY ((nm_pw_flag_t)0x00000800) |
requests to copy data to contiguous block before sending
Definition at line 77 of file nm_pkt_wrap.h.
#define NM_PW_DYNAMIC_V0 ((nm_pw_flag_t)0x00000008) |
v[0] is dynamically allocated
Definition at line 53 of file nm_pkt_wrap.h.
#define NM_PW_FINALIZED ((nm_pw_flag_t)0x00000010) |
Pkt has been finalized- ready to send on the wire.
Definition at line 56 of file nm_pkt_wrap.h.
#define NM_PW_FLAG_NONE ((nm_pw_flag_t)0x00000000) |
empty pw flags
Definition at line 37 of file nm_pkt_wrap.h.
#define NM_PW_GLOBAL_HEADER ((nm_pw_flag_t)0x00000004) |
pw allocated with a contiguous buffer and a global header has been prepared.
Used to send small pw on trk #0
Definition at line 50 of file nm_pkt_wrap.h.
#define NM_PW_NOHEADER ((nm_pw_flag_t)0x00000001) |
Headerless pkt, if set.
Definition at line 40 of file nm_pkt_wrap.h.
#define NM_PW_POLL_ANY ((nm_pw_flag_t)0x00010000) |
pw is polling on any gate (bit cleared once we know the gate)
Definition at line 92 of file nm_pkt_wrap.h.
#define NM_PW_POSTED ((nm_pw_flag_t)0x00000080) |
Pkt has bee posted.
Definition at line 65 of file nm_pkt_wrap.h.
#define NM_PW_PREFETCHED ((nm_pw_flag_t)0x00000040) |
Pkt has been prefetched.
Definition at line 62 of file nm_pkt_wrap.h.
#define NM_PW_PREFETCHING ((nm_pw_flag_t)0x00000020) |
Pkt marked for prefetching.
Definition at line 59 of file nm_pkt_wrap.h.
#define NM_PW_RDV_READY ((nm_pw_flag_t)0x00080000) |
rdv for pw is ready; RTR has been received (but couldn't be processed immediately because prefetch was in progress)
Definition at line 101 of file nm_pkt_wrap.h.
#define NM_PW_RECV ((nm_pw_flag_t)0x00000400) |
pw used for recv
Definition at line 74 of file nm_pkt_wrap.h.
#define NM_PW_SEND ((nm_pw_flag_t)0x00000200) |
pw used for sending
Definition at line 71 of file nm_pkt_wrap.h.
typedef uint32_t nm_pw_flag_t |
flags to describe packet wrappers
Definition at line 34 of file nm_pkt_wrap.h.
NM_ALLOCATOR_TYPE | ( | nm_pw_buf | , |
struct nm_pw_buf_s | |||
) |
Allocator for pkt wrapper with contiguous data block.
NM_ALLOCATOR_TYPE | ( | nm_pw_nohd | , |
struct nm_pkt_wrap_s | |||
) |
Allocator for headerless pkt wrapper.
int nm_pw_add_control | ( | struct nm_pkt_wrap_s * | p_pw, |
const union nm_header_ctrl_generic_s * | p_ctrl | ||
) |
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_add_req_chunk | ( | struct nm_pkt_wrap_s * | p_pw, |
struct nm_req_chunk_s * | p_req_chunk, | ||
nm_req_chunk_flag_t | flags | ||
) |
struct nm_pkt_wrap_s * nm_pw_alloc_buffer | ( | struct nm_core * | p_core | ) |
struct nm_pkt_wrap_s * nm_pw_alloc_global_header | ( | struct nm_core * | p_core, |
struct nm_trk_s * | p_trk | ||
) |
struct nm_pkt_wrap_s * nm_pw_alloc_noheader | ( | struct nm_core * | p_core | ) |
void nm_pw_data_to_iovec | ( | struct nm_pkt_wrap_s * | p_pw | ) |
int nm_pw_finalize | ( | struct nm_pkt_wrap_s * | p_pw | ) |
void nm_pw_free | ( | struct nm_core * | p_core, |
struct nm_pkt_wrap_s * | p_pw | ||
) |
struct iovec * nm_pw_grow_iovec | ( | struct nm_pkt_wrap_s * | p_pw | ) |
|
inlinestatic |
remaining space in pw buffer
Definition at line 228 of file nm_pkt_wrap.h.
References nm_pkt_wrap_s::length, nm_pkt_wrap_s::max_len, and NM_LEN_UNDEFINED.
Referenced by nm_tactic_pack_ctrl().
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 | ||
) |
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_LIST_CREATE_FUNCS | ( | nm_pkt_wrap | ) |
PUK_LIST_DECLARE_TYPE | ( | nm_pkt_wrap | ) |
PUK_LIST_TYPE | ( | nm_pw_pending_rtr | , |
struct nm_pkt_wrap_s *p_rtr_pw;const struct nm_header_ctrl_rtr_s *p_header; | |||
) |
a pending RTR, not processed immediately because prefetch was in progress