
#include <unistd.h>#include <sys/time.h>#include <syslog.h>#include <stdarg.h>#include <string.h>#include <stdlib.h>#include "vipl_priv.h"Go to the source code of this file.
Functions | |
| VIP_UINT64 | vip_addr2addrbits (VIP_PVOID Address) |
| VIP_PVOID | vip_addrbits2addr (VIP_UINT64 AddressBits) |
| VIP_ENTRY_POINT void | vip_millisleep (unsigned int milliseconds) |
| VIP_ENTRY_POINT int | vip_gettimeofday (struct timeval *tv, void *p) |
| VIP_ENTRY_POINT int | vip_gethostname (char *name, size_t len) |
| VIP_ENTRY_POINT void | vip_notice (char *msg,...) |
| VIP_ENTRY_POINT char * | vip_vsprintf (const char *msg,...) |
| void | vip_debug (const char *function_name, const char *file, VIP_UINT32 line, const char *msg,...) |
| void | vip_debug_gm (const char *function_name, const char *file, VIP_UINT32 line, gm_status_t gm_status, const char *msg,...) |
| void | vi_gm_debug_checksum_compute (VIP_CHKSUM *cksum_ptr, void *ptr, VIP_UINT32 len) |
| void | vi_gm_debug_checksum_check (VIP_UCHAR *msg, void *buf, VIP_CHKSUM *chksum_ptr) |
| void | vi_gm_debug_checksum_copy (VIP_CHKSUM *cksum_target, VIP_CHKSUM *cksum_source) |
| VIP_RETURN | vip_wait_for_notification (VIP_ULONG timeout, VIP_HANDLE *handle_ptr, VIP_EVENT_T *event_ptr, VIP_BOOLEAN(*check)(VIP_PVOID), VIP_PVOID context) |
| void | vip_default_error_callback (VIP_PVOID Context, VIP_ERROR_DESCRIPTOR *ErrorDesc) |
| void | vip_generate_async_error (VIP_NIC *vip_nic_ptr, VIP_VI *vip_vi_ptr, VIP_CQ *vip_cq_ptr, VIP_DESCRIPTOR *vip_desc_ptr, VIP_RESOURCE_CODE resource_code, VIP_ERROR_CODE error_code, VIP_UINT32 opcode) |
| void | vip_notify_desc_completion (VIP_DESCRIPTOR *vip_desc_ptr, VIP_VI *vip_vi_ptr, VIP_BOOLEAN recv_queue) |
| void | vip_vi_transition_to_error_state (VIP_VI *vip_vi_ptr, VIP_BOOLEAN send_conn_lost) |
| VIP_RETURN | vip_check_memory_handle (VIP_NIC *vip_nic_ptr, VIP_MEM_HANDLE vip_mem_handle, VIP_UINT64 range_start, VIP_UINT64 range_length, VIP_UINT32 vip_vi_ptag_id) |
| void | vip_alive_alarm_callback (void *ptr) |
| void | vip_alive_sent_callback (struct gm_port *gm_port, void *context, gm_status_t status) |
| void | vip_remove_conn_waiting_list (VIP_GM *vip_gm_ptr, VIP_CONN *vip_conn_ptr) |
| void | vip_conn_peer_request_alarm_callback (void *ptr) |
| int | vip_avl_compare_function (const void *a, const void *b, void *param) |
| void | vip_avl_free_function (void *data, void *param) |
| VIP_UINT32 | vip_avl_register_memory (VIP_GM *vip_gm_ptr, VIP_UINTPTR start, VIP_UINTPTR end) |
| VIP_RETURN | vip_avl_deregister_memory (VIP_GM *vip_gm_ptr, VIP_UINTPTR start, VIP_UINTPTR end) |
Variables | |
| VIP_MUTEX_ATTR | |
| VIP_MUTEX_T | vip_glob_lock = PTHREAD_MUTEX_INITIALIZER |
| VIP_MUTEX_T | vip_gm_host_name_lock = PTHREAD_MUTEX_INITIALIZER |
| gm_lookaside * | vip_glob_nic_lookaside = NULL |
| VIP_GM * | vip_glob_gm_ptrs [VI_GM_MAX_NICS] = { 0 } |
Definition in file vipl_priv.c.
|
|
This function converts a VIP_PVOID address type into a VIP_UINT64 address bits field coded on 64 bits.
Definition at line 75 of file vipl_priv.c. References VIP_PVOID64::Address, and VIP_PVOID64::AddressBits. Referenced by vip_handle_conn_req(), vip_send_conn_request(), VipConnectAccept(), VipConnectPeerRequest(), and VipConnectRequest(). |
|
|
This function converts an address as a 64 bits integer into a pointer.
Definition at line 99 of file vipl_priv.c. References VIP_PVOID64::Address, and VIP_PVOID64::AddressBits. Referenced by vip_handle_conn_accept(), vip_handle_conn_ack(), vip_handle_conn_list(), vip_handle_conn_nomatch(), vip_handle_conn_reject(), and vip_handle_conn_req(). |
|
|
This function sleeps during a specified number of milliseconds.
Definition at line 118 of file vipl_priv.c. Referenced by main(), vip_destroy_conn_handle_set(), vip_destroy_cq_handle_set(), vip_destroy_vi_handle_set(), vip_vi_transition_to_error_state(), and VipDisconnect(). |
|
||||||||||||
|
This function returns the current time of the day.
Definition at line 142 of file vipl_priv.c. Referenced by vip_plumber_periodic(), vip_wait_for_notification(), and VipOpenNic(). |
|
||||||||||||
|
This function returns the current host name.
Definition at line 173 of file vipl_priv.c. |
|
||||||||||||
|
This function formats a message with eventually multiple arguments and prints it to the standard error.
Definition at line 202 of file vipl_priv.c. |
|
||||||||||||
|
This function formats a message with eventually multiple arguments and returns it in a allocated string.
Definition at line 223 of file vipl_priv.c. |
|
||||||||||||||||||||||||
|
This function prints debug information in a special format. The debug statement includes the name of the function producing the debug output, the thread id, the content of the message, the name of the file and the line number in the file. The number of arguments for the message is variable and the output is directed to the stderr file descriptor.
Definition at line 263 of file vipl_priv.c. References VIP_ASSERT, and VIP_THREAD_SELF. |
|
||||||||||||||||||||||||||||
|
This function prints GM debug information in a special format. The debug statement includes the name of the function producing the debug output, the content of the message with the last GM status code, the name of the file and the line number in the file. The number of arguments for the message is variable and the output is directed to the stderr file descriptor.
Definition at line 306 of file vipl_priv.c. |
|
||||||||||||||||
|
This function computes the CRC32 checksum of a memory area.
Definition at line 332 of file vipl_priv.c. References VIP_CHKSUM::len, and VIP_CHKSUM::sum. Referenced by vi_gm_debug_checksum_check(). |
|
||||||||||||||||
|
This function computes the CRC32 checksum of a memory area and check it with a previuous value to detect data corruption.
Definition at line 353 of file vipl_priv.c. References VIP_CHKSUM::len, VIP_CHKSUM::sum, vi_gm_debug_checksum_compute(), VIP_ABORT, and VIP_DEBUG_LABEL. |
|
||||||||||||
|
This function copies the checksum part of one packet to another one.
Definition at line 380 of file vipl_priv.c. References VIP_CHKSUM::len, and VIP_CHKSUM::sum. |
|
||||||||||||||||||||||||
|
This function blocks until an event occurs, or the timeout expires, or the NIC has been destroyed during the waiting time.
Definition at line 415 of file vipl_priv.c. References VIP_GM::blocking_plumber_tokens, VIP_GM::lock, VIP_NIC::magic, VIP_HANDLE::ref_count, timespec::tv_nsec, timespec::tv_sec, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_EVENT_WAIT, VIP_EVENT_WAIT_TIMEOUT, VIP_FALSE, vip_gettimeofday(), VIP_NIC::vip_gm_ptr, VIP_INFINITE, VIP_INVALID_PARAMETER, VIP_NIC_MAGIC, VIP_HANDLE::vip_nic_ptr, VIP_SEMAPHORE_POST, VIP_SEMAPHORE_WAIT, VIP_SUCCESS, and VIP_TIMEOUT. Referenced by VipConnectAccept(), VipConnectPeerWait(), VipConnectRequest(), VipConnectWait(), VipCQWait(), VipRecvWait(), and VipSendWait(). |
|
||||||||||||
|
This function is the default error callback function. The VI specs require that a specific function is called for each error reported by the VI implementation. This default error handler just prints a description of the error to the system log. It can be dynamically replaced by the application.
Definition at line 526 of file vipl_priv.c. References VIP_ERROR_DESCRIPTOR::ErrorCode, VIP_ERROR_DESCRIPTOR::OpCode, VIP_ERROR_DESCRIPTOR::ResourceCode, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_ERROR_CATASTROPHIC, VIP_ERROR_COMP_PROT, VIP_ERROR_CONN_LOST, VIP_ERROR_POST_DESC, VIP_ERROR_RDMA_TRANSPORT, VIP_ERROR_RDMAR_PROT, VIP_ERROR_RDMAW_ABORT, VIP_ERROR_RDMAW_DATA, VIP_ERROR_RDMAW_PROT, VIP_ERROR_RECVQ_EMPTY, VIP_ERROR_VI_OVERRUN, VIP_STATUS_OP_RDMA_READ, VIP_STATUS_OP_RDMA_WRITE, VIP_STATUS_OP_RECEIVE, VIP_STATUS_OP_REMOTE_RDMA_WRITE, and VIP_STATUS_OP_SEND. Referenced by VipErrorCallback(), and VipOpenNic(). |
|
||||||||||||||||||||||||||||||||
|
This function generates an asynchronous error by building an error descriptor from the various arguments and calling the error handler with it.
Definition at line 654 of file vipl_priv.c. References VIP_ERROR_DESCRIPTOR::CQHandle, VIP_ERROR_DESCRIPTOR::DescriptorPtr, VIP_NIC::error_callback, VIP_NIC::error_callback_context, VIP_ERROR_DESCRIPTOR::ErrorCode, VIP_GM::lock, VIP_NIC::lock, VIP_ERROR_DESCRIPTOR::NicHandle, VIP_ERROR_DESCRIPTOR::OpCode, VIP_ERROR_DESCRIPTOR::ResourceCode, VIP_ERROR_DESCRIPTOR::ViHandle, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, and VIP_NIC::vip_gm_ptr. Referenced by vip_handle_matching_message(), vip_handle_put_req(), vip_handle_report(), vip_notify_desc_completion(), vip_process_send_desc(), vip_resume_callback(), VipPostRecv(), and VipPostSend(). |
|
||||||||||||||||
|
||||||||||||
|
This function changes the state of a VI to the Error state. It also flushes in error pending send or receive descriptors, flushes the completion queue entries if any and finally send a Connection Lost internal report to the remote side if needed.
Definition at line 822 of file vipl_priv.c. References VIP_PVOID64::Address, VIP_CQ_ENTRY::completed, VIP_CQ::count, VIP_VI_QUEUE::count_to_process, VIP_DESCRIPTOR::CS, VIP_VI_QUEUE::current_desc, VIP_VI_QUEUE::current_mem, VIP_CQ::event, VIP_VI_QUEUE::event, VIP_CQ::event_count, VIP_VI_QUEUE::event_count, VIP_VI_QUEUE::first, VIP_VI::handle, VIP_PTAG::id, VIP_VI_QUEUE::last, VIP_GM::lock, VIP_NIC::lock, VIP_CONTROL_SEGMENT::Next, VIP_CQ::next_completion, VIP_CONTROL_SEGMENT::NextHandle, VIP_CQ::queue, VIP_CQ_ENTRY::recv_queue, VIP_VI::recv_queue, VIP_VI::send_queue, VIP_VI::state, VIP_CONTROL_SEGMENT::Status, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, vip_check_memory_handle(), VIP_VI_QUEUE::vip_cq_ptr, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_EVENT_SIGNAL, VIP_FALSE, VIP_NIC::vip_gm_ptr, vip_millisleep(), VIP_HANDLE::vip_nic_ptr, VIP_VI::vip_ptag_ptr, VIP_REPORT_CONN_LOST, vip_return_report(), VIP_STATE_ERROR, VIP_STATUS_DESC_FLUSHED_ERROR, VIP_STATUS_DONE, VIP_SUCCESS, VIP_TRUE, and VIP_CQ_ENTRY::vip_vi_ptr. Referenced by vip_handle_matching_message(), vip_handle_put_req(), vip_handle_report(), vip_notify_desc_completion(), vip_process_send_desc(), vip_resume_callback(), VipDisconnect(), VipPostRecv(), and VipPostSend(). |
|
||||||||||||||||||||||||
|
This function changes the state of a VI to the Error state. It also flushes in error pending send or receive descriptors, flushes the completion queue entries if any and finally send a Connection Lost internal report to the remote side if needed.
Definition at line 997 of file vipl_priv.c. References VIP_NIC::lock, VI_GM_MAX_REGISTER_REGIONS, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_INVALID_MEM_HANDLE, VIP_INVALID_PARAMETER, VIP_INVALID_PTAG_HANDLE, VIP_NIC::vip_mem_handle_ptrs, and VIP_SUCCESS. Referenced by vip_handle_matching_message(), vip_handle_put_req(), vip_notify_desc_completion(), vip_process_send_desc(), vip_vi_transition_to_error_state(), VipPostRecv(), and VipPostSend(). |
|
|
This function is the Heartbeat alarm callback. It is called after the heartbeat GM alarm is raised to send a new heartbeat, or delay the send if the previous heartbeat is not completed yet.
Definition at line 1084 of file vipl_priv.c. References VIP_GM::alive_alarm, VIP_GM::alive_buffer, VIP_GM::conn_mgr_gm_id, VIP_GM::gm_port, VIP_GM::lock, VIP_GM::magic, VIP_PACKET_ALIVE::net_srv_magic, VIP_PACKET_ALIVE::type, VI_GM_CONN_MGR_TTL, VI_GM_CTRL_GM_SIZE, VI_GM_PORT_CONN_MANAGER, vip_alive_alarm_callback(), VIP_ALIVE_PKT, vip_alive_sent_callback(), VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_HTON_UCHAR, VIP_HTON_UINT32, and VIP_NTOH_UINT32. Referenced by vip_alive_alarm_callback(), and VipOpenNic(). |
|
||||||||||||||||
|
This function is the Heartbeat send completion callback. It prints an error if the connection manager is unreachable and signal to the pending alarm that the send is completed.
Definition at line 1139 of file vipl_priv.c. References VIP_GM::alive_buffer, VIP_GM::conn_mgr_gm_id, VIP_GM::lock, VIP_PACKET_ALIVE::net_srv_magic, VI_GM_PORT_CONN_MANAGER, vip_alive_sent_callback(), VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_HTON_UINT32, and VIP_NOTICE. Referenced by vip_alive_alarm_callback(), and vip_alive_sent_callback(). |
|
||||||||||||
|
This function removes the specified connection from the waiting list on the server to prevent matching by an incoming connection request.
Definition at line 1180 of file vipl_priv.c. References VIP_CONN::handle, VIP_GM::head_waiting_conn_ptr, VIP_NIC::lock, VIP_GM::lock, VIP_CONN::next_waiting_conn_ptr, VIP_CONN::prev_waiting_conn_ptr, VIP_GM::tail_waiting_conn_ptr, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_DEBUG, VIP_DEBUG_LABEL, VIP_FALSE, VIP_HANDLE::vip_nic_ptr, VIP_TRUE, and VIP_CONN::waiting_list. Referenced by vip_conn_peer_request_alarm_callback(), vip_handle_conn_accept(), vip_handle_conn_reject(), vip_handle_conn_req(), VipConnectPeerRequest(), VipConnectPeerWait(), VipConnectWait(), and VipDisconnect(). |
|
|
This function is the Connection Peer alarm callback. It is called when the peer connection has reached the timeout and need to be completed, even if no incoming connection request has matched it.
Definition at line 1230 of file vipl_priv.c. References VIP_DEBUG, VIP_DEBUG_LABEL, VIP_EVENT_SIGNAL, VIP_INVALID_CONN_HANDLE, VIP_MUTEX_LOCK, VIP_MUTEX_UNLOCK, VIP_NOT_DONE, vip_remove_conn_waiting_list(), and VIP_TIMEOUT. Referenced by VipConnectPeerRequest(). |
|
||||||||||||||||
|
This function is used as the comparaison function for the AVL library. It compares two memory addresses and returns their relative order.
Definition at line 1276 of file vipl_priv.c. |
|
||||||||||||
|
This function is used to free an entry in the AVL tree, using a lookaside list.
Definition at line 1309 of file vipl_priv.c. |
|
||||||||||||||||
|
This function tries to lookup a specific memory range into the registration AVL tree. For each part of this memory range that is in the AVL tree, aka already registered, the reference count of the AVL entry is incremented. Otherwise, a new AVL entry is created and the corresponding memory segment is registered.
Definition at line 1335 of file vipl_priv.c. References VIP_AVL_RANGE::addr, VIP_AVL_RANGE::count, VIP_GM::gm_port, VIP_AVL_RANGE::length, VIP_GM::lock, VIP_GM::regmem_avl_lookaside, VIP_GM::regmem_avl_tree, VIP_ABORT, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_AVL_TREE_FIND, VIP_AVL_TREE_INSERT, VIP_DEBUG, VIP_DEBUG_GM, VIP_DEBUG_LABEL, VIP_ENTER_IOCTL, and VIP_EXIT_IOCTL. Referenced by VipRegisterMem(). |
|
||||||||||||||||
|
This function lookups a specific memory range into the registration AVL tree. For each part of this memory range with a reference count in the AVL tree greather than 1, the reference count is simply decremented. If the reference count of a segment becomes null, the segment is deregistered and the AVL entry is removed.
Definition at line 1553 of file vipl_priv.c. References VIP_AVL_RANGE::addr, VIP_AVL_RANGE::count, VIP_GM::gm_port, VIP_AVL_RANGE::length, VIP_GM::lock, VIP_GM::regmem_avl_tree, VIP_ASSERT, VIP_ASSERT_MUTEX_LOCKED, VIP_AVL_TREE_DELETE, VIP_AVL_TREE_FIND, VIP_DEBUG, VIP_DEBUG_GM, VIP_DEBUG_LABEL, VIP_ENTER_IOCTL, VIP_ERROR_RESOURCE, VIP_EXIT_IOCTL, and VIP_SUCCESS. Referenced by VipDeregisterMem(), and VipRegisterMem(). |
|
|
Defined a mutex attribute, if supported by the local thread package. Definition at line 30 of file vipl_priv.c. |
|
|
Global VI-GM lock. It is mainly used to protect the access to the global data (VIP_GM structures), when opening or destroying a VI NIC. Definition at line 36 of file vipl_priv.c. Referenced by VipCloseNic(), and VipOpenNic(). |
|
|
GM host name lock. GM is not thread safe but can be easily used in a multithreaded environment. A lock is needed to protect GM functions manipulating the host name. Definition at line 40 of file vipl_priv.c. Referenced by VipConnectPeerRequest(), VipConnectRequest(), and VipNSGetHostByAddr(). |
|
|
The lookaside list used to manage the allocation of VI NIC structures. Definition at line 47 of file vipl_priv.c. Referenced by VipOpenNic(). |
|
|
Array of VIP_GM structures, one per Myrinet board. Definition at line 50 of file vipl_priv.c. Referenced by VipCloseNic(), and VipOpenNic(). |
1.4.4.