Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eli Cohen and committed by
Roland Dreier
2dd57162 82c24c18

+18
+7
drivers/infiniband/core/verbs.c
··· 630 630 } 631 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 640 int ib_destroy_cq(struct ib_cq *cq) 634 641 { 635 642 if (atomic_read(&cq->usecnt))
+11
include/rdma/ib_verbs.h
··· 987 987 int comp_vector, 988 988 struct ib_ucontext *context, 989 989 struct ib_udata *udata); 990 + int (*modify_cq)(struct ib_cq *cq, u16 cq_count, 991 + u16 cq_period); 990 992 int (*destroy_cq)(struct ib_cq *cq); 991 993 int (*resize_cq)(struct ib_cq *cq, int cqe, 992 994 struct ib_udata *udata); ··· 1392 1390 * Users can examine the cq structure to determine the actual CQ size. 1393 1391 */ 1394 1392 int ib_resize_cq(struct ib_cq *cq, int cqe); 1393 + 1394 + /** 1395 + * ib_modify_cq - Modifies moderation params of the CQ 1396 + * @cq: The CQ to modify. 1397 + * @cq_count: number of CQEs that will trigger an event 1398 + * @cq_period: max period of time in usec before triggering an event 1399 + * 1400 + */ 1401 + int ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period); 1395 1402 1396 1403 /** 1397 1404 * ib_destroy_cq - Destroys the specified CQ.