]> git.droids-corp.org - dpdk.git/commit
common/mlx5: create wrapped MR
authorMatan Azrad <matan@nvidia.com>
Tue, 9 Nov 2021 12:36:09 +0000 (14:36 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 10 Nov 2021 14:48:56 +0000 (15:48 +0100)
commit76b5bdf828cfcc3c145960c93dbab322ffe6dd79
treefb56b3b77bcdaae492fddc4e79dae012640c5839
parent6ebd062e0602f0571cf9abbe9eabd0e5f6ad0a39
common/mlx5: create wrapped MR

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 parameters.

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.

Fixes: 5382d28c2110 ("net/mlx5: accelerate DV flow counter transactions")
Fixes: 9d39e57f21ac ("vdpa/mlx5: support live migration")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Signed-off-by: Matan Azrad <matan@nvidia.com>
drivers/common/mlx5/linux/mlx5_common_os.c
drivers/common/mlx5/mlx5_common.h
drivers/common/mlx5/version.map
drivers/common/mlx5/windows/mlx5_common_os.c