RDMA/mlx5: Check enabled UCAPs when creating ucontext
authorChiara Meiohas <cmeiohas@nvidia.com>
Thu, 6 Mar 2025 11:51:29 +0000 (13:51 +0200)
committerLeon Romanovsky <leon@kernel.org>
Sun, 9 Mar 2025 17:13:02 +0000 (13:13 -0400)
commit17ade5366345656e1a7f4e9da16863a7499da21b
treeb753f603d9fe457920d7d6652a26fe5fc945992c
parentfe9d7822baee65d8e77542391799b2777f5216f5
RDMA/mlx5: Check enabled UCAPs when creating ucontext

Verify that the enabled UCAPs are supported by the device before
creating the ucontext.
If supported, create the ucontext with the associated capabilities.

Store the privileged ucontext UID on creation and remove it when
destroying the privileged ucontext. This allows the command interface
to recognize privileged commands through its UID.

Signed-off-by: Chiara Meiohas <cmeiohas@nvidia.com>
Link: https://patch.msgid.link/8b180583a207cb30deb7a2967934079749cdcc44.1741261611.git.leon@kernel.org
Reviewed-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/devx.c
drivers/infiniband/hw/mlx5/devx.h
drivers/infiniband/hw/mlx5/main.c