diff mbox series

[rdma-next,07/10] RDMA/efa: Allow passing of optional access flags for MR registration

Message ID 1578506740-22188-8-git-send-email-yishaih@mellanox.com (mailing list archive)
State Mainlined
Commit 86dd738cf20cee4ac316274743e5707c4ccb6039
Delegated to: Jason Gunthorpe
Headers show
Series Relaxed ordering memory regions | expand

Commit Message

Yishai Hadas Jan. 8, 2020, 6:05 p.m. UTC
From: Michael Guralnik <michaelgur@mellanox.com>

As part of adding a range of optional access flags that drivers need to
be able to accept, mask this range inside efa driver.
This will prevent the driver from failing when an access flag from
that range is passed.

Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
---
 drivers/infiniband/hw/efa/efa_verbs.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gal Pressman Jan. 21, 2020, 4:37 p.m. UTC | #1
On 08/01/2020 20:05, Yishai Hadas wrote:
> From: Michael Guralnik <michaelgur@mellanox.com>
> 
> As part of adding a range of optional access flags that drivers need to
> be able to accept, mask this range inside efa driver.
> This will prevent the driver from failing when an access flag from
> that range is passed.
> 
> Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
> Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
> ---
>  drivers/infiniband/hw/efa/efa_verbs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
> index 50c2257..b6b936c 100644
> --- a/drivers/infiniband/hw/efa/efa_verbs.c
> +++ b/drivers/infiniband/hw/efa/efa_verbs.c
> @@ -1370,6 +1370,7 @@ struct ib_mr *efa_reg_mr(struct ib_pd *ibpd, u64 start, u64 length,
>  		IB_ACCESS_LOCAL_WRITE |
>  		(is_rdma_read_cap(dev) ? IB_ACCESS_REMOTE_READ : 0);
>  
> +	access_flags &= ~IB_UVERBS_ACCESS_OPTIONAL_RANGE;

Hi Yishai,
access_flags should be masked with IB_ACCESS_OPTIONAL instead of
IB_UVERBS_ACCESS_OPTIONAL_RANGE.

Also, could you please make sure to CC me to future EFA patches?
Yishai Hadas Jan. 21, 2020, 4:57 p.m. UTC | #2
On 1/21/2020 6:37 PM, Gal Pressman wrote:
> On 08/01/2020 20:05, Yishai Hadas wrote:
>> From: Michael Guralnik <michaelgur@mellanox.com>
>>
>> As part of adding a range of optional access flags that drivers need to
>> be able to accept, mask this range inside efa driver.
>> This will prevent the driver from failing when an access flag from
>> that range is passed.
>>
>> Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
>> Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
>> ---
>>   drivers/infiniband/hw/efa/efa_verbs.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
>> index 50c2257..b6b936c 100644
>> --- a/drivers/infiniband/hw/efa/efa_verbs.c
>> +++ b/drivers/infiniband/hw/efa/efa_verbs.c
>> @@ -1370,6 +1370,7 @@ struct ib_mr *efa_reg_mr(struct ib_pd *ibpd, u64 start, u64 length,
>>   		IB_ACCESS_LOCAL_WRITE |
>>   		(is_rdma_read_cap(dev) ? IB_ACCESS_REMOTE_READ : 0);
>>   
>> +	access_flags &= ~IB_UVERBS_ACCESS_OPTIONAL_RANGE;
> 
> Hi Yishai,
> access_flags should be masked with IB_ACCESS_OPTIONAL instead of
> IB_UVERBS_ACCESS_OPTIONAL_RANGE.
> 

You are talking from namespace point of view, right ? both have same value.

If it's important, can you send some patch to replace ?

> Also, could you please make sure to CC me to future EFA patches?
> 

Sure, thanks.
Gal Pressman Jan. 22, 2020, 7:51 a.m. UTC | #3
On 21/01/2020 18:57, Yishai Hadas wrote:
> On 1/21/2020 6:37 PM, Gal Pressman wrote:
>> On 08/01/2020 20:05, Yishai Hadas wrote:
>>> From: Michael Guralnik <michaelgur@mellanox.com>
>>>
>>> As part of adding a range of optional access flags that drivers need to
>>> be able to accept, mask this range inside efa driver.
>>> This will prevent the driver from failing when an access flag from
>>> that range is passed.
>>>
>>> Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
>>> Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
>>> ---
>>>   drivers/infiniband/hw/efa/efa_verbs.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/infiniband/hw/efa/efa_verbs.c
>>> b/drivers/infiniband/hw/efa/efa_verbs.c
>>> index 50c2257..b6b936c 100644
>>> --- a/drivers/infiniband/hw/efa/efa_verbs.c
>>> +++ b/drivers/infiniband/hw/efa/efa_verbs.c
>>> @@ -1370,6 +1370,7 @@ struct ib_mr *efa_reg_mr(struct ib_pd *ibpd, u64 start,
>>> u64 length,
>>>           IB_ACCESS_LOCAL_WRITE |
>>>           (is_rdma_read_cap(dev) ? IB_ACCESS_REMOTE_READ : 0);
>>>   +    access_flags &= ~IB_UVERBS_ACCESS_OPTIONAL_RANGE;
>>
>> Hi Yishai,
>> access_flags should be masked with IB_ACCESS_OPTIONAL instead of
>> IB_UVERBS_ACCESS_OPTIONAL_RANGE.
>>
> 
> You are talking from namespace point of view, right ? both have same value.
> 
> If it's important, can you send some patch to replace ?

I'll send a patch, thanks.
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index 50c2257..b6b936c 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -1370,6 +1370,7 @@  struct ib_mr *efa_reg_mr(struct ib_pd *ibpd, u64 start, u64 length,
 		IB_ACCESS_LOCAL_WRITE |
 		(is_rdma_read_cap(dev) ? IB_ACCESS_REMOTE_READ : 0);
 
+	access_flags &= ~IB_UVERBS_ACCESS_OPTIONAL_RANGE;
 	if (access_flags & ~supp_access_flags) {
 		ibdev_dbg(&dev->ibdev,
 			  "Unsupported access flags[%#x], supported[%#x]\n",