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.
Showing the changes to include/uapi (2 of 4 files). Show all
Unified · Split
| @@ -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 | ||
| 75 | enum uverbs_attrs_invoke_write_cmd_attr_ids { | 77 | enum 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 | ||
| 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 | |||
| 355 | #endif | 371 | #endif |
| @@ -251,6 +251,12 @@ enum rdma_driver_id { · 250 unmodified lines | |||
| 251 | RDMA_DRIVER_SIW, | 251 | RDMA_DRIVER_SIW, |
| 252 | }; | 252 | }; |
| 253 | 253 | ||
| 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 | |||
| 254 | struct ib_uverbs_gid_entry { | 260 | struct ib_uverbs_gid_entry { |
| 255 | __aligned_u64 gid[2]; | 261 | __aligned_u64 gid[2]; |
| 256 | __u32 gid_index; | 262 | __u32 gid_index; |