On Wed, Dec 07, 2022 at 10:57:48AM +0200, Michael Guralnik wrote: > From: Aharon Landau <aharonl@xxxxxxxxxx> > > Explicit ODP mkey doesn't have unique properties. There is no need to > devote to it a special entry. Removing it. > > Signed-off-by: Aharon Landau <aharonl@xxxxxxxxxx> > --- > drivers/infiniband/hw/mlx5/odp.c | 19 ++++--------------- > include/linux/mlx5/driver.h | 1 - > 2 files changed, 4 insertions(+), 16 deletions(-) > > diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c > index e9a29adef7dc..71b733fcac37 100644 > --- a/drivers/infiniband/hw/mlx5/odp.c > +++ b/drivers/infiniband/hw/mlx5/odp.c > @@ -406,6 +406,7 @@ static void mlx5_ib_page_fault_resume(struct mlx5_ib_dev *dev, > static struct mlx5_ib_mr *implicit_get_child_mr(struct mlx5_ib_mr *imr, > unsigned long idx) > { > + int order = order_base_2(MLX5_IMR_MTT_ENTRIES); unsigned int > struct mlx5_ib_dev *dev = mr_to_mdev(imr); > struct ib_umem_odp *odp; > struct mlx5_ib_mr *mr; > @@ -418,7 +419,7 @@ static struct mlx5_ib_mr *implicit_get_child_mr(struct mlx5_ib_mr *imr, > if (IS_ERR(odp)) > return ERR_CAST(odp); > > - mr = mlx5_mr_cache_alloc(dev, &dev->cache.ent[MLX5_IMR_MTT_CACHE_ENTRY], > + mr = mlx5_mr_cache_alloc(dev, &dev->cache.ent[order], Okay, I get it now, this is actually just order 18, so it is covered by the existing order. You should clarify the commit message that it is the same as the order 18 entry. Also add a compile time assertion here: static_assert(order < MKEY_CACHE_LAST_STD_ENTRY); Jason