History

RDMA/uverbs: Expose the new GID query API to user space

Expose the query GID table and entry API to user space by adding two new methods and method handlers to the device object. This API provides a faster way to query a GID table using single call and will be used in libibverbs to improve current approach that requires multiple calls to open, close and read multiple sysfs files for a single GID table entry.

Avihai Horon committed 6 years ago

Commit 9f85cbe1 parent c4b4d544 files · +220 −4Browse files

Showing the changes to include/uapi (2 of 4 files). Show all

Unified · Split

2 files
  1. include/uapi/rdma/ib_user_ioctl_cmds.h +16 −0
  2. include/uapi/rdma/ib_user_ioctl_verbs.h +6 −0
include/uapi/rdma/ib_user_ioctl_cmds.h+16−0
@@ -70,6 +70,8 @@ enum uverbs_methods_device { · 69 unmodified lines
70 UVERBS_METHOD_QUERY_PORT,70 UVERBS_METHOD_QUERY_PORT,
71 UVERBS_METHOD_GET_CONTEXT,71 UVERBS_METHOD_GET_CONTEXT,
72 UVERBS_METHOD_QUERY_CONTEXT,72 UVERBS_METHOD_QUERY_CONTEXT,
73 UVERBS_METHOD_QUERY_GID_TABLE,
74 UVERBS_METHOD_QUERY_GID_ENTRY,
73};75};
74 76
75enum uverbs_attrs_invoke_write_cmd_attr_ids {77enum uverbs_attrs_invoke_write_cmd_attr_ids {
@@ -352,4 +354,18 @@ enum uverbs_attrs_async_event_create { · 276 unmodified lines
352 UVERBS_ATTR_ASYNC_EVENT_ALLOC_FD_HANDLE,354 UVERBS_ATTR_ASYNC_EVENT_ALLOC_FD_HANDLE,
353};355};
354 356
357enum uverbs_attrs_query_gid_table_cmd_attr_ids {
358 UVERBS_ATTR_QUERY_GID_TABLE_ENTRY_SIZE,
359 UVERBS_ATTR_QUERY_GID_TABLE_FLAGS,
360 UVERBS_ATTR_QUERY_GID_TABLE_RESP_ENTRIES,
361 UVERBS_ATTR_QUERY_GID_TABLE_RESP_NUM_ENTRIES,
362};
363
364enum uverbs_attrs_query_gid_entry_cmd_attr_ids {
365 UVERBS_ATTR_QUERY_GID_ENTRY_PORT,
366 UVERBS_ATTR_QUERY_GID_ENTRY_GID_INDEX,
367 UVERBS_ATTR_QUERY_GID_ENTRY_FLAGS,
368 UVERBS_ATTR_QUERY_GID_ENTRY_RESP_ENTRY,
369};
370
355#endif371#endif
include/uapi/rdma/ib_user_ioctl_verbs.h+6−0
@@ -251,6 +251,12 @@ enum rdma_driver_id { · 250 unmodified lines
251 RDMA_DRIVER_SIW,251 RDMA_DRIVER_SIW,
252};252};
253 253
254enum ib_uverbs_gid_type {
255 IB_UVERBS_GID_TYPE_IB,
256 IB_UVERBS_GID_TYPE_ROCE_V1,
257 IB_UVERBS_GID_TYPE_ROCE_V2,
258};
259
254struct ib_uverbs_gid_entry {260struct ib_uverbs_gid_entry {
255 __aligned_u64 gid[2];261 __aligned_u64 gid[2];
256 __u32 gid_index;262 __u32 gid_index;