Skip to content

Commit a2a88b8

Browse files
aharonl-nvidiajgunthorpe
authored andcommitted
RDMA/mlx5: Don't keep umrable 'page_shift' in cache entries
mkc.log_page_size can be changed using UMR. Therefore, don't treat it as a cache entry property. Removing it from struct mlx5_cache_ent. All cache mkeys will be created with default PAGE_SHIFT, and updated with the needed page_shift using UMR when passing them to a user. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Aharon Landau <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 592627c commit a2a88b8

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

drivers/infiniband/hw/mlx5/mlx5_ib.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,6 @@ struct mlx5_cache_ent {
739739
char name[4];
740740
u32 order;
741741
u32 access_mode;
742-
u32 page;
743742
unsigned int ndescs;
744743

745744
u8 disabled:1;

drivers/infiniband/hw/mlx5/mr.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static void set_cache_mkc(struct mlx5_cache_ent *ent, void *mkc)
297297

298298
MLX5_SET(mkc, mkc, translations_octword_size,
299299
get_mkc_octo_size(ent->access_mode, ent->ndescs));
300-
MLX5_SET(mkc, mkc, log_page_size, ent->page);
300+
MLX5_SET(mkc, mkc, log_page_size, PAGE_SHIFT);
301301
}
302302

303303
/* Asynchronously schedule new MRs to be populated in the cache. */
@@ -765,7 +765,6 @@ int mlx5_mkey_cache_init(struct mlx5_ib_dev *dev)
765765
if (ent->order > mkey_cache_max_order(dev))
766766
continue;
767767

768-
ent->page = PAGE_SHIFT;
769768
ent->ndescs = 1 << ent->order;
770769
ent->access_mode = MLX5_MKC_ACCESS_MODE_MTT;
771770
if ((dev->mdev->profile.mask & MLX5_PROF_MASK_MR_CACHE) &&

drivers/infiniband/hw/mlx5/odp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,14 +1594,12 @@ void mlx5_odp_init_mkey_cache_entry(struct mlx5_cache_ent *ent)
15941594

15951595
switch (ent->order - 2) {
15961596
case MLX5_IMR_MTT_CACHE_ENTRY:
1597-
ent->page = PAGE_SHIFT;
15981597
ent->ndescs = MLX5_IMR_MTT_ENTRIES;
15991598
ent->access_mode = MLX5_MKC_ACCESS_MODE_MTT;
16001599
ent->limit = 0;
16011600
break;
16021601

16031602
case MLX5_IMR_KSM_CACHE_ENTRY:
1604-
ent->page = MLX5_KSM_PAGE_SHIFT;
16051603
ent->ndescs = mlx5_imr_ksm_entries;
16061604
ent->access_mode = MLX5_MKC_ACCESS_MODE_KSM;
16071605
ent->limit = 0;

0 commit comments

Comments
 (0)