[ofa-general] [PATCH 8/11]: Add support for modifying CQ params

Eli Cohen eli at mellanox.co.il
Mon Sep 24 05:40:12 PDT 2007


Add support for modifying CQ parameters for controlling
event generation moderation. This allows to control the
rate of event (interrupt) generation by specifying a minimum
number of CQEs or a minimum period of time required to
generate an event.

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-24 12:33:41.000000000 +0200
+++ ofa_1_3_dev_kernel/include/rdma/ib_verbs.h	2007-09-24 13:07:59.000000000 +0200
@@ -967,6 +967,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);
@@ -1372,6 +1374,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-24 11:19:03.000000000 +0200
+++ ofa_1_3_dev_kernel/drivers/infiniband/core/verbs.c	2007-09-24 13:07:59.000000000 +0200
@@ -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