diff mbox series

[v6,1/8] RDMA: Extend RDMA user ABI to support atomic write

Message ID 20221015063648.52285-2-yangx.jy@fujitsu.com (mailing list archive)
State Superseded
Headers show
Series RDMA/rxe: Add atomic write operation | expand

Commit Message

Xiao Yang Oct. 15, 2022, 6:37 a.m. UTC
1) Define new atomic write request/completion in userspace.
2) Define new atomic write capability in userspace.

Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
 include/uapi/rdma/ib_user_verbs.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jason Gunthorpe Nov. 22, 2022, 7:49 p.m. UTC | #1
On Sat, Oct 15, 2022 at 06:37:04AM +0000, yangx.jy@fujitsu.com wrote:
> 1) Define new atomic write request/completion in userspace.
> 2) Define new atomic write capability in userspace.
> 
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
> ---
>  include/uapi/rdma/ib_user_verbs.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
> index 43672cb1fd57..237814815544 100644
> --- a/include/uapi/rdma/ib_user_verbs.h
> +++ b/include/uapi/rdma/ib_user_verbs.h
> @@ -466,6 +466,7 @@ enum ib_uverbs_wc_opcode {
>  	IB_UVERBS_WC_BIND_MW = 5,
>  	IB_UVERBS_WC_LOCAL_INV = 6,
>  	IB_UVERBS_WC_TSO = 7,
> +	IB_UVERBS_WC_ATOMIC_WRITE = 9,
>  };

Why is this 9? The following patch does

@@ -985,6 +986,7 @@ enum ib_wc_opcode {
        IB_WC_REG_MR,
        IB_WC_MASKED_COMP_SWAP,
        IB_WC_MASKED_FETCH_ADD,
+       IB_WC_ATOMIC_WRITE = IB_UVERBS_WC_ATOMIC_WRITE,

Which corrupts the enum.

It should be like this:

+++ b/include/rdma/ib_verbs.h
@@ -983,10 +983,10 @@ enum ib_wc_opcode {
        IB_WC_BIND_MW = IB_UVERBS_WC_BIND_MW,
        IB_WC_LOCAL_INV = IB_UVERBS_WC_LOCAL_INV,
        IB_WC_LSO = IB_UVERBS_WC_TSO,
+       IB_WC_ATOMIC_WRITE = IB_UVERBS_WC_ATOMIC_WRITE,
        IB_WC_REG_MR,
        IB_WC_MASKED_COMP_SWAP,
        IB_WC_MASKED_FETCH_ADD,
-       IB_WC_ATOMIC_WRITE = IB_UVERBS_WC_ATOMIC_WRITE,
 /*
  * Set value of IB_WC_RECV so consumers can test if a completion is a
  * receive by testing (opcode & IB_WC_RECV).
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -466,7 +466,7 @@ enum ib_uverbs_wc_opcode {
        IB_UVERBS_WC_BIND_MW = 5,
        IB_UVERBS_WC_LOCAL_INV = 6,
        IB_UVERBS_WC_TSO = 7,
-       IB_UVERBS_WC_ATOMIC_WRITE = 9,
+       IB_UVERBS_WC_ATOMIC_WRITE = 8,
 };
 
 struct ib_uverbs_wc {

Jason
Xiao Yang Dec. 1, 2022, 11:04 a.m. UTC | #2
On 2022/11/23 3:49, Jason Gunthorpe wrote:
> On Sat, Oct 15, 2022 at 06:37:04AM +0000, yangx.jy@fujitsu.com wrote:
>> 1) Define new atomic write request/completion in userspace.
>> 2) Define new atomic write capability in userspace.
>>
>> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
>> ---
>>   include/uapi/rdma/ib_user_verbs.h | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
>> index 43672cb1fd57..237814815544 100644
>> --- a/include/uapi/rdma/ib_user_verbs.h
>> +++ b/include/uapi/rdma/ib_user_verbs.h
>> @@ -466,6 +466,7 @@ enum ib_uverbs_wc_opcode {
>>   	IB_UVERBS_WC_BIND_MW = 5,
>>   	IB_UVERBS_WC_LOCAL_INV = 6,
>>   	IB_UVERBS_WC_TSO = 7,
>> +	IB_UVERBS_WC_ATOMIC_WRITE = 9,
>>   };
> 
> Why is this 9? The following patch does
Hi Jason,

I reserve 8 for IB_UVERBS_WC_FLUSH and 14 for IB_UVERBS_WR_FLUSH.

> 
> @@ -985,6 +986,7 @@ enum ib_wc_opcode {
>          IB_WC_REG_MR,
>          IB_WC_MASKED_COMP_SWAP,
>          IB_WC_MASKED_FETCH_ADD,
> +       IB_WC_ATOMIC_WRITE = IB_UVERBS_WC_ATOMIC_WRITE,
> 
> Which corrupts the enum.

Good catch. I will correct it now.

Best Regards,
Xiao Yang
> 
> It should be like this:
> 
> +++ b/include/rdma/ib_verbs.h
> @@ -983,10 +983,10 @@ enum ib_wc_opcode {
>          IB_WC_BIND_MW = IB_UVERBS_WC_BIND_MW,
>          IB_WC_LOCAL_INV = IB_UVERBS_WC_LOCAL_INV,
>          IB_WC_LSO = IB_UVERBS_WC_TSO,
> +       IB_WC_ATOMIC_WRITE = IB_UVERBS_WC_ATOMIC_WRITE,
>          IB_WC_REG_MR,
>          IB_WC_MASKED_COMP_SWAP,
>          IB_WC_MASKED_FETCH_ADD,
> -       IB_WC_ATOMIC_WRITE = IB_UVERBS_WC_ATOMIC_WRITE,
>   /*
>    * Set value of IB_WC_RECV so consumers can test if a completion is a
>    * receive by testing (opcode & IB_WC_RECV).
> +++ b/include/uapi/rdma/ib_user_verbs.h
> @@ -466,7 +466,7 @@ enum ib_uverbs_wc_opcode {
>          IB_UVERBS_WC_BIND_MW = 5,
>          IB_UVERBS_WC_LOCAL_INV = 6,
>          IB_UVERBS_WC_TSO = 7,
> -       IB_UVERBS_WC_ATOMIC_WRITE = 9,
> +       IB_UVERBS_WC_ATOMIC_WRITE = 8,
>   };
>   
>   struct ib_uverbs_wc {
> 
> Jason
diff mbox series

Patch

diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index 43672cb1fd57..237814815544 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -466,6 +466,7 @@  enum ib_uverbs_wc_opcode {
 	IB_UVERBS_WC_BIND_MW = 5,
 	IB_UVERBS_WC_LOCAL_INV = 6,
 	IB_UVERBS_WC_TSO = 7,
+	IB_UVERBS_WC_ATOMIC_WRITE = 9,
 };
 
 struct ib_uverbs_wc {
@@ -784,6 +785,7 @@  enum ib_uverbs_wr_opcode {
 	IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
 	IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
 	IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
+	IB_UVERBS_WR_ATOMIC_WRITE = 15,
 	/* Review enum ib_wr_opcode before modifying this */
 };
 
@@ -1331,6 +1333,8 @@  enum ib_uverbs_device_cap_flags {
 	/* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS. */
 	IB_UVERBS_DEVICE_RAW_SCATTER_FCS = 1ULL << 34,
 	IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = 1ULL << 36,
+	/* Atomic write attributes */
+	IB_UVERBS_DEVICE_ATOMIC_WRITE = 1ULL << 40,
 };
 
 enum ib_uverbs_raw_packet_caps {