diff mbox series

[rdma-core,2/4] verbs: Expose a new accessor to be used with enum values

Message ID 1536768249-29432-3-git-send-email-yishaih@mellanox.com (mailing list archive)
State Not Applicable
Headers show
Series mlx5: Flow actions to mutate packets | expand

Commit Message

Yishai Hadas Sept. 12, 2018, 4:04 p.m. UTC
From: Mark Bloch <markb@mellanox.com>

When the kernel expects to get an enum const value,
use fill_attr_const_in().

The enum value is passed as uint64 value.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
---
 libibverbs/cmd_ioctl.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Leon Romanovsky Sept. 13, 2018, 5:51 a.m. UTC | #1
On Wed, Sep 12, 2018 at 07:04:07PM +0300, Yishai Hadas wrote:
> From: Mark Bloch <markb@mellanox.com>
>
> When the kernel expects to get an enum const value,
> use fill_attr_const_in().
>
> The enum value is passed as uint64 value.
>
> Signed-off-by: Mark Bloch <markb@mellanox.com>
> Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
> ---
>  libibverbs/cmd_ioctl.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libibverbs/cmd_ioctl.h b/libibverbs/cmd_ioctl.h
> index 3a61f59..f856b74 100644
> --- a/libibverbs/cmd_ioctl.h
> +++ b/libibverbs/cmd_ioctl.h
> @@ -296,6 +296,9 @@ fill_attr_in_uint64(struct ibv_command_buffer *cmd, uint16_t attr_id,
>  	return attr;
>  }
>
> +#define fill_attr_const_in(cmd, attr_id, _data)				\
						^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
					Let's try to avoid extra space padding

> +	fill_attr_in_uint64(cmd, attr_id, _data)
> +
>  static inline struct ib_uverbs_attr *
>  fill_attr_in_uint32(struct ibv_command_buffer *cmd, uint16_t attr_id,
>  		    uint32_t data)
> --
> 1.8.3.1
>
Yishai Hadas Sept. 13, 2018, 2:29 p.m. UTC | #2
On 9/13/2018 8:51 AM, Leon Romanovsky wrote:
> On Wed, Sep 12, 2018 at 07:04:07PM +0300, Yishai Hadas wrote:
>> From: Mark Bloch <markb@mellanox.com>
>>
>> When the kernel expects to get an enum const value,
>> use fill_attr_const_in().
>>
>> The enum value is passed as uint64 value.
>>
>> Signed-off-by: Mark Bloch <markb@mellanox.com>
>> Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
>> ---
>>   libibverbs/cmd_ioctl.h | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/libibverbs/cmd_ioctl.h b/libibverbs/cmd_ioctl.h
>> index 3a61f59..f856b74 100644
>> --- a/libibverbs/cmd_ioctl.h
>> +++ b/libibverbs/cmd_ioctl.h
>> @@ -296,6 +296,9 @@ fill_attr_in_uint64(struct ibv_command_buffer *cmd, uint16_t attr_id,
>>   	return attr;
>>   }
>>
>> +#define fill_attr_const_in(cmd, attr_id, _data)				\
> 						^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 					Let's try to avoid extra space padding
> 

I have updated the PR [1] to avoid the extra padding, in addition I have 
added a man page for mlx5dv_create_flow_action_modify_header() as Jason 
asked, thanks.


[1] https://github.com/linux-rdma/rdma-core/pull/376
diff mbox series

Patch

diff --git a/libibverbs/cmd_ioctl.h b/libibverbs/cmd_ioctl.h
index 3a61f59..f856b74 100644
--- a/libibverbs/cmd_ioctl.h
+++ b/libibverbs/cmd_ioctl.h
@@ -296,6 +296,9 @@  fill_attr_in_uint64(struct ibv_command_buffer *cmd, uint16_t attr_id,
 	return attr;
 }
 
+#define fill_attr_const_in(cmd, attr_id, _data)				\
+	fill_attr_in_uint64(cmd, attr_id, _data)
+
 static inline struct ib_uverbs_attr *
 fill_attr_in_uint32(struct ibv_command_buffer *cmd, uint16_t attr_id,
 		    uint32_t data)