[PATCH rdma-next 13/15] RDMA/uverbs: Add new Unordered MR access flag
From: Michael Gur <hidden>
Date: 2026-07-26 09:31:12
Also in:
linux-rdma, lkml
Subsystem:
infiniband subsystem, the rest · Maintainers:
Jason Gunthorpe, Leon Romanovsky, Linus Torvalds
Add a new Unordered access flag for MR registrations. This access flag allows additional relaxing of the order of memory accesses to the memory region. Using this access flag allows for concurrent reads and writes of this MR to be reordered. This access flag is part of the optional access flags range, drivers shouldn't fail registration for any value in this range and are expected to treat them as best-effort. Reviewed-by: Yishai Hadas <yishaih@nvidia.com> Signed-off-by: Michael Gur <redacted> --- drivers/infiniband/core/umem.c | 2 +- include/rdma/ib_verbs.h | 1 + include/uapi/rdma/ib_user_ioctl_verbs.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index 81f44dadfa52..c44a7509ebf2 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c@@ -204,7 +204,7 @@ static struct ib_umem *__ib_umem_get_va(struct ib_device *device, umem->writable = ib_access_writable(access); umem->owning_mm = mm = current->mm; umem->dma_attrs = DMA_ATTR_REQUIRE_COHERENT; - if (access & IB_ACCESS_RELAXED_ORDERING) + if (access & (IB_ACCESS_RELAXED_ORDERING | IB_ACCESS_UNORDERED)) umem->dma_attrs |= DMA_ATTR_WEAK_ORDERING; mmgrab(mm);
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 8d82d303b723..a28ec96057cd 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h@@ -1505,6 +1505,7 @@ enum ib_access_flags { IB_ACCESS_ON_DEMAND = IB_UVERBS_ACCESS_ON_DEMAND, IB_ACCESS_HUGETLB = IB_UVERBS_ACCESS_HUGETLB, IB_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_RELAXED_ORDERING, + IB_ACCESS_UNORDERED = IB_UVERBS_ACCESS_UNORDERED, IB_ACCESS_FLUSH_GLOBAL = IB_UVERBS_ACCESS_FLUSH_GLOBAL, IB_ACCESS_FLUSH_PERSISTENT = IB_UVERBS_ACCESS_FLUSH_PERSISTENT,
diff --git a/include/uapi/rdma/ib_user_ioctl_verbs.h b/include/uapi/rdma/ib_user_ioctl_verbs.h
index 51030c27d479..d2f9564e96db 100644
--- a/include/uapi/rdma/ib_user_ioctl_verbs.h
+++ b/include/uapi/rdma/ib_user_ioctl_verbs.h@@ -62,6 +62,7 @@ enum ib_uverbs_access_flags { IB_UVERBS_ACCESS_FLUSH_PERSISTENT = 1 << 9, IB_UVERBS_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_OPTIONAL_FIRST, + IB_UVERBS_ACCESS_UNORDERED = IB_UVERBS_ACCESS_OPTIONAL_FIRST << 1, IB_UVERBS_ACCESS_OPTIONAL_RANGE = ((IB_UVERBS_ACCESS_OPTIONAL_LAST << 1) - 1) & ~(IB_UVERBS_ACCESS_OPTIONAL_FIRST - 1)
--
2.52.0