Whamcloud - gitweb
LU-10129 lnd: rework map_on_demand behavior
map_on_demand use is ambiguous. In kernels which supported global
memory regions, map-on-demand was used to limit the number of RDMA
fragments transferred between peers. That tuanble didn't impact the
memory allocation since the maximum allowed was always allocated. It
was used however as a variable in determining max_send_wr. With the
introduction of FMR if the number of fragments exceed the negotiated
number of fragments, which is determined by the map-on-demand value,
then FMR is used because we can transfer all the fragments in one FMR
fragment.
The latest kernels have removed support for global memory regions so
the use of map-on-demand has become ineffectual. However, we need to
keep it for backwards compatibility. The behavior has changed as
follows:
map_on_demand is a flag used to determine if we can use FMR or
FastReg. This is applicable for kernels which support global memory
regions. For later kernels this flag is always enabled, since we will
always either use FMR or FastReg For kernels which support global
memory regions map_on_demand defaults to 0 which means we will be
using global memory regions exclusively. If it is set to a value
other than 0, then we will behave as follows:
1. Always default the number of fragments to IBLND_MAX_RDMA_FRAGS
2. Create FMR/FastReg pools
3. Negotiate the supported number of fragments per connection
4. Attempt to transmit using global memory regions only if
map-on-demand is off, otherwise use FMR or FastReg.
5. In case of transmitting tx with GAPS over FMR we will need to
transmit it with multiple fragments. Look at the comments in
kiblnd_fmr_map_tx() for an explanation of the behavior.
For later kernels we default map_on_demand to 1 and not allow it to be
set to 0, since there is no longer support for global memory regions.
Behavior:
1. Default the number of fragments to IBLND_MAX_RDMA_FRAGS
2. Create FMR/FastReg pools
3. Negotiate the supported number of fragments per connection
4. Look at the comments in kiblnd_fmr_map_tx() for an explanation of
the behavior when transmit with GAPS verses contiguous.
Test-Parameters: trivial
Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Change-Id: I20b0ea57ec394a050603b5a638f515dfc4ac9446
Reviewed-on: https://review.whamcloud.com/29995
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <dougso@me.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>