diff mbox series

[rdma-core,2/6] verbs: Add helper for command interface

Message ID 1544016291-10815-3-git-send-email-yishaih@mellanox.com (mailing list archive)
State Not Applicable
Headers show
Series verbs: Introduce ibv_advise_mr() verb | expand

Commit Message

Yishai Hadas Dec. 5, 2018, 1:24 p.m. UTC
From: Moni Shoua <monis@mellanox.com>

Add fill_attr_in_ptr_array() to store array of elements in a command
buffer.

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

Patch

diff --git a/libibverbs/cmd_ioctl.h b/libibverbs/cmd_ioctl.h
index df3dc41..5587b86 100644
--- a/libibverbs/cmd_ioctl.h
+++ b/libibverbs/cmd_ioctl.h
@@ -376,6 +376,9 @@  static inline size_t _array_len(size_t size, size_t nelems)
 #define fill_attr_out_ptr_array(cmd, attr_id, ptr, nelems)                     \
 	fill_attr_out(cmd, attr_id, ptr, _array_len(sizeof(*ptr), nelems))
 
+#define fill_attr_in_ptr_array(cmd, attr_id, ptr, nelems)                       \
+	fill_attr_in(cmd, attr_id, ptr, _array_len(sizeof(*ptr), nelems))
+
 static inline size_t __check_divide(size_t val, unsigned int div)
 {
 	assert(val % div == 0);