Skip to content

Commit

Permalink
prov/verbs: Add support for IBV_ACCESS_RELAXED_ORDERING
Browse files Browse the repository at this point in the history
IBV_ACCESS_RELAXED_ORDERING: Allow the system to reorder
Send/Write/Atomic operations to improve performance.

The patch enables IBV_ACCESS_RELAXED_ORDERING if the application
has requested no ordering in TX/RX attributes.

Signed-off-by: Sylvain Didelot <[email protected]>
  • Loading branch information
sydidelot committed Sep 28, 2023
1 parent 7f8a90a commit 7e4e296
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions prov/verbs/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ AC_DEFUN([FI_VERBS_CONFIGURE],[
AC_DEFINE_UNQUOTED([VERBS_HAVE_DMABUF_MR],[$VERBS_HAVE_DMABUF_MR],
[Whether infiniband/verbs.h has ibv_reg_dmabuf_mr() support or not])
#See if we have rdma-core IBV_ACCESS_RELAXED_ORDERING mr support
VERBS_HAVE_RELAXED_ORDERING_MR=0
AS_IF([test $verbs_ibverbs_happy -eq 1],[
AC_CHECK_DECL([IBV_ACCESS_RELAXED_ORDERING],
[VERBS_HAVE_RELAXED_ORDERING_MR=1],[],
[#include <infiniband/verbs.h>])
])
AC_DEFINE_UNQUOTED([VERBS_HAVE_RELAXED_ORDERING_MR],[$VERBS_HAVE_RELAXED_ORDERING_MR],
[Whether infiniband/verbs.h has IBV_ACCESS_RELAXED_ORDERING support or not])
CPPFLAGS=$fi_verbs_configure_save_CPPFLAGS
# Technically, verbs_ibverbs_CPPFLAGS and
Expand Down
5 changes: 5 additions & 0 deletions prov/verbs/src/verbs_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ vrb_mr_ofi2ibv_access(uint64_t ofi_access, struct vrb_domain *domain)
IBV_ACCESS_REMOTE_WRITE |
IBV_ACCESS_REMOTE_ATOMIC;

/* No strict ordering requested */
if (domain->util_domain.tx_msg_order == FI_ORDER_NONE &&
domain->util_domain.rx_msg_order == FI_ORDER_NONE)
ibv_access |= VRB_ACCESS_RELAXED_ORDERING;

return ibv_access;
}

Expand Down
6 changes: 6 additions & 0 deletions prov/verbs/src/verbs_ofi.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,12 @@ int vrb_cq_open(struct fid_domain *domain, struct fi_cq_attr *attr,
struct fid_cq **cq, void *context);
int vrb_cq_trywait(struct vrb_cq *cq);

#if VERBS_HAVE_RELAXED_ORDERING_MR
#define VRB_ACCESS_RELAXED_ORDERING IBV_ACCESS_RELAXED_ORDERING
#else
#define VRB_ACCESS_RELAXED_ORDERING 0
#endif

struct vrb_mem_desc {
struct fid_mr mr_fid;
struct ibv_mr *mr;
Expand Down

0 comments on commit 7e4e296

Please sign in to comment.