diff options
author | Bob Pearson <rpearsonhpe@gmail.com> | 2020-12-10 11:42:59 -0600 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2020-12-11 19:57:48 -0400 |
commit | d21a1240f5169a07a230d72e0e6d3773b2a088b4 (patch) | |
tree | 502df1bb60738b4a0198435ac0f6c4fb490c203c /include/uapi/rdma | |
parent | d8cc403b70de61160aaafddd776ee53aa5aa77eb (diff) | |
download | linux-d21a1240f5169a07a230d72e0e6d3773b2a088b4.tar.gz linux-d21a1240f5169a07a230d72e0e6d3773b2a088b4.tar.bz2 linux-d21a1240f5169a07a230d72e0e6d3773b2a088b4.zip |
RDMA/rxe: Use acquire/release for memory ordering
Change work and completion queues to use smp_load_acquire() and
smp_store_release() to synchronize between driver and users. This commit
goes with a matching series of commits in the rxe user space provider.
Link: https://lore.kernel.org/r/20201210174258.5234-1-rpearson@hpe.com
Signed-off-by: Bob Pearson <rpearson@hpe.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'include/uapi/rdma')
-rw-r--r-- | include/uapi/rdma/rdma_user_rxe.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/uapi/rdma/rdma_user_rxe.h b/include/uapi/rdma/rdma_user_rxe.h index e591d8c1f3cf..068433e2229d 100644 --- a/include/uapi/rdma/rdma_user_rxe.h +++ b/include/uapi/rdma/rdma_user_rxe.h @@ -181,4 +181,25 @@ struct rxe_modify_srq_cmd { __aligned_u64 mmap_info_addr; }; +/* This data structure is stored at the base of work and + * completion queues shared between user space and kernel space. + * It contains the producer and consumer indices. Is also + * contains a copy of the queue size parameters for user space + * to use but the kernel must use the parameters in the + * rxe_queue struct. For performance reasons arrange to have + * producer and consumer indices in separate cache lines + * the kernel should always mask the indices to avoid accessing + * memory outside of the data area + */ +struct rxe_queue_buf { + __u32 log2_elem_size; + __u32 index_mask; + __u32 pad_1[30]; + __u32 producer_index; + __u32 pad_2[31]; + __u32 consumer_index; + __u32 pad_3[31]; + __u8 data[]; +}; + #endif /* RDMA_USER_RXE_H */ |