Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

vipl_priv_send.c File Reference

#include <stdlib.h>
#include <string.h>
#include "vipl_priv.h"

Go to the source code of this file.

Functions

void vip_process_send_desc (VIP_VI *vip_vi_ptr)
VIP_SEND_REQvip_allocate_packet (VIP_GM *vip_gm_ptr, VIP_UINT32 length)
void vip_send_data (VIP_SEND_REQ *vip_send_req_ptr)
static void vip_flush_fifo_send (VIP_GM *vip_gm_ptr)
static void vip_sent_report_callback_status (VIP_SEND_REQ *vip_send_req_ptr, gm_status_t status)
static void vip_resume_callback (struct gm_port *port, void *context, gm_status_t status)
void vip_sent_callback (struct gm_port *port, void *context, gm_status_t status)


Detailed Description

This file contains the internal functions related to message emission and processing of send events.

Definition in file vipl_priv_send.c.


Function Documentation

void vip_process_send_desc VIP_VI vip_vi_ptr  ) 
 

This function process the first descriptor in the VI send queue, checking too many things required by the VI specs and then posts one or more messages.

Parameters:
vip_vi_ptr (IN) The pointer to the VI structure.
Author:
Patrick Geoffray
Version:
1.0

Definition at line 32 of file vipl_priv_send.c.

References 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_VI::gm_dest_id, VIP_VI::gm_dest_port, VIP_GM::gm_port, VIP_DATA_SEGMENT::Handle, VIP_VI::handle, VIP_PTAG::id, VIP_VI::index, VIP_SEND_REQ::length, VIP_DATA_SEGMENT::Length, VIP_NIC::lock, VIP_GM::lock, VIP_VI::mtu, VIP_PACKET_EAGER_IMM_RR::net_imm_data, VIP_PACKET_EAGER_IMM_RD::net_imm_data, VIP_PACKET_EAGER_IMM_UR::net_imm_data, VIP_PACKET_PUT_DONE::net_local_nic_index, VIP_PACKET_PUT_REQ::net_local_nic_index, VIP_PACKET_3WAY_REQ::net_local_nic_index, VIP_PACKET_EAGER_RR::net_local_nic_index, VIP_PACKET_EAGER_RD::net_local_nic_index, VIP_PACKET_EAGER_IMM_RR::net_local_nic_index, VIP_PACKET_EAGER_IMM_RD::net_local_nic_index, VIP_PACKET_PUT_DONE::net_local_vi_index, VIP_PACKET_PUT_REQ::net_local_vi_index, VIP_PACKET_3WAY_REQ::net_local_vi_index, VIP_PACKET_EAGER_RR::net_local_vi_index, VIP_PACKET_EAGER_RD::net_local_vi_index, VIP_PACKET_EAGER_IMM_RR::net_local_vi_index, VIP_PACKET_EAGER_IMM_RD::net_local_vi_index, VIP_PACKET_PUT_REQ::net_remote_buf, VIP_PACKET_PUT_REQ::net_remote_mem, VIP_CONTROL_SEGMENT::Next, VIP_SEND_REQ::ptr, VIP_VI::reliability, VIP_VI::send_queue, VIP_VI::state, VIP_SEND_REQ::target_ptr, VIP_SEND_REQ::type, VI_GM_EAGER_LENGTH, VI_GM_MAX_SEGMENTS_PER_DESCRIPTOR, VI_GM_MAX_TRANSFER_SIZE, VIP_3WAY_REQ_PKT, VIP_ABORT, vip_allocate_packet(), VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, vip_check_memory_handle(), VIP_CONTROL_IMMEDIATE, 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_SEND_REQ::vip_desc_ptr, VIP_EAGER_IMM_PKT, VIP_EAGER_PKT, VIP_ERROR_CONN_LOST, VIP_ERROR_POST_DESC, VIP_FALSE, VIP_FILL_GENERIC_HEAD, vip_generate_async_error(), VIP_NIC::vip_gm_ptr, VIP_HTON_UINT16, VIP_HTON_UINT32, VIP_HTON_UINT64, VIP_NET_UINT32, VIP_SEND_REQ::vip_nic_ptr, VIP_HANDLE::vip_nic_ptr, vip_notify_desc_completion(), VIP_PACKET::vip_pkt_3way_req, VIP_PACKET::vip_pkt_eager_imm_rd, VIP_PACKET::vip_pkt_eager_imm_rr, VIP_PACKET::vip_pkt_eager_imm_ur, VIP_PACKET::vip_pkt_eager_rd, VIP_PACKET::vip_pkt_eager_rr, VIP_PACKET::vip_pkt_put_done, VIP_PACKET::vip_pkt_put_req, vip_process_send_desc(), VIP_VI::vip_ptag_ptr, VIP_PUT_DONE_IMM_PKT, VIP_PUT_DONE_PKT, VIP_PUT_REQ_IMM_PKT, VIP_PUT_REQ_PKT, vip_send_data(), VIP_SEND_REQ_RDMA_WRITE, VIP_SEND_REQ_RELIABLE, VIP_SEND_REQ_UNRELIABLE, VIP_SERVICE_RELIABLE_DELIVERY, VIP_SERVICE_RELIABLE_RECEPTION, VIP_SERVICE_UNRELIABLE, VIP_STATE_CONNECTED, VIP_STATE_ERROR, VIP_STATUS_DESC_FLUSHED_ERROR, VIP_STATUS_FORMAT_ERROR, VIP_STATUS_LENGTH_ERROR, VIP_STATUS_OP_RDMA_WRITE, VIP_STATUS_OP_SEND, VIP_STATUS_PROTECTION_ERROR, VIP_SUCCESS, VIP_TRUE, VIP_SEND_REQ::vip_vi_ptr, and vip_vi_transition_to_error_state().

