]> git.ipfire.org Git - thirdparty/linux.git/commit
IB/core: Introduce FRMR pools
authorMichael Guralnik <michaelgur@nvidia.com>
Thu, 26 Feb 2026 13:52:07 +0000 (15:52 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 2 Mar 2026 18:44:58 +0000 (13:44 -0500)
commitce5df0b891edfa19620cd7e28bd69246c77ae78c
treec67bdf6d6db214cbc574764f8823e214a2e1c410
parentbc0ad1a17c2ce49b1a89a5b04ee0eed345fac558
IB/core: Introduce FRMR pools

Add a generic Fast Registration Memory Region pools mechanism to allow
drivers to optimize memory registration performance.
Drivers that have the ability to reuse MRs or their underlying HW
objects can take advantage of the mechanism to keep a 'handle' for those
objects and use them upon user request.
We assume that to achieve this goal a driver and its HW should implement
a modify operation for the MRs that is able to at least clear and set the
MRs and in more advanced implementations also support changing a subset
of the MRs properties.

The mechanism is built using an RB-tree consisting of pools, each pool
represents a set of MR properties that are shared by all of the MRs
residing in the pool and are unmodifiable by the vendor driver or HW.

The exposed API from ib_core to the driver has 4 operations:
Init and cleanup - handles data structs and locks for the pools.
Push and pop - store and retrieve 'handle' for a memory registration
or deregistrations request.

The FRMR pools mechanism implements the logic to search the RB-tree for
a pool with matching properties and create a new one when needed and
requires the driver to implement creation and destruction of a 'handle'
when pool is empty or a handle is requested or is being destroyed.

Later patch will introduce Netlink API to interact with the FRMR pools
mechanism to allow users to both configure and track its usage.
A vendor wishing to configure FRMR pool without exposing it or without
exposing internal MR properties to users, should use the
kernel_vendor_key field in the pools key. This can be useful in a few
cases, e.g, when the FRMR handle has a vendor-specific un-modifiable
property that the user registering the memory might not be aware of.

Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Reviewed-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20260226-frmr_pools-v4-2-95360b54f15e@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/Makefile
drivers/infiniband/core/frmr_pools.c [new file with mode: 0644]
drivers/infiniband/core/frmr_pools.h [new file with mode: 0644]
include/rdma/frmr_pools.h [new file with mode: 0644]
include/rdma/ib_verbs.h