NewMadeleine

Documentation

« back to PM2 home.
Requests packing/unpacking

Data Structures

struct  nm_chunk_s
 
struct  nm_req_chunk_s
 a chunk of request More...
 
struct  nm_req_s
 a generic pack/unpack request More...
 

Typedefs

typedef void(* nm_injector_pull_data_t) (struct nm_req_s *p_req, const struct nm_data_s *p_data, nm_len_t chunk_offset, nm_len_t chunk_len, void *p_ref)
 user-supplied function called to pull data to posted request through nmad core p_req is the user request that matched this chunk p_data is the memory buffer where to copy the chunk (may be different from p_req->data in case we are actually peeking.
 

Functions

 PUK_LIST_DECLARE_TYPE (nm_req_chunk)
 
 PUK_LIST_DECLARE_TYPE (nm_req)
 
void nm_core_pack_init (struct nm_core *p_core, struct nm_req_s *p_pack)
 initializes an empty pack request
 
void nm_core_pack_data (nm_core_t p_core, struct nm_req_s *p_pack, const struct nm_data_s *p_data)
 build a pack request from data descriptor
 
void nm_core_pack_send (struct nm_core *p_core, struct nm_req_s *p_pack, nm_core_tag_t tag, nm_gate_t p_gate, nm_req_flag_t flags)
 set tag/gate/flags for pack request
 
void nm_core_pack_submit (struct nm_core *p_core, struct nm_req_s *p_pack)
 post a pack request
 
void nm_core_pack_set_priority (struct nm_core *p_core, struct nm_req_s *p_pack, nm_prio_t priority)
 set a priority for the given pack request
 
static void nm_core_pack_set_hlen (struct nm_core *p_core __attribute__((unused)), struct nm_req_s *p_pack, nm_len_t hlen)
 set a header length for the given pack request
 
void nm_core_pack_submit_chunks (struct nm_core *p_core, struct nm_req_s *p_pack, int n, const struct nm_chunk_s *p_chunks)
 
void nm_core_unpack_init (struct nm_core *p_core, struct nm_req_s *p_unpack)
 initializes an empty unpack request
 
void nm_core_unpack_offset (struct nm_core *p_core, struct nm_req_s *p_unpack, nm_len_t offset)
 set an offset on data; data before offset will be discarded
 
void nm_core_unpack_data (struct nm_core *p_core, struct nm_req_s *p_unpack, const struct nm_data_s *p_data)
 build an unpack request from data descriptor
 
void nm_core_unpack_match_recv (struct nm_core *p_core, struct nm_req_s *p_unpack, nm_gate_t p_gate, nm_core_tag_t tag, nm_core_tag_t tag_mask)
 match an unpack request with given gate/tag, next sequence number assumed
 
void nm_core_unpack_match_event (struct nm_core *p_core, struct nm_req_s *p_unpack, const struct nm_core_event_s *p_event)
 match an unpack request with a packet that triggered an event
 
void nm_core_unpack_submit (struct nm_core *p_core, struct nm_req_s *p_unpack, nm_req_flag_t flags)
 submit an unpack request
 
int nm_core_unpack_peek (struct nm_core *p_core, struct nm_req_s *p_unpack, const struct nm_data_s *p_data, nm_len_t peek_offset, nm_len_t peek_len)
 peeks unexpected data without consumming it.
 
int nm_core_unpack_iprobe (struct nm_core *p_core, struct nm_req_s *p_unpack)
 probes whether an incoming packet matched this unposted request.
 
int nm_core_unpack_cancel (struct nm_core *p_core, struct nm_req_s *p_unpack)
 cancel a pending unpack
 
int nm_core_iprobe (struct nm_core *p_core, nm_gate_t p_gate, nm_core_tag_t tag, nm_core_tag_t tag_mask, nm_gate_t *pp_out_gate, nm_core_tag_t *p_out_tag, nm_len_t *p_out_size)
 probe unexpected packet, check matching for (packet_tag & tag_mask) == tag
 
void nm_core_flush (struct nm_core *p_core)
 Flush pending packs (if supported by the strategy).
 
nm_seq_t nm_core_send_seq_get (struct nm_core *p_core, nm_gate_t p_gate, nm_core_tag_t tag)
 get a seq number in the out stream, to route packet outside of nmad core
 
void nm_core_inject_chunk (struct nm_core *p_core, nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq, nm_len_t chunk_offset, nm_len_t chunk_len, int is_last_chunk, nm_injector_pull_data_t p_pull_data, void *p_ref)
 inject a packet in nmad core as if it arrived from network.
 
void nm_core_inject_complete (struct nm_core *p_core, struct nm_req_s *p_req, nm_len_t chunk_offset, nm_len_t chunk_len)
 notify data was injected in a matched request, but do not finalize the request (the status will be NM_STATUS_UNPACK_COMPLETED).
 
void nm_core_inject_finalize (struct nm_core *p_core, struct nm_req_s *p_req)
 finalize an injected request that was only completed.
 
void nm_core_inject_complete_finalize (struct nm_core *p_core, struct nm_req_s *p_req, nm_len_t chunk_offset, nm_len_t chunk_len)
 notify data was injected in a matched request and finalize this request.
 
void nm_core_unpack_partition_set (struct nm_req_s *p_unpack, int n_partitions)
 
void nm_core_unpack_partition_free (struct nm_req_s *p_unpack)
 
int nm_core_unpack_partition_test (struct nm_req_s *p_unpack, int partition)
 

Detailed Description

Typedef Documentation

◆ nm_injector_pull_data_t

typedef void(* nm_injector_pull_data_t) (struct nm_req_s *p_req, const struct nm_data_s *p_data, nm_len_t chunk_offset, nm_len_t chunk_len, void *p_ref)

user-supplied function called to pull data to posted request through nmad core p_req is the user request that matched this chunk p_data is the memory buffer where to copy the chunk (may be different from p_req->data in case we are actually peeking.

chunk_offset, chunk_len describe the chunk we are receiving p_ref user-supplied reference given to nm_core_inject_chunk()

Definition at line 602 of file nm_core_interface.h.

Function Documentation

◆ nm_core_flush()

void nm_core_flush ( struct nm_core p_core)

Flush pending packs (if supported by the strategy).

◆ nm_core_inject_chunk()

void nm_core_inject_chunk ( struct nm_core p_core,
nm_gate_t  p_gate,
nm_core_tag_t  tag,
nm_seq_t  seq,
nm_len_t  chunk_offset,
nm_len_t  chunk_len,
int  is_last_chunk,
nm_injector_pull_data_t  p_pull_data,
void *  p_ref 
)

inject a packet in nmad core as if it arrived from network.

p_pull_data is called when a matching request is posted

◆ nm_core_inject_complete()

void nm_core_inject_complete ( struct nm_core p_core,
struct nm_req_s p_req,
nm_len_t  chunk_offset,
nm_len_t  chunk_len 
)

notify data was injected in a matched request, but do not finalize the request (the status will be NM_STATUS_UNPACK_COMPLETED).

◆ nm_core_inject_complete_finalize()

void nm_core_inject_complete_finalize ( struct nm_core p_core,
struct nm_req_s p_req,
nm_len_t  chunk_offset,
nm_len_t  chunk_len 
)

notify data was injected in a matched request and finalize this request.

◆ nm_core_inject_finalize()

void nm_core_inject_finalize ( struct nm_core p_core,
struct nm_req_s p_req 
)

finalize an injected request that was only completed.

◆ nm_core_iprobe()

int nm_core_iprobe ( struct nm_core p_core,
nm_gate_t  p_gate,
nm_core_tag_t  tag,
nm_core_tag_t  tag_mask,
nm_gate_t pp_out_gate,
nm_core_tag_t p_out_tag,
nm_len_t p_out_size 
)

probe unexpected packet, check matching for (packet_tag & tag_mask) == tag

◆ nm_core_pack_data()

void nm_core_pack_data ( nm_core_t  p_core,
struct nm_req_s p_pack,
const struct nm_data_s p_data 
)

build a pack request from data descriptor

Referenced by nm_sr_send_pack_data().

◆ nm_core_pack_init()

void nm_core_pack_init ( struct nm_core p_core,
struct nm_req_s p_pack 
)

initializes an empty pack request

Referenced by nm_sr_send_init().

◆ nm_core_pack_send()

void nm_core_pack_send ( struct nm_core p_core,
struct nm_req_s p_pack,
nm_core_tag_t  tag,
nm_gate_t  p_gate,
nm_req_flag_t  flags 
)

set tag/gate/flags for pack request

Referenced by nm_sr_send_dest(), nm_sr_send_issend(), and nm_sr_send_rsend().

◆ nm_core_pack_set_hlen()

static void nm_core_pack_set_hlen ( struct nm_core *p_core   __attribute__(unused),
struct nm_req_s p_pack,
nm_len_t  hlen 
)
inlinestatic

set a header length for the given pack request

Definition at line 544 of file nm_core_interface.h.

References nm_req_s::hlen, hlen, and nm_req_s::pack.

Referenced by nm_sr_send_header().

◆ nm_core_pack_set_priority()

void nm_core_pack_set_priority ( struct nm_core p_core,
struct nm_req_s p_pack,
nm_prio_t  priority 
)

set a priority for the given pack request

Referenced by nm_sr_send_set_priority().

◆ nm_core_pack_submit()

void nm_core_pack_submit ( struct nm_core p_core,
struct nm_req_s p_pack 
)

post a pack request

Referenced by nm_sr_send_issend(), nm_sr_send_rsend(), and nm_sr_send_submit().

◆ nm_core_pack_submit_chunks()

void nm_core_pack_submit_chunks ( struct nm_core p_core,
struct nm_req_s p_pack,
int  n,
const struct nm_chunk_s p_chunks 
)

◆ nm_core_send_seq_get()

nm_seq_t nm_core_send_seq_get ( struct nm_core p_core,
nm_gate_t  p_gate,
nm_core_tag_t  tag 
)

get a seq number in the out stream, to route packet outside of nmad core

◆ nm_core_unpack_cancel()

int nm_core_unpack_cancel ( struct nm_core p_core,
struct nm_req_s p_unpack 
)

cancel a pending unpack

Note
cancel may fail if matching was already done.

◆ nm_core_unpack_data()

void nm_core_unpack_data ( struct nm_core p_core,
struct nm_req_s p_unpack,
const struct nm_data_s p_data 
)

build an unpack request from data descriptor

Referenced by nm_sr_recv_unpack_data().

◆ nm_core_unpack_init()

void nm_core_unpack_init ( struct nm_core p_core,
struct nm_req_s p_unpack 
)

initializes an empty unpack request

Referenced by nm_sr_recv_init().

◆ nm_core_unpack_iprobe()

int nm_core_unpack_iprobe ( struct nm_core p_core,
struct nm_req_s p_unpack 
)

probes whether an incoming packet matched this unposted request.

in case of success, request and packet are associated and request must be posted.

Referenced by nm_sr_recv_iprobe().

◆ nm_core_unpack_match_event()

void nm_core_unpack_match_event ( struct nm_core p_core,
struct nm_req_s p_unpack,
const struct nm_core_event_s p_event 
)

match an unpack request with a packet that triggered an event

Referenced by nm_sr_recv_match_event().

◆ nm_core_unpack_match_recv()

void nm_core_unpack_match_recv ( struct nm_core p_core,
struct nm_req_s p_unpack,
nm_gate_t  p_gate,
nm_core_tag_t  tag,
nm_core_tag_t  tag_mask 
)

match an unpack request with given gate/tag, next sequence number assumed

Referenced by nm_sr_recv_match().

◆ nm_core_unpack_offset()

void nm_core_unpack_offset ( struct nm_core p_core,
struct nm_req_s p_unpack,
nm_len_t  offset 
)

set an offset on data; data before offset will be discarded

Referenced by nm_sr_recv_offset().

◆ nm_core_unpack_partition_free()

void nm_core_unpack_partition_free ( struct nm_req_s p_unpack)

◆ nm_core_unpack_partition_set()

void nm_core_unpack_partition_set ( struct nm_req_s p_unpack,
int  n_partitions 
)

◆ nm_core_unpack_partition_test()

int nm_core_unpack_partition_test ( struct nm_req_s p_unpack,
int  partition 
)

◆ nm_core_unpack_peek()

int nm_core_unpack_peek ( struct nm_core p_core,
struct nm_req_s p_unpack,
const struct nm_data_s p_data,
nm_len_t  peek_offset,
nm_len_t  peek_len 
)

peeks unexpected data without consumming it.

offset & len are relative to p_data

Referenced by nm_sr_recv_peek(), and nm_sr_recv_peek_offset().

◆ nm_core_unpack_submit()

void nm_core_unpack_submit ( struct nm_core p_core,
struct nm_req_s p_unpack,
nm_req_flag_t  flags 
)

submit an unpack request

Referenced by nm_sr_recv_post().

◆ PUK_LIST_DECLARE_TYPE() [1/2]

PUK_LIST_DECLARE_TYPE ( nm_req  )

◆ PUK_LIST_DECLARE_TYPE() [2/2]

PUK_LIST_DECLARE_TYPE ( nm_req_chunk  )