• Jason Gunthorpe's avatar
    RDMA/mlx5: Clarify what the UMR is for when creating MRs · 8383da3e
    Jason Gunthorpe authored
    Once a mkey is created it can be modified using UMR. This is desirable for
    performance reasons. However, different hardware has restrictions on what
    modifications are possible using UMR. Make sense of these checks:
    
    - mlx5_ib_can_reconfig_with_umr() returns true if the access flags can be
      altered. Most cases create MRs using 0 access flags (now made clear by
      consistent use of set_mkc_access_pd_addr_fields()), but the old logic
      here was tormented. Make it clear that this is checking if the current
      access_flags can be modified using UMR to different access_flags. It is
      always OK to use UMR to change flags that all HW supports.
    
    - mlx5_ib_can_load_pas_with_umr() returns true if UMR can be used to
      enable and update the PAS/XLT. Enabling requires updating the entity
      size, so UMR ends up completely disabled on this old hardware. Make it
      clear why it is disabled. FRWR, ODP and cache always requires
      mlx5_ib_can_load_pas_with_umr().
    
    - mlx5_ib_pas_fits_in_mr() is used to tell if an existing MR can be
      resized to hold a new PAS list. This only works for cached MR's because
      we don't store the PAS list size in other cases.
    
    To be very clear, arrange things so any pre-created MR's in the cache
    check the newly requested access_flags before allowing the MR to leave the
    cache. If UMR cannot set the required access_flags the cache fails to
    create the MR.
    
    This in turn means relaxed ordering and atomic are now correctly blocked
    early for implicit ODP on older HW.
    
    Link: https://lore.kernel.org/r/20200914112653.345244-6-leon@kernel.orgSigned-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    8383da3e
mr.c 60.8 KB