The rvt_cq_wc struct elements are shared between rdmavt and the providers but not in uapi directory. As per the comment in https://marc.info/?l=linux-rdma&m=152296522708522&w=2 The hfi1 driver and the rdma core driver are not using shared structures in the uapi directory. In that case, move rvt_cq_wc struct into the rvt-abi.h header file and create a rvt_k_cq_w for the kernel completion queue.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -0,0 +1,32 @@ | ||
| 1 | +/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ | |
| 2 | + | |
| 3 | +/* | |
| 4 | + * This file contains defines, structures, etc. that are used | |
| 5 | + * to communicate between kernel and user code. | |
| 6 | + */ | |
| 7 | + | |
| 8 | +#ifndef RVT_ABI_USER_H | |
| 9 | +#define RVT_ABI_USER_H | |
| 10 | + | |
| 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 | |
| 15 | +#endif | |
| 16 | + | |
| 17 | +/* | |
| 18 | + * This structure is used to contain the head pointer, tail pointer, | |
| 19 | + * and completion queue entries as a single memory allocation so | |
| 20 | + * it can be mmap'ed into user space. | |
| 21 | + */ | |
| 22 | +struct rvt_cq_wc { | |
| 23 | + /* index of next entry to fill */ | |
| 24 | + RDMA_ATOMIC_UAPI(__u32, head); | |
| 25 | + /* index of next ib_poll_cq() entry */ | |
| 26 | + RDMA_ATOMIC_UAPI(__u32, tail); | |
| 27 | + | |
| 28 | + /* these are actually size ibcq.cqe + 1 */ | |
| 29 | + struct ib_uverbs_wc uqueue[]; | |
| 30 | +}; | |
| 31 | + | |
| 32 | +#endif /* RVT_ABI_USER_H */ | |