IB/mlx5: Add UARs write-combining and non-cached mapping
commit37aa5c36aa70c9fc5f633b89cce990f04aaa3cd4
authorGuy Levi <guyle@mellanox.com>
Wed, 27 Apr 2016 13:49:50 +0000 (27 16:49 +0300)
committerDoug Ledford <dledford@redhat.com>
Fri, 13 May 2016 23:40:03 +0000 (13 19:40 -0400)
tree92fd915425ba4a3979a8a4cd86804ed0e6ba443a
parent6cbac1e4cd0e0110b4be38c201fc055249dfd365
IB/mlx5: Add UARs write-combining and non-cached mapping

By this patch, the user space library will be able to improve
performance using appropriate ringing DoorBell method according to the
memory type it asked for.

Currently only one mapping command is allowed for UARs:
MLX5_IB_MMAP_REGULAR_PAGE. Using this mapping, the kernel maps the
UARs to write-combining (WC) if the system supports it.
If the system is not supporting WC the UARs are mapped to
non-cached(NC). In this case the user space library can't tell which
mapping is applied.
This patch adds 2 new mapping commands: MLX5_IB_MMAP_WC_PAGE and
MLX5_IB_MMAP_NC_PAGE. For these commands the kernel maps exactly as
requested and fails if it can't.

Since there is no generic way to check if the requested memory region
can be mapped as WC, driver enables conclusive WC mapping only for
x86, PowerPC and ARM which support WC for the device's memory region.

Signed-off-by: Guy Levy <guyle@mellanox.com>
Signed-off-by: Moshe Lazer <moshel@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/mlx5/mlx5_ib.h