Add core infrastructure for Completion Counters, a light-weight alternative to polling CQ for tracking operation completions. Define the UVERBS_OBJECT_COMP_CNTR ioctl object with create, destroy, modify and read methods for both success and error counters. Add a QP attach method on the QP object to associate a completion counter with a queue pair. Add ib_comp_cntr struct, ib_comp_cntr_attach_attr, device ops, and DECLARE_RDMA_OBJ_SIZE for driver object allocation. Only userspace Completion Counters are supported at this stage.
Showing the changes to include/uapi (2 of 9 files). Show all
Unified · Split
| @@ -57,6 +57,7 @@ enum uverbs_default_objects { · 56 unmodified lines | |||
| 57 | UVERBS_OBJECT_ASYNC_EVENT, | 57 | UVERBS_OBJECT_ASYNC_EVENT, |
| 58 | UVERBS_OBJECT_DMAH, | 58 | UVERBS_OBJECT_DMAH, |
| 59 | UVERBS_OBJECT_DMABUF, | 59 | UVERBS_OBJECT_DMABUF, |
| 60 | UVERBS_OBJECT_COMP_CNTR, | ||
| 60 | }; | 61 | }; |
| 61 | 62 | ||
| 62 | enum { | 63 | enum { |
| @@ -169,9 +170,16 @@ enum uverbs_attrs_destroy_qp_cmd_attr_ids { · 106 unmodified lines | |||
| 169 | UVERBS_ATTR_DESTROY_QP_RESP, | 170 | UVERBS_ATTR_DESTROY_QP_RESP, |
| 170 | }; | 171 | }; |
| 171 | 172 | ||
| 173 | enum uverbs_attrs_qp_attach_comp_cntr_cmd_attr_ids { | ||
| 174 | UVERBS_ATTR_QP_ATTACH_COMP_CNTR_HANDLE, | ||
| 175 | UVERBS_ATTR_QP_ATTACH_COMP_CNTR_CNTR_HANDLE, | ||
| 176 | UVERBS_ATTR_QP_ATTACH_COMP_CNTR_OP_MASK, | ||
| 177 | }; | ||
| 178 | |||
| 172 | enum uverbs_methods_qp { | 179 | enum uverbs_methods_qp { |
| 173 | UVERBS_METHOD_QP_CREATE, | 180 | UVERBS_METHOD_QP_CREATE, |
| 174 | UVERBS_METHOD_QP_DESTROY, | 181 | UVERBS_METHOD_QP_DESTROY, |
| 182 | UVERBS_METHOD_QP_ATTACH_COMP_CNTR, | ||
| 175 | }; | 183 | }; |
| 176 | 184 | ||
| 177 | enum uverbs_attrs_create_srq_cmd_attr_ids { | 185 | enum uverbs_attrs_create_srq_cmd_attr_ids { |
| @@ -438,4 +446,32 @@ enum uverbs_attrs_query_gid_entry_cmd_attr_ids { · 260 unmodified lines | |||
| 438 | UVERBS_ATTR_QUERY_GID_ENTRY_RESP_ENTRY, | 446 | UVERBS_ATTR_QUERY_GID_ENTRY_RESP_ENTRY, |
| 439 | }; | 447 | }; |
| 440 | 448 | ||
| 449 | enum uverbs_methods_comp_cntr { | ||
| 450 | UVERBS_METHOD_COMP_CNTR_CREATE, | ||
| 451 | UVERBS_METHOD_COMP_CNTR_DESTROY, | ||
| 452 | UVERBS_METHOD_COMP_CNTR_MODIFY, | ||
| 453 | UVERBS_METHOD_COMP_CNTR_READ, | ||
| 454 | }; | ||
| 455 | |||
| 456 | enum uverbs_attrs_create_comp_cntr_cmd_attr_ids { | ||
| 457 | UVERBS_ATTR_CREATE_COMP_CNTR_HANDLE, | ||
| 458 | }; | ||
| 459 | |||
| 460 | enum uverbs_attrs_destroy_comp_cntr_cmd_attr_ids { | ||
| 461 | UVERBS_ATTR_DESTROY_COMP_CNTR_HANDLE, | ||
| 462 | }; | ||
| 463 | |||
| 464 | enum uverbs_attrs_modify_comp_cntr_cmd_attr_ids { | ||
| 465 | UVERBS_ATTR_MODIFY_COMP_CNTR_HANDLE, | ||
| 466 | UVERBS_ATTR_MODIFY_COMP_CNTR_ENTRY, | ||
| 467 | UVERBS_ATTR_MODIFY_COMP_CNTR_OP, | ||
| 468 | UVERBS_ATTR_MODIFY_COMP_CNTR_VALUE, | ||
| 469 | }; | ||
| 470 | |||
| 471 | enum uverbs_attrs_read_comp_cntr_cmd_attr_ids { | ||
| 472 | UVERBS_ATTR_READ_COMP_CNTR_HANDLE, | ||
| 473 | UVERBS_ATTR_READ_COMP_CNTR_ENTRY, | ||
| 474 | UVERBS_ATTR_READ_COMP_CNTR_RESP_VALUE, | ||
| 475 | }; | ||
| 476 | |||
| 441 | #endif | 477 | #endif |
| @@ -300,4 +300,23 @@ struct ib_uverbs_buffer_desc { · 299 unmodified lines | |||
| 300 | __aligned_u64 length; | 300 | __aligned_u64 length; |
| 301 | }; | 301 | }; |
| 302 | 302 | ||
| 303 | enum ib_uverbs_comp_cntr_entry { | ||
| 304 | IB_UVERBS_COMP_CNTR_ENTRY_COMP, | ||
| 305 | IB_UVERBS_COMP_CNTR_ENTRY_ERR, | ||
| 306 | }; | ||
| 307 | |||
| 308 | enum ib_uverbs_comp_cntr_modify_op { | ||
| 309 | IB_UVERBS_COMP_CNTR_MODIFY_OP_SET, | ||
| 310 | IB_UVERBS_COMP_CNTR_MODIFY_OP_INC, | ||
| 311 | }; | ||
| 312 | |||
| 313 | enum ib_uverbs_qp_attach_comp_cntr_op { | ||
| 314 | IB_UVERBS_QP_ATTACH_COMP_CNTR_OP_SEND = 1 << 0, | ||
| 315 | IB_UVERBS_QP_ATTACH_COMP_CNTR_OP_RECV = 1 << 1, | ||
| 316 | IB_UVERBS_QP_ATTACH_COMP_CNTR_OP_RDMA_READ = 1 << 2, | ||
| 317 | IB_UVERBS_QP_ATTACH_COMP_CNTR_OP_REMOTE_RDMA_READ = 1 << 3, | ||
| 318 | IB_UVERBS_QP_ATTACH_COMP_CNTR_OP_RDMA_WRITE = 1 << 4, | ||
| 319 | IB_UVERBS_QP_ATTACH_COMP_CNTR_OP_REMOTE_RDMA_WRITE = 1 << 5, | ||
| 320 | }; | ||
| 321 | |||
| 303 | #endif | 322 | #endif |