2024-06-05 08:17:52

by Konstantin Taranov

[permalink] [raw]
Subject: [PATCH v2 1/1] RDMA/mana_ib: ignore optional access flags for MRs

From: Konstantin Taranov <[email protected]>

Ignore optional ib_access_flags when an MR is created.

Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
Signed-off-by: Konstantin Taranov <[email protected]>
---
drivers/infiniband/hw/mana/mr.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/hw/mana/mr.c b/drivers/infiniband/hw/mana/mr.c
index 4f13423..887b09d 100644
--- a/drivers/infiniband/hw/mana/mr.c
+++ b/drivers/infiniband/hw/mana/mr.c
@@ -112,6 +112,7 @@ struct ib_mr *mana_ib_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 length,
"start 0x%llx, iova 0x%llx length 0x%llx access_flags 0x%x",
start, iova, length, access_flags);

+ access_flags &= ~IB_ACCESS_OPTIONAL;
if (access_flags & ~VALID_MR_FLAGS)
return ERR_PTR(-EINVAL);

--
2.43.0



2024-06-05 22:14:44

by Long Li

[permalink] [raw]
Subject: RE: [PATCH v2 1/1] RDMA/mana_ib: ignore optional access flags for MRs

> Subject: [PATCH v2 1/1] RDMA/mana_ib: ignore optional access flags for MRs
>
> From: Konstantin Taranov <[email protected]>
>
> Ignore optional ib_access_flags when an MR is created.

Can you add details on why this is needed?

2024-06-06 08:30:23

by Konstantin Taranov

[permalink] [raw]
Subject: RE: [PATCH v2 1/1] RDMA/mana_ib: ignore optional access flags for MRs

> > Ignore optional ib_access_flags when an MR is created.
>
> Can you add details on why this is needed?

Do you mean to the commit message?
If we do not ignore these optional flags, the reg user mr fails because the next 2 lines:
if (access_flags & ~VALID_MR_FLAGS)
return ERR_PTR(-EINVAL);

2024-06-06 11:39:09

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] RDMA/mana_ib: ignore optional access flags for MRs


On Wed, 05 Jun 2024 01:16:08 -0700, Konstantin Taranov wrote:
> Ignore optional ib_access_flags when an MR is created.
>
>

Applied, thanks!

[1/1] RDMA/mana_ib: ignore optional access flags for MRs
https://git.kernel.org/rdma/rdma/c/62093519622311

Best regards,
--
Leon Romanovsky <[email protected]>


2024-06-06 11:42:43

by Konstantin Taranov

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] RDMA/mana_ib: ignore optional access flags for MRs

> > > > Ignore optional ib_access_flags when an MR is created.
> > >
> > > Can you add details on why this is needed?
> >
> > Do you mean to the commit message?
> > If we do not ignore these optional flags, the reg user mr fails because the
> next 2 lines:
> > if (access_flags & ~VALID_MR_FLAGS)
> > return ERR_PTR(-EINVAL);
>
> I took this patch as is.
>
> Thanks

thanks. It makes sense.

2024-06-06 11:44:28

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] RDMA/mana_ib: ignore optional access flags for MRs

On Thu, Jun 06, 2024 at 08:30:06AM +0000, Konstantin Taranov wrote:
> > > Ignore optional ib_access_flags when an MR is created.
> >
> > Can you add details on why this is needed?
>
> Do you mean to the commit message?
> If we do not ignore these optional flags, the reg user mr fails because the next 2 lines:
> if (access_flags & ~VALID_MR_FLAGS)
> return ERR_PTR(-EINVAL);

I took this patch as is.

Thanks