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
7070 UVERBS_METHOD_QUERY_PORT,
7171 UVERBS_METHOD_GET_CONTEXT,
7272 UVERBS_METHOD_QUERY_CONTEXT,
73+ UVERBS_METHOD_QUERY_GID_TABLE,
74+ UVERBS_METHOD_QUERY_GID_ENTRY,
7375 };
7476
7577 enum uverbs_attrs_invoke_write_cmd_attr_ids {
@@ -352,4 +354,18 @@ enum uverbs_attrs_async_event_create { · 276 unmodified lines
352354 UVERBS_ATTR_ASYNC_EVENT_ALLOC_FD_HANDLE,
353355 };
354356
357+enum 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+
364+enum 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+
355371 #endif
include/uapi/rdma/ib_user_ioctl_verbs.h+6−0
@@ -251,6 +251,12 @@ enum rdma_driver_id { · 250 unmodified lines
251251 RDMA_DRIVER_SIW,
252252 };
253253
254+enum 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+
254260 struct ib_uverbs_gid_entry {
255261 __aligned_u64 gid[2];
256262 __u32 gid_index;