]> err.no Git - linux-2.6/commitdiff
IB/core: Add support for modify CQ
authorEli Cohen <eli@dev.mellanox.co.il>
Thu, 17 Apr 2008 04:09:33 +0000 (21:09 -0700)
committerRoland Dreier <rolandd@cisco.com>
Thu, 17 Apr 2008 04:09:33 +0000 (21:09 -0700)
Add support for modifying CQ parameters for controlling event
generation moderation.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/verbs.c
include/rdma/ib_verbs.h

index 8ffb5f2c21f73da857895d0dc0d4c279ceeacb29..05042089de6ea32e3a2c6d585324f9ed9557f4b1 100644 (file)
@@ -630,6 +630,13 @@ struct ib_cq *ib_create_cq(struct ib_device *device,
 }
 EXPORT_SYMBOL(ib_create_cq);
 
+int ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period)
+{
+       return cq->device->modify_cq ?
+               cq->device->modify_cq(cq, cq_count, cq_period) : -ENOSYS;
+}
+EXPORT_SYMBOL(ib_modify_cq);
+
 int ib_destroy_cq(struct ib_cq *cq)
 {
        if (atomic_read(&cq->usecnt))
index c48f6af5ef9a0987db49e774cf6cc95ad28f2909..95bf4bac44cb3babc459fb0f0e7313d15a91069e 100644 (file)
@@ -987,6 +987,8 @@ struct ib_device {
                                                int comp_vector,
                                                struct ib_ucontext *context,
                                                struct ib_udata *udata);
+       int                        (*modify_cq)(struct ib_cq *cq, u16 cq_count,
+                                               u16 cq_period);
        int                        (*destroy_cq)(struct ib_cq *cq);
        int                        (*resize_cq)(struct ib_cq *cq, int cqe,
                                                struct ib_udata *udata);
@@ -1391,6 +1393,15 @@ struct ib_cq *ib_create_cq(struct ib_device *device,
  */
 int ib_resize_cq(struct ib_cq *cq, int cqe);
 
+/**
+ * ib_modify_cq - Modifies moderation params of the CQ
+ * @cq: The CQ to modify.
+ * @cq_count: number of CQEs that will trigger an event
+ * @cq_period: max period of time in usec before triggering an event
+ *
+ */
+int ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period);
+
 /**
  * ib_destroy_cq - Destroys the specified CQ.
  * @cq: The CQ to destroy.