Batch of mlx5_ib fixes
Subsystems (2)
cover Batch of mlx5_ib fixes
From: Leon Romanovsky <[email protected]>
Hi,
This patchset is combination of various mlx5_ib fixes.
Thanks
Hamdan Igbaria (1):
RDMA/mlx5: Fix mutex unlocking on error flow for steering anchor
creation
Michael Guralnik (1):
RDMA/mlx5: Fix assigning access flags to cache mkeys
Shay Drory (1):
RDMA/mlx5: Fix NULL string error
drivers/infiniband/hw/mlx5/fs.c | 2 +- drivers/infiniband/hw/mlx5/main.c | 2 +- drivers/infiniband/hw/mlx5/mr.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.41.0
PATCH 1/3 RDMA/mlx5: Fix assigning access flags to cache mkeys
From: Michael Guralnik <[email protected]>
After the change to use dynamic cache structure, new cache entries can be added and the mkey allocation can no longer assume that all mkeys created for the cache have access_flags equal to zero.
Example of a flow that exposes the issue:
A user registers MR with RO on a HCA that cannot UMR RO and the mkey is created outside of the cache. When the user deregisters the MR, a new cache entry is created to store mkeys with RO.
Later, the user registers 2 MRs with RO. The first MR is reused from the new cache entry. When we try to get the second mkey from the cache we see the entry is empty so we go to the MR cache mkey allocation flow which would have allocated a mkey with no access flags, resulting the user getting a MR without RO.
--- drivers/infiniband/hw/mlx5/mr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/mr.c +2 -1
@@ -239,7 +239,8 @@ static int get_mkc_octo_size(unsigned int access_mode, unsigned int ndescs)static void set_cache_mkc (struct mlx5_cache_ent *ent,void *mkc) { -set_mkc_access_pd_addr_fields (mkc,0 ,0 , ent->dev->umrc.pd); +set_mkc_access_pd_addr_fields (mkc, ent->rb_key.access_flags,0 , + ent->dev->umrc.pd);MLX5_SET (mkc, mkc, free,1 );MLX5_SET (mkc, mkc, umr_en,1 );MLX5_SET (mkc, mkc, access_mode_1_0, ent->rb_key.access_mode &0x3 );
Signature · 1 line
2.41.0
PATCH 2/3 RDMA/mlx5: Fix mutex unlocking on error flow for steering anchor creation
In reply to Leon RomanovskyFrom: Hamdan Igbaria <[email protected]>
The mutex was not unlocked on some of the error flows. Moved the unlock location to include all the error flow scenarios.
--- drivers/infiniband/hw/mlx5/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/fs.c +1 -1
@@ -2470,8 +2470,8 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_STEERING_ANCHOR_CREATE)(mlx5_steering_anchor_destroy_res (ft_prio); put_flow_table:put_flow_table (dev, ft_prio, true); -mutex_unlock (&dev->flow_db->lock); free_obj: +mutex_unlock (&dev->flow_db->lock);kfree (obj);return err;
Signature · 1 line
2.41.0
PATCH 3/3 RDMA/mlx5: Fix NULL string error
In reply to Leon RomanovskyFrom: Shay Drory <[email protected]>
checkpath is complaining about NULL string, change it to 'Unknown'.
--- drivers/infiniband/hw/mlx5/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/main.c +1 -1
@@ -2084,7 +2084,7 @@ static inline char *mmap_cmd2str(enum mlx5_ib_mmap_cmd cmd)case MLX5_IB_MMAP_DEVICE_MEM :return "Device Memory" ;default : -return NULL ; +return "Unknown" ; } }
Signature · 1 line
2.41.0
Leon Romanovsky
AppliedQuoted 9 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
Hi,
This patchset is combination of various
mlx5_ibfixes.Thanks
[...]
Applied, thanks!
[1/3] RDMA/mlx5: Fix assigning access flags to cache mkeys
https://git.kernel.org/rdma/rdma/c/4f14c6c0213e1d [2/3] RDMA/mlx5: Fix mutex unlocking on error flow for steering anchor creation https://git.kernel.org/rdma/rdma/c/2fad8f06a582cd [3/3] RDMA/mlx5: Fix NULL string error https://git.kernel.org/rdma/rdma/c/dab994bcc609a1
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>