]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Add async_event callback function to struct ibv_context_ops
authorSteve Wise <swise@opengridcomputing.com>
Thu, 16 Nov 2006 20:06:14 +0000 (14:06 -0600)
committerRoland Dreier <rolandd@cisco.com>
Thu, 16 Nov 2006 21:50:20 +0000 (13:50 -0800)
Add a callback function so low-level driver libraries can get a
callback with each async event retrieved by the user.  It allows the
bypass library to do WQ or CQ processing that needs to happen when a
fatal async event happens.  This async callback is similar to the
cq_event callback that already exists in libibverbs.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
include/infiniband/verbs.h
src/device.c

index c5c9dcdc75cecface59b2d2f3cf4a4934f9e3a17..49cd581ae59e3f0033e7b2a48b11e3baa88d6fba 100644 (file)
@@ -640,6 +640,7 @@ struct ibv_context_ops {
                                                uint16_t lid);
        int                     (*detach_mcast)(struct ibv_qp *qp, union ibv_gid *gid,
                                                uint16_t lid);
+       void                    (*async_event)(struct ibv_async_event *event);
 };
 
 struct ibv_context {
index 381f9d6639ebdaa11a8dbbf578bd80c6b3772ec6..3bfbca69b264ac3ce50ea1d7f2194d64b0338bd7 100644 (file)
@@ -196,6 +196,9 @@ int ibv_get_async_event(struct ibv_context *context,
                break;
        }
 
+       if (context->ops.async_event)
+               context->ops.async_event(event);
+
        return 0;
 }