/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */12/*3* This file contains defines, structures, etc. that are used4* to communicate between kernel and user code.5*/67#ifndef RVT_ABI_USER_H8#define RVT_ABI_USER_H910#include <linux/types.h>11#include <rdma/ib_user_verbs.h>12#ifndef RDMA_ATOMIC_UAPI13#define RDMA_ATOMIC_UAPI(_type, _name) struct{ _type val; } _name14#endif1516struct rvt_wqe_sge {17__aligned_u64 addr;18__u32 length;19__u32 lkey;20};2122/*23* This structure is used to contain the head pointer, tail pointer,24* and completion queue entries as a single memory allocation so25* it can be mmap'ed into user space.26*/27struct rvt_cq_wc {28/* index of next entry to fill */29RDMA_ATOMIC_UAPI(__u32, head);30/* index of next ib_poll_cq() entry */31RDMA_ATOMIC_UAPI(__u32, tail);3233/* these are actually size ibcq.cqe + 1 */34struct ib_uverbs_wc uqueue[];35};3637/*38* Receive work request queue entry.39* The size of the sg_list is determined when the QP (or SRQ) is created40* and stored in qp->r_rq.max_sge (or srq->rq.max_sge).41*/42struct rvt_rwqe {43__u64 wr_id;44__u8 num_sge;45__u8 padding[7];46struct rvt_wqe_sge sg_list[];47};4849/*50* This structure is used to contain the head pointer, tail pointer,51* and receive work queue entries as a single memory allocation so52* it can be mmap'ed into user space.53* Note that the wq array elements are variable size so you can't54* just index into the array to get the N'th element;55* use get_rwqe_ptr() for user space and rvt_get_rwqe_ptr()56* for kernel space.57*/58struct rvt_rwq {59/* new work requests posted to the head */60RDMA_ATOMIC_UAPI(__u32, head);61/* receives pull requests from here. */62RDMA_ATOMIC_UAPI(__u32, tail);63struct rvt_rwqe wq[];64};65#endif /* RVT_ABI_USER_H */666768