diff mbox series

[rdma-core,3/5] verbs: Add IDRs array attribute type to ioctl() interface

Message ID 1538648247-21003-4-git-send-email-yishaih@mellanox.com (mailing list archive)
State Not Applicable
Headers show
Series mlx5: Extend flow steering support | expand

Commit Message

Yishai Hadas Oct. 4, 2018, 10:17 a.m. UTC
From: Guy Levi <guyle@mellanox.com>

Methods sometimes need to get a flexible set of idrs and not a strict
set as can be achieved today by the conventional idr attribute. This
is an idrs-array-like behavior.
Since this may be popular used, we add a new IDRS_ARRAY attribute to
the generic uverbs ioctl layer.
This attribute is embedded in methods, like any other attributes we
currently have.

We align the user-space code with the respected changes in the kernel.

Signed-off-by: Guy Levi <guyle@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
---
 libibverbs/cmd_ioctl.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/libibverbs/cmd_ioctl.h b/libibverbs/cmd_ioctl.h
index d58d890..df3dc41 100644
--- a/libibverbs/cmd_ioctl.h
+++ b/libibverbs/cmd_ioctl.h
@@ -394,4 +394,13 @@  fill_attr_in_enum(struct ibv_command_buffer *cmd, uint16_t attr_id,
 	return attr;
 }
 
+/* Send attributes of kernel type UVERBS_ATTR_TYPE_IDRS_ARRAY */
+static inline struct ib_uverbs_attr *
+fill_attr_in_objs_arr(struct ibv_command_buffer *cmd, uint16_t attr_id,
+		      const uint32_t *idrs_arr, size_t nelems)
+{
+	return fill_attr_in(cmd, attr_id, idrs_arr,
+			    _array_len(sizeof(*idrs_arr), nelems));
+}
+
 #endif