-
Notifications
You must be signed in to change notification settings - Fork 0
Day in the life of fi_send fi_recv
Amith Abraham edited this page Sep 14, 2016
·
15 revisions
There is a one to one correspondence between application's invocation of fi_send
, fi_recv
, and a gnix fab_req
.
This article covers basic code flow through gnix_send and gnix_recv
gnix_send populates a fab request based on the parameters provided to the function call, and finally will make another function call to try to initiate the send. The basic steps of gnix_send are outlined below.
- Basic Sanity checking
- Check that the provided
EP
has asend_cq
- Check that size of the send is lower than
GNIX_INJECT_SIZE
(WithFI_INJECT
flag present) - Check
FI_TRIGGER
- Determine whether the send is short (eager) or long (rendezvous). If the message is longer than the rendezvous threshold SMSG cannot be used, so both send and receive must handle this case differently.
rendezvous = len >= ep->domain->params.msg_rendezvous_thresh;
- If rendezvous, a
memory descriptor
must be registered.
- Get Virtual Channel
- Allocate Fab Request
- Populate Fab Request (Expand on this)
- If FI_TAGGED req->msg.tag
- If rendezvous req->msg.send_info[0].mem_hndl
- If FI_INJECT
- Does some stuff (expand here)
-
Initiate
gnix_vc_queue_tx_req
. This attempts to initiate a TX request. If the TX queue is blocked (due to low resources or aFI_FENCE
request), the request is scheduled to be sent later.gnix_vc_queue_tx_req
will eventually call on awork_fn
to process the request. In the case ofgnix_send
, the work function provided isgnix_send_req
.
- Basic sanity checking.
- Check for EP and NIC
- gnix_nic_tx_alloc
- **Populate tdesc ** This is done differently based on the type of transaction (eager or rendezvous). In each case, a different portion of the struct will be populated -
tdesc->eager_hdr
ortdesc->rndzv_start_hdr
- Ensure there is an associated memory descriptor.
- Populate tdesc->rndzv_start_hdr
- flags
- imm
- msg_tag
- mdh
- addr
- len *req_addr
- GNI_READ_ALIGN_MASK (what is this step?)
- Changes are made to rndzv_start_hdr.head and .tail
- hdr and hdr_len are set to equal rndzv_start header and its size.
- Data is set to null.
- data = Null data_len= 0
- Populate tdesc->eager_hdr
- flags
- imm
- msg_tag
- len
- hdr, hdr_len, data, and data_len are populated.
Since this isn't a rndzv the send length should always be the cumulative length of all the send_info lengths
TODO
- Basic Sanity Checking
- Check
EP
hasrecv_cq
- Check
msg_recv_allowed
ortagged_recv_allowed
-
gnix_msg_addr_lookup
(expand on this)
- gnix_msg_queues (expand here)
- Acquire lock
- Look for a matching receive request
- Populate Local Fields
-
Check if using Peek/Claim,Discard (P/C/D) matching flags
(
FI_DISCARD
,FI_PEEK
) - Determine what kind of receive request was received, rendezvous or eager?
- Send length is truncated to receive buffer size
- Data is copied from eager msg to receive buffer (expand here)
- Generate recv completion
- If using
FI_MULTI_RECV
another space is left in the receive buffer. Go back to step 7 from previous section and proceed again. gnix_fr_free
TODO
TODO