image image image image image

On This Page

ibv_get_async_event

Template: int ibv_get_async_event(struct ibv_context *context, struct ibv_async_event *event)

Input Parameters:

context struct ibv_context from ibv_open_device

event A pointer to use to return the async event

Output Parameters: 

event A pointer to the async event being sought

Return Value: 0 on success, -1 on error. If the call fails, errno will be set to indicate the reason for the failure.
Description: ibv_get_async_event gets the next asynchronous event of the RDMA device context 'context' and returns it through the pointer 'event' which is an ibv_async_event struct. All async events returned by ibv_get_async_event must eventually be acknowledged with ibv_ack_asyn- c_eventibv_get_async_event() is a blocking function. If multiple threads call this function simultaneously, then when an async event occurs, only one thread will receive it, and it is not possible to predict which thread will receive it.

struct ibv_async_event is defined as follows:

struct ibv_async_event {
	union {
	struct ibv_cq *cq;	     			The CQ that got the event
	struct ibv_qp *qp;	     		The QP that got the event
	struct ibv_srq *srq;	     	The SRQ that got the event
	int	port_num;    			The port number that got the event 
	} element;
	enum ibv_event_type	event_type; Type of event
};

One member of the element union will be valid, depending on the event_type member of the structure. event_type will be one of the following events:

QP events:
IBV_EVENT_QP_FATALError occurred on a QP and it transitioned to error state
IBV_EVENT_QP_REQ_ERRInvalid Request Local Work Queue Error
IBV_EVENT_QP_ACCESS_ERRLocal access violation error
IBV_EVENT_COMM_ESTCommunication was established on a QP
IBV_EVENT_SQ_DRAINEDSend Queue was drained of outstanding messages in progress
IBV_EVENT_PATH_MIGA connection has migrated to the alternate path
IBV_EVENT_PATH_MIG_ERRA connection failed to migrate to the alternate path
IBV_EVENT_QP_LAST_WQE_REACHEDLast WQE Reached on a QP associated with an SRQ
CQ events:
IBV_EVENT_CQ_ERRCQ is in error (CQ overrun)
SRQ events:
IBV_EVENT_SRQ_ERRError occurred on an SRQ
IBV_EVENT_SRQ_LIMIT_REACHEDSRQ limit was reached
Port events:
IBV_EVENT_PORT_ACTIVELink became active on a port
IBV_EVENT_PORT_ERRLink became unavailable on a port
IBV_EVENT_LID_CHANGELID was changed on a port
IBV_EVENT_PKEY_CHANGEP_Key table was changed on a port
IBV_EVENT_SM_CHANGESM was changed on a port
IBV_EVENT_CLIENT_REREGISTERSM sent a CLIENT_REREGISTER request to a port
IBV_EVENT_GID_CHANGEGID table was changed on a port
CA events:
IBV_EVENT_DEVICE_FATALCA is in FATAL state

ib_ack_async_event

Template: void ibv_ack_async_event(struct ibv_async_event *event)

Input Parameters:

event A pointer to the event to be acknowledged

Output Parameters: None

Return Value: None

Description: All async events that ibv_get_async_event() returns must be acknowledged using ibv_ack_asyn- c_event(). To avoid races, destroying an object (CQ, SRQ or QP) will wait for all affiliated events for the object to be acknowledged; this avoids an application retrieving an affiliated event after the corresponding object has already been destroyed.

ibv_event_type_str

Template: const char {}ibv_event_type_str{*}(enum ibv_event_type event_type)

Input Parameters:

event_type ibv_event_type enum value

Output Parameters: None

Return Value: A constant string which describes the enum value event_type

Description: ibv_event_type_str returns a string describing the event type enum value, event_type. event_- type may be any one of the 19 different enum values describing different IB events.

ibv_event_type {
	IBV_EVENT_CQ_ERR,
	IBV_EVENT_QP_FATAL,
	IBV_EVENT_QP_REQ_ERR,
	IBV_EVENT_QP_ACCESS_ERR,
	IBV_EVENT_COMM_EST,
	IBV_EVENT_SQ_DRAINED,
	IBV_EVENT_PATH_MIG,
	IBV_EVENT_PATH_MIG_ERR,
	IBV_EVENT_DEVICE_FATAL,
	IBV_EVENT_PORT_ACTIVE,
	IBV_EVENT_PORT_ERR,
	IBV_EVENT_LID_CHANGE,
	IBV_EVENT_PKEY_CHANGE,
	IBV_EVENT_SM_CHANGE,
	IBV_EVENT_SRQ_ERR,
	IBV_EVENT_SRQ_LIMIT_REACHED,
	IBV_EVENT_QP_LAST_WQE_REACHED,
	IBV_EVENT_CLIENT_REREGISTER,
	IBV_EVENT_GID_CHANGE,
};