1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
4 * This file contains defines, structures, etc. that are used
5 * to communicate between kernel and user code.
11 #include <linux/types.h>
12 #include <rdma/ib_user_verbs.h>
13 #ifndef RDMA_ATOMIC_UAPI
14 #define RDMA_ATOMIC_UAPI(_type, _name) struct{ _type val; } _name
24 * This structure is used to contain the head pointer, tail pointer,
25 * and completion queue entries as a single memory allocation so
26 * it can be mmap'ed into user space.
29 /* index of next entry to fill */
30 RDMA_ATOMIC_UAPI(__u32, head);
31 /* index of next ib_poll_cq() entry */
32 RDMA_ATOMIC_UAPI(__u32, tail);
34 /* these are actually size ibcq.cqe + 1 */
35 struct ib_uverbs_wc uqueue[];
39 * Receive work request queue entry.
40 * The size of the sg_list is determined when the QP (or SRQ) is created
41 * and stored in qp->r_rq.max_sge (or srq->rq.max_sge).
47 struct rvt_wqe_sge sg_list[];
51 * This structure is used to contain the head pointer, tail pointer,
52 * and receive work queue entries as a single memory allocation so
53 * it can be mmap'ed into user space.
54 * Note that the wq array elements are variable size so you can't
55 * just index into the array to get the N'th element;
56 * use get_rwqe_ptr() for user space and rvt_get_rwqe_ptr()
60 /* new work requests posted to the head */
61 RDMA_ATOMIC_UAPI(__u32, head);
62 /* receives pull requests from here. */
63 RDMA_ATOMIC_UAPI(__u32, tail);
66 #endif /* RVT_ABI_USER_H */