0001
0002
0003
0004
0005
0006 #ifndef DEF_RDMAVT_INCCQ_H
0007 #define DEF_RDMAVT_INCCQ_H
0008
0009 #include <linux/kthread.h>
0010 #include <rdma/ib_user_verbs.h>
0011 #include <rdma/ib_verbs.h>
0012
0013
0014
0015
0016
0017 #define RVT_CQ_NONE (IB_CQ_NEXT_COMP + 1)
0018
0019
0020
0021
0022
0023 #define RDMA_READ_UAPI_ATOMIC(member) smp_load_acquire(&(member).val)
0024
0025
0026
0027
0028
0029 #define RDMA_WRITE_UAPI_ATOMIC(member, x) smp_store_release(&(member).val, x)
0030 #include <rdma/rvt-abi.h>
0031
0032
0033
0034
0035
0036
0037 struct rvt_k_cq_wc {
0038 u32 head;
0039 u32 tail;
0040 struct ib_wc kqueue[];
0041 };
0042
0043
0044
0045
0046 struct rvt_cq {
0047 struct ib_cq ibcq;
0048 struct work_struct comptask;
0049 spinlock_t lock;
0050 u8 notify;
0051 u8 triggered;
0052 u8 cq_full;
0053 int comp_vector_cpu;
0054 struct rvt_dev_info *rdi;
0055 struct rvt_cq_wc *queue;
0056 struct rvt_mmap_info *ip;
0057 struct rvt_k_cq_wc *kqueue;
0058 };
0059
0060 static inline struct rvt_cq *ibcq_to_rvtcq(struct ib_cq *ibcq)
0061 {
0062 return container_of(ibcq, struct rvt_cq, ibcq);
0063 }
0064
0065 bool rvt_cq_enter(struct rvt_cq *cq, struct ib_wc *entry, bool solicited);
0066
0067 #endif