瀏覽代碼

IB/core: Add support for modify CQ

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>
Eli Cohen 17 年之前
父節點
當前提交
2dd5716227
共有 2 個文件被更改,包括 18 次插入0 次删除
  1. 7 0
      drivers/infiniband/core/verbs.c
  2. 11 0
      include/rdma/ib_verbs.h

+ 7 - 0
drivers/infiniband/core/verbs.c

@@ -630,6 +630,13 @@ struct ib_cq *ib_create_cq(struct ib_device *device,
 }
 }
 EXPORT_SYMBOL(ib_create_cq);
 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)
 int ib_destroy_cq(struct ib_cq *cq)
 {
 {
 	if (atomic_read(&cq->usecnt))
 	if (atomic_read(&cq->usecnt))

+ 11 - 0
include/rdma/ib_verbs.h

@@ -987,6 +987,8 @@ struct ib_device {
 						int comp_vector,
 						int comp_vector,
 						struct ib_ucontext *context,
 						struct ib_ucontext *context,
 						struct ib_udata *udata);
 						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                        (*destroy_cq)(struct ib_cq *cq);
 	int                        (*resize_cq)(struct ib_cq *cq, int cqe,
 	int                        (*resize_cq)(struct ib_cq *cq, int cqe,
 						struct ib_udata *udata);
 						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);
 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.
  * ib_destroy_cq - Destroys the specified CQ.
  * @cq: The CQ to destroy.
  * @cq: The CQ to destroy.