// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* * Copyright(c) 2016 - 2018 Intel Corporation. */ #include <linux/slab.h> #include <linux/vmalloc.h> #include <rdma/uverbs_ioctl.h> #include "cq.h" #include "vt.h" #include "trace.h" static struct workqueue_struct *comp_vector_wq; /** * rvt_cq_enter - add a new entry to the completion queue * @cq: completion queue * @entry: work completion entry to add * @solicited: true if @entry is solicited * * This may be called with qp->s_lock held. * * Return: return true on success, else return * false if cq is full. */ bool rvt_cq_enter(struct rvt_cq *cq, struct ib_wc *entry, bool solicited) { … } EXPORT_SYMBOL(…); static void send_complete(struct work_struct *work) { … } /** * rvt_create_cq - create a completion queue * @ibcq: Allocated CQ * @attr: creation attributes * @attrs: uverbs bundle * * Called by ib_create_cq() in the generic verbs code. * * Return: 0 on success */ int rvt_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, struct uverbs_attr_bundle *attrs) { … } /** * rvt_destroy_cq - destroy a completion queue * @ibcq: the completion queue to destroy. * @udata: user data or NULL for kernel object * * Called by ib_destroy_cq() in the generic verbs code. */ int rvt_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata) { … } /** * rvt_req_notify_cq - change the notification type for a completion queue * @ibcq: the completion queue * @notify_flags: the type of notification to request * * This may be called from interrupt context. Also called by * ib_req_notify_cq() in the generic verbs code. * * Return: 0 for success. */ int rvt_req_notify_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags notify_flags) { … } /* * rvt_resize_cq - change the size of the CQ * @ibcq: the completion queue * * Return: 0 for success. */ int rvt_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata) { … } /** * rvt_poll_cq - poll for work completion entries * @ibcq: the completion queue to poll * @num_entries: the maximum number of entries to return * @entry: pointer to array where work completions are placed * * This may be called from interrupt context. Also called by ib_poll_cq() * in the generic verbs code. * * Return: the number of completion entries polled. */ int rvt_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry) { … } /** * rvt_driver_cq_init - Init cq resources on behalf of driver * * Return: 0 on success */ int rvt_driver_cq_init(void) { … } /** * rvt_cq_exit - tear down cq reources */ void rvt_cq_exit(void) { … }