Referenced by vip_handle_report(), vip_process_send_desc(), vip_resume_callback(), vip_sent_callback(), and VipPostSend().

VIP_SEND_REQ* vip_allocate_packet VIP_GM vip_gm_ptr,
VIP_UINT32  length
 

This function process the first descriptor in the VI send queue, checking too many things required by the VI specs and then posts one or more messages.

Returns:
An initialized send request referencing if needed a pre-allocated send buffer.
Parameters:
vip_gm_ptr (IN) The pointer to the main GM structure.
length (IN) The length of the message to send.
Author:
Patrick Geoffray
Version:
1.0

Definition at line 588 of file vipl_priv_send.c.

References VIP_PVOID64::AddressBits, VIP_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_SEND_REQ::length, VIP_GM::lock, VIP_SEND_REQ::next, VIP_SEND_REQ::ptr, VIP_GM::send_buf_free_cnt, VIP_GM::send_buffers_free, VIP_SEND_REQ::target_ptr, VIP_SEND_REQ::type, VI_GM_EAGER_LENGTH, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_SEND_REQ::vip_desc_ptr, VIP_SEND_REQ::vip_gm_ptr, VIP_SEND_REQ::vip_nic_ptr, VIP_SEND_REQ_DMA, VIP_GM::vip_send_req_lookaside, VIP_SEND_REQ_MALLOC, VIP_SEND_REQ_NONE, and VIP_SEND_REQ::vip_vi_ptr.

Referenced by vip_handle_3way_ok(), vip_handle_conn_accept(), vip_handle_conn_req(), vip_handle_matching_message(), vip_handle_put_ok(), vip_handle_put_req(), vip_process_send_desc(), vip_return_report(), vip_send_conn_request(), VipConnectAccept(), VipConnectPeerRequest(), VipConnectReject(), and VipConnectRequest().

void vip_send_data VIP_SEND_REQ vip_send_req_ptr  ) 
 

This function process a send request and post effectively a send to GM. In case of lack of ressources (GM send tokens), the send request is queued to be processed later.

Parameters:
vip_send_req_ptr (IN) The pointer to the send request to process.
Author:
Patrick Geoffray
Version:
1.0

Definition at line 662 of file vipl_priv_send.c.

