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

vipcqnotify.c File Reference

#include "vipl_priv.h"

Go to the source code of this file.

Functions

VIP_ENTRY_POINT VIP_RETURN VipCQNotify (VIP_CQ_HANDLE CQHandle, VIP_PVOID Context, void(*Handler)(VIP_PVOID Context, VIP_NIC_HANDLE NicHandle, VIP_VI_HANDLE ViHandle, VIP_BOOLEAN RecvQueue))


Detailed Description

The VI-GM function VipCQNotify implementation.

Definition in file vipcqnotify.c.


Function Documentation

VIP_ENTRY_POINT VIP_RETURN VipCQNotify VIP_CQ_HANDLE  CQHandle,
VIP_PVOID  Context,
void(*)(VIP_PVOID Context, VIP_NIC_HANDLE NicHandle, VIP_VI_HANDLE ViHandle, VIP_BOOLEAN RecvQueue)  Handler
 

VipCQNotify is used by the VI Consumer to request that a Handler routine be called when a Descriptor completes on a VI Work Queue that is associated with a Completion Queue.

VipCQNotify checks the Entry on the head of the Completion queue to see if it indicates that a Descriptor has been marked complete. If there is an entry, the Entry is removed from the Completion Queue and the Handler associated with the Entry is invoked. The ViHandle and RecvQueue are set appropriately to indicate to the VI Consumer which Work Queue contains the completed Descriptor.

If there is no valid Completion Queue Entry, VipCQNotify enables interrupts for the given Completion Queue. When a Completion Queue Entry is generated, the handler will be invoked.

This registration is only associated with the Completion Queue for a single entry. In order for the Handler to be invoked multiple times, the function must be called multiple times. Multiple handlers can be registered at one time and will be queued in Completion Queue Entry order.

Destruction of the Completion Queue will result in cancellation of any pending function calls.

Return values:
VIP_SUCCESS The routine was successfully completed.
VIP_INVALID_PARAMETER The VI handle, the CQ Handle or the function call address was invalid.
VIP_ERROR_RESOURCE The operation failed due to insufficient resources.
Parameters:
CQHandle (IN) Instance of a Completion Queue.
Context (IN) Data to be passed through to the Handler as a parameter. Not used by the VI Provider.
Handler (IN) Address of the user-defined function to be called when a single Descriptor completes. This function is not guaranteed to run in the context of the calling thread. The handler function is called with the following input parameters:
  • Context: Data passed through from the function call.
  • NicHandle: Handle of the NIC.
  • ViHandle: Instance of a Virtual Interface.
  • RecvQueue: VIP_TRUE indicates that the completion was associated with the receive queue of the VI. VIP_FALSE indicates that the completion was associated with the send queue of the VI.
See also:
VipCQDone VipCQWait
Author:
Patrick Geoffray
Version:
1.0

Definition at line 68 of file vipcqnotify.c.

References VIP_NOTIFY::context, VIP_NOTIFY::handler, VIP_NIC::lock, VIP_GM::lock, VIP_NOTIFY::next, VIP_GM::notify_lookaside, VIP_ASSERT, vip_cq_notify_thread(), VIP_DEBUG, VIP_DEBUG_LABEL, VIP_ERROR_RESOURCE, VIP_FALSE, VIP_NIC::vip_gm_ptr, VIP_INVALID_CQ_HANDLE, VIP_INVALID_PARAMETER, VIP_MUTEX_LOCK, VIP_MUTEX_UNLOCK, VIP_PROGRESSION, VIP_SEMAPHORE_POST, VIP_SUCCESS, VIP_THREAD_CREATE, and VIP_TRUE.

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