
#include <sys/time.h>#include <stdlib.h>#include <string.h>#include "vipl_priv.h"Go to the source code of this file.
Functions | |
| void | vip_return_report (VIP_GM *vip_gm_ptr, VIP_NIC *vip_nic_ptr, VIP_VI *vip_vi_ptr, VIP_UCHAR report, VIP_UCHAR recv_side) |
| static VIP_RETURN | vip_check_nic_and_vi (VIP_GM *vip_gm_ptr, gm_recv_event_t *event, VIP_PACKET_EAGER_UR *ptr, VIP_NIC **result_vip_nic_ptr, VIP_VI **result_vip_vi_ptr, VIP_UCHAR recv_side) |
| static void | vip_handle_matching_message (VIP_PACKET *inc_ptr, gm_recv_event_t *event, VIP_GM *vip_gm_ptr) |
| static void | vip_handle_3way_ok (VIP_PACKET_3WAY_OK *ptr, gm_recv_event_t *event, VIP_GM *vip_gm_ptr) |
| static void | vip_handle_3way_done (VIP_PACKET_3WAY_DONE *ptr, gm_recv_event_t *event, VIP_GM *vip_gm_ptr) |
| static void | vip_handle_put_req (VIP_PACKET_PUT_REQ *ptr, gm_recv_event_t *event, VIP_GM *vip_gm_ptr) |
| static void | vip_handle_put_ok (VIP_PACKET_PUT_OK *ptr, gm_recv_event_t *event, VIP_GM *vip_gm_ptr) |
| static void | vip_handle_put_done (VIP_PACKET_PUT_DONE *ptr, gm_recv_event_t *event, VIP_GM *vip_gm_ptr) |
| static void | vip_handle_report (VIP_PACKET_REPORT *ptr, gm_recv_event_t *event, VIP_GM *vip_gm_ptr) |
| void | vip_receive_event (VIP_GM *vip_gm_ptr, VIP_BOOLEAN blocking) |
| void * | vip_plumber_blocking (void *arg) |
| void * | vip_plumber_periodic (void *arg) |
Definition in file vipl_priv_recv.c.
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
This function check the validity of the NIC and VI index in the incoming packet and returns the pointers to the corresponding structures if success.
Definition at line 95 of file vipl_priv_recv.c. References VIP_PACKET_EAGER_UR::net_remote_nic_index, VIP_PACKET_EAGER_UR::net_remote_vi_index, VI_GM_MAX_NIC_HANDLES, VI_GM_MAX_VI, VIP_ASSERT, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_INVALID_NIC_HANDLE, VIP_INVALID_PARAMETER, VIP_INVALID_VI_HANDLE, VIP_MUTEX_LOCK, VIP_GM::vip_nic_ptrs, VIP_NTOH_UINT16, VIP_REPORT_INVALID_SENDER, vip_return_report(), and VIP_SUCCESS. Referenced by vip_handle_3way_done(), vip_handle_3way_ok(), vip_handle_matching_message(), vip_handle_put_done(), vip_handle_put_ok(), and vip_handle_put_req(). |
|
||||||||||||||||
|
This important function handles incoming message trying to match a receive descriptor. If no receive descriptor is found, the adequate behaviour is executed (asynchronous error, connection loss, etc), depending on the reliability level of the VI. In case of matching receive descriptor, the matched descriptor is removed from the queue and the protocol is followed accordingely to the type of message.
Definition at line 168 of file vipl_priv_recv.c. References VIP_SEGMENT_HEADER::address, VIP_PVOID64::Address, VIP_PVOID64::AddressBits, VIP_VI_QUEUE::count_to_process, VIP_DESCRIPTOR::CS, VIP_VI_QUEUE::current_desc, VIP_VI_QUEUE::current_mem, VIP_DATA_SEGMENT::Data, VIP_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_DESCRIPTOR::DS, VIP_VI::gm_dest_id, VIP_VI::gm_dest_port, VIP_DATA_SEGMENT::Handle, VIP_PTAG::id, VIP_CONTROL_SEGMENT::ImmediateData, VIP_VI::index, VIP_NIC::index, VIP_SEGMENT_HEADER::length, VIP_CONTROL_SEGMENT::Length, VIP_DATA_SEGMENT::Length, VIP_PACKET_EAGER_UR::length_16, VIP_PACKET_EAGER_UR::length_24, VIP_PACKET_EAGER_UR::length_8, VIP_DESCRIPTOR_SEGMENT::Local, VIP_NIC::lock, VIP_VI::mtu, VIP_PACKET_PUT_OK::net_local_nic_index, VIP_PACKET_3WAY_OK::net_local_nic_index, VIP_PACKET_PUT_OK::net_local_vi_index, VIP_PACKET_3WAY_OK::net_local_vi_index, VIP_CONTROL_SEGMENT::Next, VIP_CONTROL_SEGMENT::NextHandle, VIP_SEND_REQ::ptr, VIP_VI::rdma_write, VIP_VI::recv_queue, VIP_VI::reliability, VIP_PACKET_3WAY_OK::seg_count, VIP_PACKET_3WAY_OK::segments, VIP_VI::state, VIP_CONTROL_SEGMENT::Status, VIP_SEND_REQ::type, VIP_PACKET_EAGER_UR::type, VI_GM_MAX_SEGMENTS_PER_DESCRIPTOR, VI_GM_MAX_TRANSFER_SIZE, VIP_3WAY_OK_PKT, VIP_3WAY_REQ_PKT, VIP_ABORT, vip_allocate_packet(), VIP_ASSERT, vip_check_memory_handle(), vip_check_nic_and_vi(), VIP_CONTROL_OP_MASK, VIP_CONTROL_OP_RDMAREAD, VIP_CONTROL_OP_RDMAWRITE, VIP_CONTROL_OP_SENDRECV, VIP_CONTROL_RESERVED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_DEBUG_PROTECTED, VIP_EAGER_IMM_PKT, VIP_EAGER_PKT, VIP_ERROR_COMP_PROT, VIP_ERROR_CONN_LOST, VIP_ERROR_RECVQ_EMPTY, VIP_FALSE, VIP_FILL_GENERIC_HEAD, vip_generate_async_error(), VIP_HTON_UINT16, VIP_HTON_UINT64, VIP_MUTEX_UNLOCK, VIP_SEND_REQ::vip_nic_ptr, vip_notify_desc_completion(), VIP_NTOH_UCHAR, VIP_NTOH_UINT32, VIP_NTOH_UINT64, VIP_PACKET::vip_pkt_3way_ok, VIP_PACKET::vip_pkt_eager_ur, VIP_PACKET::vip_pkt_put_ok, VIP_VI::vip_ptag_ptr, VIP_PUT_OK_PKT, VIP_PUT_REQ_IMM_PKT, VIP_REPORT_COMPLETION_RR, VIP_REPORT_RDMA_PROT_ERROR, VIP_REPORT_RECV_QUEUE_EMPTY, VIP_REPORT_REM_DESC_ERROR, vip_return_report(), vip_send_data(), VIP_SEND_REQ_RELIABLE, VIP_SERVICE_RELIABLE_DELIVERY, VIP_SERVICE_RELIABLE_RECEPTION, VIP_SERVICE_UNRELIABLE, VIP_STATE_CONNECTED, VIP_STATUS_DONE, VIP_STATUS_FORMAT_ERROR, VIP_STATUS_IMMEDIATE, VIP_STATUS_LENGTH_ERROR, VIP_STATUS_OP_RECEIVE, VIP_STATUS_OP_REMOTE_RDMA_WRITE, VIP_STATUS_PROTECTION_ERROR, VIP_SUCCESS, VIP_TRUE, VIP_SEND_REQ::vip_vi_ptr, and vip_vi_transition_to_error_state(). Referenced by vip_receive_event(). |
|
||||||||||||||||
|
This function handles incoming Rendez-vous acknowledgement back from the receiving side. Then, one or more buffer are PUT to remote segments, and a completion message is sent.
Definition at line 818 of file vipl_priv_recv.c. References VIP_PVOID64::Address, VIP_PVOID64::AddressBits, VIP_CONTROL_SEGMENT::Control, VIP_DESCRIPTOR::CS, VIP_VI_QUEUE::current_desc, VIP_DATA_SEGMENT::Data, VIP_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_DESCRIPTOR::DS, VIP_VI::gm_dest_id, VIP_VI::gm_dest_port, VIP_CONTROL_SEGMENT::ImmediateData, VIP_VI::index, VIP_NIC::index, VIP_CONTROL_SEGMENT::Length, VIP_SEND_REQ::length, VIP_DATA_SEGMENT::Length, VIP_DESCRIPTOR_SEGMENT::Local, VIP_NIC::lock, VIP_PACKET_3WAY_DONE_IMM::net_imm_data, VIP_PACKET_3WAY_DONE::net_local_nic_index, VIP_PACKET_3WAY_DONE::net_local_vi_index, VIP_SEND_REQ::ptr, VIP_CONTROL_SEGMENT::SegCount, VIP_VI::send_queue, VIP_VI::state, VIP_CONTROL_SEGMENT::Status, VIP_SEND_REQ::target_ptr, VIP_SEND_REQ::type, VIP_3WAY_DONE_IMM_PKT, VIP_3WAY_DONE_PKT, VIP_ABORT, vip_allocate_packet(), VIP_ASSERT, vip_check_nic_and_vi(), VIP_CONTROL_IMMEDIATE, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_SEND_REQ::vip_desc_ptr, VIP_FALSE, VIP_FILL_GENERIC_HEAD, VIP_HTON_UINT16, VIP_HTON_UINT32, VIP_MUTEX_UNLOCK, VIP_SEND_REQ::vip_nic_ptr, VIP_NTOH_UINT16, VIP_NTOH_UINT64, VIP_PACKET::vip_pkt_3way_done, VIP_PACKET::vip_pkt_3way_done_imm, vip_send_data(), VIP_SEND_REQ_RDMA_WRITE, VIP_SEND_REQ_RELIABLE, VIP_STATE_CONNECTED, VIP_STATUS_DONE, VIP_SUCCESS, and VIP_SEND_REQ::vip_vi_ptr. Referenced by vip_receive_event(). |
|
||||||||||||||||
|
This function handles incoming Rendez-vous completion messages from the sending side. The immediate data is eventually copied and the receive descriptor dequeued.
Definition at line 994 of file vipl_priv_recv.c. References VIP_PVOID64::Address, VIP_VI_QUEUE::count_to_process, VIP_DESCRIPTOR::CS, VIP_VI_QUEUE::current_desc, VIP_VI_QUEUE::current_mem, VIP_CONTROL_SEGMENT::ImmediateData, VIP_CONTROL_SEGMENT::Length, VIP_PACKET_3WAY_DONE::length_16, VIP_PACKET_3WAY_DONE::length_24, VIP_PACKET_3WAY_DONE::length_8, VIP_NIC::lock, VIP_CONTROL_SEGMENT::Next, VIP_CONTROL_SEGMENT::NextHandle, VIP_VI::recv_queue, VIP_VI::reliability, VIP_VI::state, VIP_CONTROL_SEGMENT::Status, VIP_PACKET_EAGER_UR::type, VIP_3WAY_DONE_IMM_PKT, VIP_ASSERT, vip_check_nic_and_vi(), VIP_DEBUG, VIP_DEBUG_LABEL, VIP_MUTEX_UNLOCK, vip_notify_desc_completion(), VIP_NTOH_UCHAR, VIP_NTOH_UINT32, VIP_REPORT_COMPLETION_RR, vip_return_report(), VIP_SERVICE_RELIABLE_RECEPTION, VIP_STATE_CONNECTED, VIP_STATUS_DONE, VIP_STATUS_IMMEDIATE, VIP_SUCCESS, and VIP_TRUE. Referenced by vip_receive_event(). |
|
||||||||||||||||
|
This function handles incoming PUT requests from the sender. The destination buffer validity is checked and a PUT acknowledgement is sent back in case of success.
Definition at line 1078 of file vipl_priv_recv.c. References VIP_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_VI::gm_dest_id, VIP_VI::gm_dest_port, VIP_PTAG::id, VIP_VI::index, VIP_NIC::index, VIP_PACKET_PUT_REQ::length_16, VIP_PACKET_PUT_REQ::length_24, VIP_PACKET_PUT_REQ::length_8, VIP_NIC::lock, VIP_PACKET_PUT_OK::net_local_nic_index, VIP_PACKET_PUT_OK::net_local_vi_index, VIP_SEND_REQ::ptr, VIP_VI::rdma_write, VIP_VI::reliability, VIP_VI::state, VIP_SEND_REQ::type, vip_allocate_packet(), VIP_ASSERT, vip_check_memory_handle(), vip_check_nic_and_vi(), VIP_DEBUG, VIP_DEBUG_LABEL, VIP_ERROR_CONN_LOST, VIP_ERROR_RDMAW_PROT, VIP_FALSE, VIP_FILL_GENERIC_HEAD, vip_generate_async_error(), VIP_HTON_UINT16, VIP_INVALID_PTAG_HANDLE, VIP_MUTEX_UNLOCK, VIP_SEND_REQ::vip_nic_ptr, VIP_NTOH_UCHAR, VIP_NTOH_UINT32, VIP_NTOH_UINT64, VIP_PACKET::vip_pkt_put_ok, VIP_VI::vip_ptag_ptr, VIP_PUT_OK_PKT, VIP_REPORT_RDMA_PROT_ERROR, vip_return_report(), vip_send_data(), VIP_SEND_REQ_RELIABLE, VIP_SERVICE_RELIABLE_DELIVERY, VIP_SERVICE_RELIABLE_RECEPTION, VIP_SERVICE_UNRELIABLE, VIP_STATE_CONNECTED, VIP_SUCCESS, VIP_TRUE, VIP_SEND_REQ::vip_vi_ptr, and vip_vi_transition_to_error_state(). Referenced by vip_receive_event(). |
|
||||||||||||||||
|
This function handles incoming PUT Acknowledgement messages back from the receiving side. The data is RDMA to the remote buffer and a PUT Completion message is sent.
Definition at line 1237 of file vipl_priv_recv.c. References VIP_PVOID64::Address, VIP_PVOID64::AddressBits, VIP_CONTROL_SEGMENT::Control, VIP_DESCRIPTOR::CS, VIP_VI_QUEUE::current_desc, VIP_DATA_SEGMENT::Data, VIP_ADDRESS_SEGMENT::Data, VIP_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_DESCRIPTOR::DS, VIP_VI::gm_dest_id, VIP_VI::gm_dest_port, VIP_SEND_REQ::length, VIP_DATA_SEGMENT::Length, VIP_DESCRIPTOR_SEGMENT::Local, VIP_NIC::lock, VIP_PACKET_PUT_DONE::net_local_nic_index, VIP_PACKET_PUT_DONE::net_local_vi_index, VIP_PACKET_EAGER_UR::net_remote_nic_index, VIP_PACKET_EAGER_UR::net_remote_vi_index, VIP_SEND_REQ::ptr, VIP_DESCRIPTOR_SEGMENT::Remote, VIP_VI::send_queue, VIP_VI::state, VIP_CONTROL_SEGMENT::Status, VIP_SEND_REQ::target_ptr, VIP_SEND_REQ::type, vip_allocate_packet(), VIP_ASSERT, vip_check_nic_and_vi(), VIP_CONTROL_IMMEDIATE, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_SEND_REQ::vip_desc_ptr, VIP_FALSE, VIP_FILL_GENERIC_HEAD, VIP_MUTEX_UNLOCK, VIP_SEND_REQ::vip_nic_ptr, VIP_PACKET::vip_pkt_put_done, VIP_PUT_DONE_IMM_PKT, VIP_PUT_DONE_PKT, vip_send_data(), VIP_SEND_REQ_RDMA_WRITE, VIP_SEND_REQ_RELIABLE, VIP_STATE_CONNECTED, VIP_STATUS_DONE, VIP_SUCCESS, and VIP_SEND_REQ::vip_vi_ptr. Referenced by vip_receive_event(). |
|
||||||||||||||||
|
This function handles incoming PUT Completion messages from the sending side. Matching receive descriptor is updated and dequeued in case of immediate data and report is returned depending on VI reliability level.
Definition at line 1346 of file vipl_priv_recv.c. References VIP_PVOID64::Address, VIP_VI_QUEUE::count_to_process, VIP_DESCRIPTOR::CS, VIP_VI_QUEUE::current_desc, VIP_VI_QUEUE::current_mem, VIP_CONTROL_SEGMENT::Length, VIP_PACKET_EAGER_UR::length_16, VIP_PACKET_EAGER_UR::length_24, VIP_PACKET_EAGER_UR::length_8, VIP_NIC::lock, VIP_CONTROL_SEGMENT::Next, VIP_CONTROL_SEGMENT::NextHandle, VIP_VI::recv_queue, VIP_VI::reliability, VIP_VI::state, VIP_CONTROL_SEGMENT::Status, VIP_PACKET_EAGER_UR::type, VIP_ASSERT, vip_check_nic_and_vi(), VIP_DEBUG, VIP_DEBUG_LABEL, VIP_MUTEX_UNLOCK, vip_notify_desc_completion(), VIP_NTOH_UCHAR, VIP_PUT_DONE_IMM_PKT, VIP_REPORT_COMPLETION_RR, vip_return_report(), VIP_SERVICE_RELIABLE_RECEPTION, VIP_STATE_CONNECTED, VIP_STATUS_DONE, VIP_SUCCESS, and VIP_TRUE. Referenced by vip_receive_event(). |
|
||||||||||||||||
|
This function handles incoming internal VI-GM report messages, check various parameters to confirm the accuracy of these reports and behaves as expected by the implementation.
Definition at line 1426 of file vipl_priv_recv.c. References VIP_PVOID64::Address, VIP_DESCRIPTOR::CS, VIP_PACKET_REPORT::net_remote_nic_index, VIP_PACKET_REPORT::net_remote_vi_index, VIP_CONTROL_SEGMENT::Next, VIP_CONTROL_SEGMENT::NextHandle, VIP_PACKET_REPORT::recv_side, VIP_PACKET_REPORT::report, VIP_CONTROL_SEGMENT::Status, VI_GM_MAX_NIC_HANDLES, VI_GM_MAX_VI, VIP_ABORT, VIP_ASSERT, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_ERROR_CONN_LOST, VIP_FALSE, vip_generate_async_error(), VIP_INVALID_NIC_HANDLE, VIP_INVALID_VI_HANDLE, VIP_MUTEX_LOCK, VIP_MUTEX_UNLOCK, VIP_GM::vip_nic_ptrs, vip_notify_desc_completion(), VIP_NTOH_UCHAR, VIP_NTOH_UINT16, vip_process_send_desc(), VIP_REPORT_COMPLETION_RR, VIP_REPORT_CONN_LOST, VIP_REPORT_INVALID_SENDER, VIP_REPORT_RDMA_PROT_ERROR, VIP_REPORT_RECV_QUEUE_EMPTY, VIP_REPORT_REM_DESC_ERROR, VIP_SERVICE_RELIABLE_RECEPTION, VIP_SERVICE_UNRELIABLE, VIP_STATE_ERROR, VIP_STATUS_RDMA_PROT_ERROR, VIP_STATUS_REMOTE_DESC_ERROR, VIP_TRUE, and vip_vi_transition_to_error_state(). Referenced by vip_receive_event(). |
|
||||||||||||
|
This function get events from the GM receive queue, either blocking or non-blocking. The code tries to poll as many events as possible before to return or blocks, and releases the lock in case of blocking (to allow concurrent polling if needed). The lock needs to be taken before calling this function. Moreover, this mutex is not released by this function itself.
Definition at line 1628 of file vipl_priv_recv.c. References VIP_GM::gm_port, VIP_GM::lock, VIP_PACKET_CONN_ACK::type, VIP_PACKET::type, VI_GM_CTRL_GM_SIZE, VIP_3WAY_DONE_IMM_PKT, VIP_3WAY_DONE_PKT, VIP_3WAY_OK_PKT, VIP_3WAY_REQ_PKT, VIP_ABORT, VIP_CONN_ACCEPT_PKT, VIP_CONN_ACK_PKT, VIP_CONN_LIST_REPLY_PKT, VIP_CONN_NOMATCH_PKT, VIP_CONN_PEER_ACCEPT_PKT, VIP_CONN_PEER_REJECT_PKT, VIP_CONN_PEER_REQ_PKT, VIP_CONN_REJECT_PKT, VIP_CONN_REQ_PKT, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_DEBUG_PROTECTED, VIP_EAGER_IMM_PKT, VIP_EAGER_PKT, vip_handle_3way_done(), vip_handle_3way_ok(), vip_handle_conn_accept(), vip_handle_conn_ack(), vip_handle_conn_list(), vip_handle_conn_nomatch(), vip_handle_conn_reject(), vip_handle_conn_req(), vip_handle_matching_message(), vip_handle_put_done(), vip_handle_put_ok(), vip_handle_put_req(), vip_handle_report(), VIP_MUTEX_LOCK, VIP_MUTEX_UNLOCK, VIP_NTOH_UCHAR, VIP_PUT_DONE_IMM_PKT, VIP_PUT_DONE_PKT, VIP_PUT_OK_PKT, VIP_PUT_REQ_IMM_PKT, VIP_PUT_REQ_PKT, VIP_REPORT_PKT, and VIP_TRUE. Referenced by vip_plumber_blocking(), vip_plumber_periodic(), and VipDisconnect(). |
|
|
This thread blocks on a GM port on demand. A process asking the blocking plumber to block for an event by giving a token (increase a semaphore) is blocking itself on a event variable. Then, when the event occurs (or the timeout expires), the initial process removes its token from the blocking plumber. If the latter has no more tokens, it stops to block (avoiding the cost of interrupt when we do not need it).
Definition at line 1895 of file vipl_priv_recv.c. References VIP_GM::blocking_plumber_cancelled, VIP_GM::blocking_plumber_tokens, VIP_GM::lock, VIP_GM::recv_lock, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_MUTEX_LOCK, VIP_MUTEX_UNLOCK, vip_receive_event(), VIP_SEMAPHORE_POST, VIP_SEMAPHORE_WAIT, VIP_THREAD_EXIT, and VIP_TRUE. Referenced by VipOpenNic(). |
|
|
This thread blocks on a GM port periodically. This is useful for improving computation/communication overlap and the progress of the protocols. This will be obsolete when the MCP provides the matching messages support.
Definition at line 1947 of file vipl_priv_recv.c. References VIP_GM::lock, VIP_GM::periodic_plumber_cancelled, VIP_GM::recv_lock, timespec::tv_nsec, timespec::tv_sec, VI_GM_PLUMBER_PERIOD, VIP_ASSERT, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_EVENT_INIT, VIP_EVENT_T, VIP_EVENT_WAIT_TIMEOUT, VIP_FALSE, vip_gettimeofday(), VIP_MUTEX_INIT, VIP_MUTEX_LOCK, VIP_MUTEX_T, VIP_MUTEX_UNLOCK, vip_receive_event(), VIP_THREAD_EXIT, and VIP_TRUE. Referenced by VipOpenNic(). |
1.4.4.