References VIP_PVOID64::Address, VIP_PVOID64::AddressBits, VIP_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_GM::gm_port, VIP_SEND_REQ::length, VIP_GM::lock, VIP_SEND_REQ::next, VIP_VI::pending_callbacks, VIP_SEND_REQ::ptr, VIP_VI::reliability, VIP_GM::send_fifo_head, VIP_GM::send_fifo_queued, VIP_GM::send_fifo_tail, VIP_GM::send_tokens, VIP_SEND_REQ::target_ptr, VIP_SEND_REQ::type, VI_GM_CTRL_GM_SIZE, VIP_ABORT, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_SEND_REQ::vip_desc_ptr, VIP_SEND_REQ::vip_gm_ptr, VIP_SEND_REQ_MALLOC, VIP_SEND_REQ_NONE, VIP_SEND_REQ_OPMASK, VIP_SEND_REQ_RDMA_WRITE, VIP_SEND_REQ_RELIABLE, VIP_SEND_REQ_UNRELIABLE, vip_sent_callback(), VIP_SERVICE_UNRELIABLE, and VIP_SEND_REQ::vip_vi_ptr.

Referenced by vip_handle_3way_ok(), vip_handle_conn_accept(), vip_handle_conn_req(), vip_handle_matching_message(), vip_handle_put_ok(), vip_handle_put_req(), vip_process_send_desc(), vip_return_report(), vip_send_conn_request(), VipConnectAccept(), VipConnectPeerRequest(), VipConnectReject(), and VipConnectRequest().

static void vip_flush_fifo_send VIP_GM vip_gm_ptr  )  [static]
 

This function try to process queued send requests if ressources are available. In case of success, the send requests are removed from the queue, the processing is delayed again otherwise.

Parameters:
vip_gm_ptr (IN) The pointer to the main GM structure.
Author:
Patrick Geoffray
Version:
1.0

Definition at line 795 of file vipl_priv_send.c.

References VIP_PVOID64::Address, VIP_PVOID64::AddressBits, VIP_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_GM::gm_port, VIP_SEND_REQ::length, VIP_GM::lock, VIP_SEND_REQ::next, VIP_VI::pending_callbacks, VIP_SEND_REQ::ptr, VIP_VI::reliability, VIP_GM::send_buf_free_cnt, VIP_GM::send_buffers_free, VIP_GM::send_fifo_head, VIP_GM::send_fifo_queued, VIP_GM::send_fifo_tail, VIP_GM::send_tokens, VIP_SEND_REQ::target_ptr, VIP_SEND_REQ::type, VI_GM_CTRL_GM_SIZE, VIP_ABORT, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_SEND_REQ::vip_desc_ptr, VIP_SEND_REQ::vip_gm_ptr, VIP_SEND_REQ_DMA, VIP_SEND_REQ_MALLOC, VIP_SEND_REQ_NONE, VIP_SEND_REQ_OPMASK, VIP_SEND_REQ_RDMA_WRITE, VIP_SEND_REQ_RELIABLE, VIP_SEND_REQ_UNRELIABLE, vip_sent_callback(), VIP_SERVICE_UNRELIABLE, and VIP_SEND_REQ::vip_vi_ptr.

Referenced by vip_resume_callback(), and vip_sent_callback().

static void vip_sent_report_callback_status VIP_SEND_REQ vip_send_req_ptr,
gm_status_t  status
[static]
 

This function generates an error message in case of failure in the completion of a message.

Parameters:
vip_send_req_ptr (IN) The pointer to the send request that failed.
status (IN) The GM status after the failure.
Author:
Patrick Geoffray
Version:
1.0

Definition at line 933 of file vipl_priv_send.c.

References VIP_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_GM::gm_id, VIP_GM::gm_port, VIP_GM::gm_port_id, VI_GM_PORT_CONN_MANAGER, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_DEBUG_PROTECTED, and VIP_SEND_REQ::vip_gm_ptr.

Referenced by vip_sent_callback().

static void vip_resume_callback struct gm_port *  port,
void *  context,
gm_status_t  status
[static]
 

