diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2008-04-17 00:09:33 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-04-17 00:09:33 -0400 |
commit | 2dd5716227878d5950988514a2cbabf72f7fc888 (patch) | |
tree | cd999c4f9bcf1bb1f54fc6b91fac7d16552a930e | |
parent | 82c24c18afc5e1c2a955bdc2762b19721283365c (diff) |
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>
-rw-r--r-- | drivers/infiniband/core/verbs.c | 7 | ||||
-rw-r--r-- | include/rdma/ib_verbs.h | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 8ffb5f2c21f7..05042089de6e 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c | |||
@@ -630,6 +630,13 @@ struct ib_cq *ib_create_cq(struct ib_device *device, | |||
630 | } | 630 | } |
631 | EXPORT_SYMBOL(ib_create_cq); | 631 | EXPORT_SYMBOL(ib_create_cq); |
632 | 632 | ||
633 | int ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period) | ||
634 | { | ||
635 | return cq->device->modify_cq ? | ||
636 | cq->device->modify_cq(cq, cq_count, cq_period) : -ENOSYS; | ||
637 | } | ||
638 | EXPORT_SYMBOL(ib_modify_cq); | ||
639 | |||
633 | int ib_destroy_cq(struct ib_cq *cq) | 640 | int ib_destroy_cq(struct ib_cq *cq) |
634 | { | 641 | { |
635 | if (atomic_read(&cq->usecnt)) | 642 | if (atomic_read(&cq->usecnt)) |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index c48f6af5ef9a..95bf4bac44cb 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -987,6 +987,8 @@ struct ib_device { | |||
987 | int comp_vector, | 987 | int comp_vector, |
988 | struct ib_ucontext *context, | 988 | struct ib_ucontext *context, |
989 | struct ib_udata *udata); | 989 | struct ib_udata *udata); |
990 | int (*modify_cq)(struct ib_cq *cq, u16 cq_count, | ||
991 | u16 cq_period); | ||
990 | int (*destroy_cq)(struct ib_cq *cq); | 992 | int (*destroy_cq)(struct ib_cq *cq); |
991 | int (*resize_cq)(struct ib_cq *cq, int cqe, | 993 | int (*resize_cq)(struct ib_cq *cq, int cqe, |
992 | struct ib_udata *udata); | 994 | struct ib_udata *udata); |
@@ -1392,6 +1394,15 @@ struct ib_cq *ib_create_cq(struct ib_device *device, | |||
1392 | int ib_resize_cq(struct ib_cq *cq, int cqe); | 1394 | int ib_resize_cq(struct ib_cq *cq, int cqe); |
1393 | 1395 | ||
1394 | /** | 1396 | /** |
1397 | * ib_modify_cq - Modifies moderation params of the CQ | ||
1398 | * @cq: The CQ to modify. | ||
1399 | * @cq_count: number of CQEs that will trigger an event | ||
1400 | * @cq_period: max period of time in usec before triggering an event | ||
1401 | * | ||
1402 | */ | ||
1403 | int ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period); | ||
1404 | |||
1405 | /** | ||
1395 | * ib_destroy_cq - Destroys the specified CQ. | 1406 | * ib_destroy_cq - Destroys the specified CQ. |
1396 | * @cq: The CQ to destroy. | 1407 | * @cq: The CQ to destroy. |
1397 | */ | 1408 | */ |