diff mbox series

[RFC,rdma-next,03/10] RDMA/rxe: Allow registering FLUSH flags for supported device only

Message ID 20211228080717.10666-4-lizhijian@cn.fujitsu.com (mailing list archive)
State Superseded
Headers show
Series RDMA/rxe: Add RDMA FLUSH operation | expand

Commit Message

Li Zhijian Dec. 28, 2021, 8:07 a.m. UTC
Device should enable IB_DEVICE_RDMA_FLUSH capability if it want to
support RDMA FLUSH.

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 include/rdma/ib_verbs.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jason Gunthorpe Jan. 6, 2022, 12:22 a.m. UTC | #1
On Tue, Dec 28, 2021 at 04:07:10PM +0800, Li Zhijian wrote:
> Device should enable IB_DEVICE_RDMA_FLUSH capability if it want to
> support RDMA FLUSH.
> 
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> ---
>  include/rdma/ib_verbs.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index f04d66539879..51d58b641201 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -291,6 +291,7 @@ enum ib_device_cap_flags {
>  	/* The device supports padding incoming writes to cacheline. */
>  	IB_DEVICE_PCI_WRITE_END_PADDING		= (1ULL << 36),
>  	IB_DEVICE_ALLOW_USER_UNREG		= (1ULL << 37),
> +	IB_DEVICE_RDMA_FLUSH			= (1ULL << 38),
>  };
>  
>  enum ib_atomic_cap {
> @@ -4319,6 +4320,10 @@ static inline int ib_check_mr_access(struct ib_device *ib_dev,
>  	if (flags & IB_ACCESS_ON_DEMAND &&
>  	    !(ib_dev->attrs.device_cap_flags & IB_DEVICE_ON_DEMAND_PAGING))
>  		return -EINVAL;
> +
> +	if (flags & IB_ACCESS_FLUSH &&
> +	    !(ib_dev->attrs.device_cap_flags & IB_DEVICE_RDMA_FLUSH))
> +		return -EINVAL;
>  	return 0;
>  }

This needs to be combined with the previous patch

Jason
Zhijian Li (Fujitsu) Jan. 6, 2022, 6:20 a.m. UTC | #2
On 06/01/2022 08:22, Jason Gunthorpe wrote:
> On Tue, Dec 28, 2021 at 04:07:10PM +0800, Li Zhijian wrote:
>> Device should enable IB_DEVICE_RDMA_FLUSH capability if it want to
>> support RDMA FLUSH.
>>
>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
>> ---
>>   include/rdma/ib_verbs.h | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
>> index f04d66539879..51d58b641201 100644
>> --- a/include/rdma/ib_verbs.h
>> +++ b/include/rdma/ib_verbs.h
>> @@ -291,6 +291,7 @@ enum ib_device_cap_flags {
>>   	/* The device supports padding incoming writes to cacheline. */
>>   	IB_DEVICE_PCI_WRITE_END_PADDING		= (1ULL << 36),
>>   	IB_DEVICE_ALLOW_USER_UNREG		= (1ULL << 37),
>> +	IB_DEVICE_RDMA_FLUSH			= (1ULL << 38),
>>   };
>>   
>>   enum ib_atomic_cap {
>> @@ -4319,6 +4320,10 @@ static inline int ib_check_mr_access(struct ib_device *ib_dev,
>>   	if (flags & IB_ACCESS_ON_DEMAND &&
>>   	    !(ib_dev->attrs.device_cap_flags & IB_DEVICE_ON_DEMAND_PAGING))
>>   		return -EINVAL;
>> +
>> +	if (flags & IB_ACCESS_FLUSH &&
>> +	    !(ib_dev->attrs.device_cap_flags & IB_DEVICE_RDMA_FLUSH))
>> +		return -EINVAL;
>>   	return 0;
>>   }
> This needs to be combined with the previous patch
Make sense

Thanks
Zhijian

>
> Jason
Zhijian Li (Fujitsu) Jan. 13, 2022, 6:43 a.m. UTC | #3
Hey Tom, Tomas, all

I recall that the SPEC says:
> A19.4.3.1 HCA RESOURCES
> This Annex introduces the following new HCA attributes:
> • Ability to support Memory Placement Extensions
> a) Ability to support FLUSH
> i) Ability to support FLUSH with PLT Global Visibility
> ii) Ability to support FLUSH with PLT Persistence

Do you have any idea that can the HCA support just part of the FLUSH capabilities.
For example,  HCA_foo only supports PLT Global Visibility, no PLT Persistence support.

Thanks
Zhijian



On 28/12/2021 16:07, Li Zhijian wrote:
> Device should enable IB_DEVICE_RDMA_FLUSH capability if it want to
> support RDMA FLUSH.
>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> ---
>   include/rdma/ib_verbs.h | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index f04d66539879..51d58b641201 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -291,6 +291,7 @@ enum ib_device_cap_flags {
>   	/* The device supports padding incoming writes to cacheline. */
>   	IB_DEVICE_PCI_WRITE_END_PADDING		= (1ULL << 36),
>   	IB_DEVICE_ALLOW_USER_UNREG		= (1ULL << 37),
> +	IB_DEVICE_RDMA_FLUSH			= (1ULL << 38),
>   };
>   
>   enum ib_atomic_cap {
> @@ -4319,6 +4320,10 @@ static inline int ib_check_mr_access(struct ib_device *ib_dev,
>   	if (flags & IB_ACCESS_ON_DEMAND &&
>   	    !(ib_dev->attrs.device_cap_flags & IB_DEVICE_ON_DEMAND_PAGING))
>   		return -EINVAL;
> +
> +	if (flags & IB_ACCESS_FLUSH &&
> +	    !(ib_dev->attrs.device_cap_flags & IB_DEVICE_RDMA_FLUSH))
> +		return -EINVAL;
>   	return 0;
>   }
>
diff mbox series

Patch

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index f04d66539879..51d58b641201 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -291,6 +291,7 @@  enum ib_device_cap_flags {
 	/* The device supports padding incoming writes to cacheline. */
 	IB_DEVICE_PCI_WRITE_END_PADDING		= (1ULL << 36),
 	IB_DEVICE_ALLOW_USER_UNREG		= (1ULL << 37),
+	IB_DEVICE_RDMA_FLUSH			= (1ULL << 38),
 };
 
 enum ib_atomic_cap {
@@ -4319,6 +4320,10 @@  static inline int ib_check_mr_access(struct ib_device *ib_dev,
 	if (flags & IB_ACCESS_ON_DEMAND &&
 	    !(ib_dev->attrs.device_cap_flags & IB_DEVICE_ON_DEMAND_PAGING))
 		return -EINVAL;
+
+	if (flags & IB_ACCESS_FLUSH &&
+	    !(ib_dev->attrs.device_cap_flags & IB_DEVICE_RDMA_FLUSH))
+		return -EINVAL;
 	return 0;
 }