This function is called after GM has resuming sends on a connection that has experienced GM errors previously. GM's API really sucks, we have to do all of the dirty work.

Parameters:
port (IN) The GM port used for this message.
context (IN) The context passed to GM by the resume call, contains the pointer to the corresponding send request.
status (IN) The GM status after the completion of the resume.
Author:
Patrick Geoffray
Version:
1.0

Definition at line 981 of file vipl_priv_send.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_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_NIC::lock, VIP_GM::lock, VIP_GM::max_send_tokens, VIP_CONTROL_SEGMENT::Next, VIP_CONTROL_SEGMENT::NextHandle, VIP_VI::pending_callbacks, VIP_SEND_REQ::ptr, VIP_VI::reliability, VIP_GM::send_buf_free_cnt, VIP_GM::send_buffers_free, VIP_GM::send_fifo_head, VIP_VI::send_queue, VIP_GM::send_tokens, VIP_VI::state, VIP_CONTROL_SEGMENT::Status, VIP_SEND_REQ::type, VIP_ABORT, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_SEND_REQ::vip_desc_ptr, VIP_ERROR_CATASTROPHIC, VIP_ERROR_CONN_LOST, VIP_FALSE, vip_flush_fifo_send(), vip_generate_async_error(), VIP_SEND_REQ::vip_gm_ptr, VIP_INVALID_NIC_HANDLE, VIP_MUTEX_LOCK, VIP_MUTEX_UNLOCK, VIP_SEND_REQ::vip_nic_ptr, vip_notify_desc_completion(), vip_process_send_desc(), VIP_SEND_REQ_DMA, VIP_SEND_REQ_MALLOC, VIP_SEND_REQ_NONE, VIP_SEND_REQ_TYPEMASK, VIP_SERVICE_UNRELIABLE, VIP_STATE_CONNECT_PENDING, VIP_STATE_ERROR, VIP_STATUS_OP_MASK, VIP_STATUS_TRANSPORT_ERROR, VIP_TRUE, VIP_SEND_REQ::vip_vi_ptr, and vip_vi_transition_to_error_state().

Referenced by vip_sent_callback().

void vip_sent_callback struct gm_port *  port,
void *  context,
gm_status_t  status
 

This function is called after completion of a send by the GM layer. It checks for failures and update various related internal structures.

Parameters:
port (IN) The GM port used for this message.
context (IN) The context passed to GM by the send call, contains the pointer to the corresponding send request.
status (IN) The GM status after the completion of the send.
Author:
Patrick Geoffray
Version:
1.0

Definition at line 1125 of file vipl_priv_send.c.

References VIP_SEND_REQ::dest_gm_id, VIP_SEND_REQ::dest_port_id, VIP_NIC::lock, VIP_GM::lock, VIP_GM::max_send_tokens, VIP_SEND_REQ::ptr, VIP_GM::send_buf_free_cnt, VIP_GM::send_buffers_free, VIP_GM::send_fifo_head, VIP_GM::send_tokens, VIP_SEND_REQ::type, VIP_ABORT, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_SEND_REQ::vip_desc_ptr, VIP_FALSE, vip_flush_fifo_send(), VIP_SEND_REQ::vip_gm_ptr, VIP_INVALID_NIC_HANDLE, VIP_INVALID_VI_HANDLE, VIP_MUTEX_LOCK, VIP_MUTEX_UNLOCK, VIP_SEND_REQ::vip_nic_ptr, vip_notify_desc_completion(), vip_process_send_desc(), vip_resume_callback(), VIP_SEND_REQ_DMA, VIP_SEND_REQ_MALLOC, VIP_SEND_REQ_NONE, VIP_SEND_REQ_TYPEMASK, vip_sent_report_callback_status(), VIP_SERVICE_RELIABLE_RECEPTION, and VIP_SEND_REQ::vip_vi_ptr.

Referenced by vip_flush_fifo_send(), and vip_send_data().

VI-GM-1.3 by Myricom © 1997-2006. Documentation generated on 20 May 2006 by doxygen 1.4.4.