[v3,0/5] mlx5: workaround MR issues

Message ID 20211109122324.2300306-1-matan@nvidia.com (mailing list archive)


Matan Azrad Nov. 9, 2021, 12:23 p.m. UTC
  The mlx5 PMD uses the kernel mlx5 driver to map physical memory to the HW.
Using the Verbs API ibv_reg_mr, a mkey can be created for that.
In this case, the mkey is signed on the user ID of the kernel driver.

Using the DevX API, a mkey also can be created, but it should point an umem object (represents the specific buffer mapping) created by the kernel.
In this case, the mkey is signed on the user ID of the process DevX context.

In FW DevX control commands which get mkey as a parameter, there is a security check on the user ID and Verbs mkeys are rejected.

Unfortunately, also when using DevX mkey, there is an error in the FW
command on umem validation because the umem is not designed to be used
for any mkey parameter. 
As a workaround to the kernel driver/FW issue, it is needed to use a wrapped MR, which is an indirect mkey(created by the DevX API) pointing to direct mkey created by the kernel for any DevX command uses an MR.

Add an API to create and destroy this wrapped MR.
Use this logic for counters and LM management.

Fix 32-bit compilation issue.
Fix Windows compilation issue.
Improve logs.

Matan Azrad (2):
  common/mlx5: add wrapped MR create API
  vdpa/mlx5: workaround dirty bitmap MR creation

Michael Baum (3):
  common/mlx5: glue MR registration with IOVA
  vdpa/mlx5: workaround guest MR registrations
  net/mlx5: workaround MR creation for flow counter

 drivers/common/mlx5/linux/meson.build        |  2 +
 drivers/common/mlx5/linux/mlx5_common_os.c   | 56 ++++++++++++++++++++
 drivers/common/mlx5/linux/mlx5_glue.c        | 18 +++++++
 drivers/common/mlx5/linux/mlx5_glue.h        |  3 ++
 drivers/common/mlx5/mlx5_common.h            | 18 +++++++
 drivers/common/mlx5/version.map              |  3 ++
 drivers/common/mlx5/windows/mlx5_common_os.c | 40 ++++++++++++++
 drivers/net/mlx5/mlx5.c                      |  8 +--
 drivers/net/mlx5/mlx5.h                      |  5 +-
 drivers/net/mlx5/mlx5_flow.c                 | 25 +++------
 drivers/vdpa/mlx5/mlx5_vdpa.h                |  9 ++--
 drivers/vdpa/mlx5/mlx5_vdpa_lm.c             | 38 +++----------
 drivers/vdpa/mlx5/mlx5_vdpa_mem.c            | 43 +++++----------
 13 files changed, 175 insertions(+), 93 deletions(-)