[ofa-general] [PATCH 14 of 17] ib_core: modify CQ moderation params

Eli Cohen eli at mellanox.co.il
Tue Sep 11 08:54:59 PDT 2007


Add support for modifying CQ parameters for controlling
event generation moderation.

Signed-off-by: Eli Cohen <eli at mellnaox.co.il>

---

Index: ofa_1_3_dev_kernel/include/rdma/ib_verbs.h
===================================================================
--- ofa_1_3_dev_kernel.orig/include/rdma/ib_verbs.h	2007-09-11 21:15:27.000000000 +0300
+++ ofa_1_3_dev_kernel/include/rdma/ib_verbs.h	2007-09-11 21:15:29.000000000 +0300
@@ -975,6 +975,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);
@@ -1380,6 +1382,16 @@ struct ib_cq *ib_create_cq(struct ib_dev
 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 tirgger an event
+ * @cq_period: max period of time beofre triggering an event
+ *
+ * Users can examine the cq structure to determine the actual CQ size.
+ */
+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.
  */
Index: ofa_1_3_dev_kernel/drivers/infiniband/core/verbs.c
===================================================================
--- ofa_1_3_dev_kernel.orig/drivers/infiniband/core/verbs.c	2007-09-11 21:14:34.000000000 +0300
+++ ofa_1_3_dev_kernel/drivers/infiniband/core/verbs.c	2007-09-11 21:15:29.000000000 +0300
@@ -628,6 +628,13 @@ struct ib_cq *ib_create_cq(struct ib_dev
 }
 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))




More information about the general mailing list