Subject: Re: [PATCH rdma-next 1/3] RDMA/mana_ib: Access remote atomic for MRs

From: Leon Romanovsky <[email-masked]>
Date: Wed, 9 Apr 2025 15:28:52 +0300

On Fri, Apr 04, 2025 at 07:45:53AM -0700, Konstantin Taranov wrote:
> From: Konstantin Taranov <[email-masked]>
> 
> Add IB_ACCESS_REMOTE_ATOMIC to the valid flags for MRs and use
> the corresponding flag bit during MR creation in the HW.
> 
> Signed-off-by: Konstantin Taranov <[email-masked]>
> ---
>  drivers/infiniband/hw/mana/mr.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mana/mr.c b/drivers/infiniband/hw/mana/mr.c
> index f99557e..e4a9f53 100644
> --- a/drivers/infiniband/hw/mana/mr.c
> +++ b/drivers/infiniband/hw/mana/mr.c
> @@ -5,8 +5,8 @@
>  
>  #include "mana_ib.h"
>  
> -#define VALID_MR_FLAGS                                                         \
> -	(IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_WRITE | IB_ACCESS_REMOTE_READ)
> +#define VALID_MR_FLAGS (IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_WRITE | IB_ACCESS_REMOTE_READ |\
> +			IB_ACCESS_REMOTE_ATOMIC)
>  
>  #define VALID_DMA_MR_FLAGS (IB_ACCESS_LOCAL_WRITE)
>  
> @@ -24,6 +24,9 @@ mana_ib_verbs_to_gdma_access_flags(int access_flags)
>  	if (access_flags & IB_ACCESS_REMOTE_READ)
>  		flags |= GDMA_ACCESS_FLAG_REMOTE_READ;
>  
> +	if (access_flags & IB_ACCESS_REMOTE_ATOMIC)
> +		flags |= GDMA_ACCESS_FLAG_REMOTE_ATOMIC;

Can you enable this flag unconditionally without relation to running RW?

Thanks

> +
>  	return flags;
>  }
> -- 
> 2.43.0