diff mbox series

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

Message ID 1541428068-17056-3-git-send-email-yishaih@mellanox.com (mailing list archive)
State RFC
Headers show
Series Introduce ibv_advise_mr verb | expand

Commit Message

Yishai Hadas Nov. 5, 2018, 2:27 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>
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);