Skip to content

Commit 18b1746

Browse files
aharonl-nvidiajgunthorpe
authored andcommitted
RDMA/mlx5: Remove implicit ODP cache entry
Implicit ODP mkey doesn't have unique properties. It shares the same properties as the order 18 cache entry. There is no need to devote a special entry for that. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Aharon Landau <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent a2a88b8 commit 18b1746

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

drivers/infiniband/hw/mlx5/odp.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ static void mlx5_ib_page_fault_resume(struct mlx5_ib_dev *dev,
405405
static struct mlx5_ib_mr *implicit_get_child_mr(struct mlx5_ib_mr *imr,
406406
unsigned long idx)
407407
{
408+
int order = order_base_2(MLX5_IMR_MTT_ENTRIES);
408409
struct mlx5_ib_dev *dev = mr_to_mdev(imr);
409410
struct ib_umem_odp *odp;
410411
struct mlx5_ib_mr *mr;
@@ -417,7 +418,8 @@ static struct mlx5_ib_mr *implicit_get_child_mr(struct mlx5_ib_mr *imr,
417418
if (IS_ERR(odp))
418419
return ERR_CAST(odp);
419420

420-
mr = mlx5_mr_cache_alloc(dev, &dev->cache.ent[MLX5_IMR_MTT_CACHE_ENTRY],
421+
BUILD_BUG_ON(order > MKEY_CACHE_LAST_STD_ENTRY);
422+
mr = mlx5_mr_cache_alloc(dev, &dev->cache.ent[order],
421423
imr->access_flags);
422424
if (IS_ERR(mr)) {
423425
ib_umem_odp_release(odp);
@@ -1591,20 +1593,8 @@ void mlx5_odp_init_mkey_cache_entry(struct mlx5_cache_ent *ent)
15911593
{
15921594
if (!(ent->dev->odp_caps.general_caps & IB_ODP_SUPPORT_IMPLICIT))
15931595
return;
1594-
1595-
switch (ent->order - 2) {
1596-
case MLX5_IMR_MTT_CACHE_ENTRY:
1597-
ent->ndescs = MLX5_IMR_MTT_ENTRIES;
1598-
ent->access_mode = MLX5_MKC_ACCESS_MODE_MTT;
1599-
ent->limit = 0;
1600-
break;
1601-
1602-
case MLX5_IMR_KSM_CACHE_ENTRY:
1603-
ent->ndescs = mlx5_imr_ksm_entries;
1604-
ent->access_mode = MLX5_MKC_ACCESS_MODE_KSM;
1605-
ent->limit = 0;
1606-
break;
1607-
}
1596+
ent->ndescs = mlx5_imr_ksm_entries;
1597+
ent->access_mode = MLX5_MKC_ACCESS_MODE_KSM;
16081598
}
16091599

16101600
static const struct ib_device_ops mlx5_ib_dev_odp_ops = {

include/linux/mlx5/driver.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,6 @@ enum {
734734

735735
enum {
736736
MKEY_CACHE_LAST_STD_ENTRY = 20,
737-
MLX5_IMR_MTT_CACHE_ENTRY,
738737
MLX5_IMR_KSM_CACHE_ENTRY,
739738
MAX_MKEY_CACHE_ENTRIES
740739
};

0 commit comments

Comments
 (0)