.. | .. |
---|
5 | 5 | #include <linux/types.h> |
---|
6 | 6 | |
---|
7 | 7 | enum { |
---|
8 | | - RDMA_NL_RDMA_CM = 1, |
---|
9 | | - RDMA_NL_IWCM, |
---|
| 8 | + RDMA_NL_IWCM = 2, |
---|
10 | 9 | RDMA_NL_RSVD, |
---|
11 | 10 | RDMA_NL_LS, /* RDMA Local Services */ |
---|
12 | 11 | RDMA_NL_NLDEV, /* RDMA device interface */ |
---|
.. | .. |
---|
14 | 13 | }; |
---|
15 | 14 | |
---|
16 | 15 | enum { |
---|
17 | | - RDMA_NL_GROUP_CM = 1, |
---|
18 | | - RDMA_NL_GROUP_IWPM, |
---|
| 16 | + RDMA_NL_GROUP_IWPM = 2, |
---|
19 | 17 | RDMA_NL_GROUP_LS, |
---|
20 | 18 | RDMA_NL_NUM_GROUPS |
---|
21 | 19 | }; |
---|
.. | .. |
---|
24 | 22 | #define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1)) |
---|
25 | 23 | #define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op) |
---|
26 | 24 | |
---|
27 | | -enum { |
---|
28 | | - RDMA_NL_RDMA_CM_ID_STATS = 0, |
---|
29 | | - RDMA_NL_RDMA_CM_NUM_OPS |
---|
30 | | -}; |
---|
| 25 | +/* The minimum version that the iwpm kernel supports */ |
---|
| 26 | +#define IWPM_UABI_VERSION_MIN 3 |
---|
31 | 27 | |
---|
| 28 | +/* The latest version that the iwpm kernel supports */ |
---|
| 29 | +#define IWPM_UABI_VERSION 4 |
---|
| 30 | + |
---|
| 31 | +/* iwarp port mapper message flags */ |
---|
32 | 32 | enum { |
---|
33 | | - RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1, |
---|
34 | | - RDMA_NL_RDMA_CM_ATTR_DST_ADDR, |
---|
35 | | - RDMA_NL_RDMA_CM_NUM_ATTR, |
---|
| 33 | + |
---|
| 34 | + /* Do not map the port for this IWPM request */ |
---|
| 35 | + IWPM_FLAGS_NO_PORT_MAP = (1 << 0), |
---|
36 | 36 | }; |
---|
37 | 37 | |
---|
38 | 38 | /* iwarp port mapper op-codes */ |
---|
.. | .. |
---|
45 | 45 | RDMA_NL_IWPM_HANDLE_ERR, |
---|
46 | 46 | RDMA_NL_IWPM_MAPINFO, |
---|
47 | 47 | RDMA_NL_IWPM_MAPINFO_NUM, |
---|
| 48 | + RDMA_NL_IWPM_HELLO, |
---|
48 | 49 | RDMA_NL_IWPM_NUM_OPS |
---|
49 | | -}; |
---|
50 | | - |
---|
51 | | -struct rdma_cm_id_stats { |
---|
52 | | - __u32 qp_num; |
---|
53 | | - __u32 bound_dev_if; |
---|
54 | | - __u32 port_space; |
---|
55 | | - __s32 pid; |
---|
56 | | - __u8 cm_state; |
---|
57 | | - __u8 node_type; |
---|
58 | | - __u8 port_num; |
---|
59 | | - __u8 qp_type; |
---|
60 | 50 | }; |
---|
61 | 51 | |
---|
62 | 52 | enum { |
---|
.. | .. |
---|
83 | 73 | IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0, |
---|
84 | 74 | IWPM_NLA_MANAGE_MAPPING_SEQ, |
---|
85 | 75 | IWPM_NLA_MANAGE_ADDR, |
---|
86 | | - IWPM_NLA_MANAGE_MAPPED_LOC_ADDR, |
---|
| 76 | + IWPM_NLA_MANAGE_FLAGS, |
---|
| 77 | + IWPM_NLA_MANAGE_MAPPING_MAX |
---|
| 78 | +}; |
---|
| 79 | + |
---|
| 80 | +enum { |
---|
| 81 | + IWPM_NLA_RMANAGE_MAPPING_UNSPEC = 0, |
---|
| 82 | + IWPM_NLA_RMANAGE_MAPPING_SEQ, |
---|
| 83 | + IWPM_NLA_RMANAGE_ADDR, |
---|
| 84 | + IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR, |
---|
| 85 | + /* The following maintains bisectability of rdma-core */ |
---|
| 86 | + IWPM_NLA_MANAGE_MAPPED_LOC_ADDR = IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR, |
---|
87 | 87 | IWPM_NLA_RMANAGE_MAPPING_ERR, |
---|
88 | 88 | IWPM_NLA_RMANAGE_MAPPING_MAX |
---|
89 | 89 | }; |
---|
90 | 90 | |
---|
91 | | -#define IWPM_NLA_MANAGE_MAPPING_MAX 3 |
---|
92 | | -#define IWPM_NLA_QUERY_MAPPING_MAX 4 |
---|
93 | 91 | #define IWPM_NLA_MAPINFO_SEND_MAX 3 |
---|
| 92 | +#define IWPM_NLA_REMOVE_MAPPING_MAX 3 |
---|
94 | 93 | |
---|
95 | 94 | enum { |
---|
96 | 95 | IWPM_NLA_QUERY_MAPPING_UNSPEC = 0, |
---|
97 | 96 | IWPM_NLA_QUERY_MAPPING_SEQ, |
---|
98 | 97 | IWPM_NLA_QUERY_LOCAL_ADDR, |
---|
99 | 98 | IWPM_NLA_QUERY_REMOTE_ADDR, |
---|
| 99 | + IWPM_NLA_QUERY_FLAGS, |
---|
| 100 | + IWPM_NLA_QUERY_MAPPING_MAX, |
---|
| 101 | +}; |
---|
| 102 | + |
---|
| 103 | +enum { |
---|
| 104 | + IWPM_NLA_RQUERY_MAPPING_UNSPEC = 0, |
---|
| 105 | + IWPM_NLA_RQUERY_MAPPING_SEQ, |
---|
| 106 | + IWPM_NLA_RQUERY_LOCAL_ADDR, |
---|
| 107 | + IWPM_NLA_RQUERY_REMOTE_ADDR, |
---|
100 | 108 | IWPM_NLA_RQUERY_MAPPED_LOC_ADDR, |
---|
101 | 109 | IWPM_NLA_RQUERY_MAPPED_REM_ADDR, |
---|
102 | 110 | IWPM_NLA_RQUERY_MAPPING_ERR, |
---|
.. | .. |
---|
114 | 122 | IWPM_NLA_MAPINFO_UNSPEC = 0, |
---|
115 | 123 | IWPM_NLA_MAPINFO_LOCAL_ADDR, |
---|
116 | 124 | IWPM_NLA_MAPINFO_MAPPED_ADDR, |
---|
| 125 | + IWPM_NLA_MAPINFO_FLAGS, |
---|
117 | 126 | IWPM_NLA_MAPINFO_MAX |
---|
118 | 127 | }; |
---|
119 | 128 | |
---|
.. | .. |
---|
130 | 139 | IWPM_NLA_ERR_SEQ, |
---|
131 | 140 | IWPM_NLA_ERR_CODE, |
---|
132 | 141 | IWPM_NLA_ERR_MAX |
---|
| 142 | +}; |
---|
| 143 | + |
---|
| 144 | +enum { |
---|
| 145 | + IWPM_NLA_HELLO_UNSPEC = 0, |
---|
| 146 | + IWPM_NLA_HELLO_ABI_VERSION, |
---|
| 147 | + IWPM_NLA_HELLO_MAX |
---|
| 148 | +}; |
---|
| 149 | + |
---|
| 150 | +/* For RDMA_NLDEV_ATTR_DEV_NODE_TYPE */ |
---|
| 151 | +enum { |
---|
| 152 | + /* IB values map to NodeInfo:NodeType. */ |
---|
| 153 | + RDMA_NODE_IB_CA = 1, |
---|
| 154 | + RDMA_NODE_IB_SWITCH, |
---|
| 155 | + RDMA_NODE_IB_ROUTER, |
---|
| 156 | + RDMA_NODE_RNIC, |
---|
| 157 | + RDMA_NODE_USNIC, |
---|
| 158 | + RDMA_NODE_USNIC_UDP, |
---|
| 159 | + RDMA_NODE_UNSPECIFIED, |
---|
133 | 160 | }; |
---|
134 | 161 | |
---|
135 | 162 | /* |
---|
.. | .. |
---|
227 | 254 | RDMA_NLDEV_CMD_UNSPEC, |
---|
228 | 255 | |
---|
229 | 256 | RDMA_NLDEV_CMD_GET, /* can dump */ |
---|
| 257 | + RDMA_NLDEV_CMD_SET, |
---|
230 | 258 | |
---|
231 | | - /* 2 - 4 are free to use */ |
---|
| 259 | + RDMA_NLDEV_CMD_NEWLINK, |
---|
232 | 260 | |
---|
233 | | - RDMA_NLDEV_CMD_PORT_GET = 5, /* can dump */ |
---|
| 261 | + RDMA_NLDEV_CMD_DELLINK, |
---|
234 | 262 | |
---|
235 | | - /* 6 - 8 are free to use */ |
---|
| 263 | + RDMA_NLDEV_CMD_PORT_GET, /* can dump */ |
---|
| 264 | + |
---|
| 265 | + RDMA_NLDEV_CMD_SYS_GET, |
---|
| 266 | + RDMA_NLDEV_CMD_SYS_SET, |
---|
| 267 | + |
---|
| 268 | + /* 8 is free to use */ |
---|
236 | 269 | |
---|
237 | 270 | RDMA_NLDEV_CMD_RES_GET = 9, /* can dump */ |
---|
238 | 271 | |
---|
.. | .. |
---|
246 | 279 | |
---|
247 | 280 | RDMA_NLDEV_CMD_RES_PD_GET, /* can dump */ |
---|
248 | 281 | |
---|
249 | | - RDMA_NLDEV_NUM_OPS |
---|
250 | | -}; |
---|
| 282 | + RDMA_NLDEV_CMD_GET_CHARDEV, |
---|
251 | 283 | |
---|
252 | | -enum { |
---|
253 | | - RDMA_NLDEV_ATTR_ENTRY_STRLEN = 16, |
---|
| 284 | + RDMA_NLDEV_CMD_STAT_SET, |
---|
| 285 | + |
---|
| 286 | + RDMA_NLDEV_CMD_STAT_GET, /* can dump */ |
---|
| 287 | + |
---|
| 288 | + RDMA_NLDEV_CMD_STAT_DEL, |
---|
| 289 | + |
---|
| 290 | + RDMA_NLDEV_CMD_RES_QP_GET_RAW, |
---|
| 291 | + |
---|
| 292 | + RDMA_NLDEV_CMD_RES_CQ_GET_RAW, |
---|
| 293 | + |
---|
| 294 | + RDMA_NLDEV_CMD_RES_MR_GET_RAW, |
---|
| 295 | + |
---|
| 296 | + RDMA_NLDEV_NUM_OPS |
---|
254 | 297 | }; |
---|
255 | 298 | |
---|
256 | 299 | enum rdma_nldev_print_type { |
---|
.. | .. |
---|
282 | 325 | |
---|
283 | 326 | /* |
---|
284 | 327 | * Device and port capabilities |
---|
| 328 | + * |
---|
| 329 | + * When used for port info, first 32-bits are CapabilityMask followed by |
---|
| 330 | + * 16-bit CapabilityMask2. |
---|
285 | 331 | */ |
---|
286 | 332 | RDMA_NLDEV_ATTR_CAP_FLAGS, /* u64 */ |
---|
287 | 333 | |
---|
.. | .. |
---|
427 | 473 | RDMA_NLDEV_ATTR_DRIVER_U64, /* u64 */ |
---|
428 | 474 | |
---|
429 | 475 | /* |
---|
| 476 | + * Indexes to get/set secific entry, |
---|
| 477 | + * for QP use RDMA_NLDEV_ATTR_RES_LQPN |
---|
| 478 | + */ |
---|
| 479 | + RDMA_NLDEV_ATTR_RES_PDN, /* u32 */ |
---|
| 480 | + RDMA_NLDEV_ATTR_RES_CQN, /* u32 */ |
---|
| 481 | + RDMA_NLDEV_ATTR_RES_MRN, /* u32 */ |
---|
| 482 | + RDMA_NLDEV_ATTR_RES_CM_IDN, /* u32 */ |
---|
| 483 | + RDMA_NLDEV_ATTR_RES_CTXN, /* u32 */ |
---|
| 484 | + /* |
---|
| 485 | + * Identifies the rdma driver. eg: "rxe" or "siw" |
---|
| 486 | + */ |
---|
| 487 | + RDMA_NLDEV_ATTR_LINK_TYPE, /* string */ |
---|
| 488 | + |
---|
| 489 | + /* |
---|
| 490 | + * net namespace mode for rdma subsystem: |
---|
| 491 | + * either shared or exclusive among multiple net namespaces. |
---|
| 492 | + */ |
---|
| 493 | + RDMA_NLDEV_SYS_ATTR_NETNS_MODE, /* u8 */ |
---|
| 494 | + /* |
---|
| 495 | + * Device protocol, e.g. ib, iw, usnic, roce and opa |
---|
| 496 | + */ |
---|
| 497 | + RDMA_NLDEV_ATTR_DEV_PROTOCOL, /* string */ |
---|
| 498 | + |
---|
| 499 | + /* |
---|
| 500 | + * File descriptor handle of the net namespace object |
---|
| 501 | + */ |
---|
| 502 | + RDMA_NLDEV_NET_NS_FD, /* u32 */ |
---|
| 503 | + /* |
---|
| 504 | + * Information about a chardev. |
---|
| 505 | + * CHARDEV_TYPE is the name of the chardev ABI (ie uverbs, umad, etc) |
---|
| 506 | + * CHARDEV_ABI signals the ABI revision (historical) |
---|
| 507 | + * CHARDEV_NAME is the kernel name for the /dev/ file (no directory) |
---|
| 508 | + * CHARDEV is the 64 bit dev_t for the inode |
---|
| 509 | + */ |
---|
| 510 | + RDMA_NLDEV_ATTR_CHARDEV_TYPE, /* string */ |
---|
| 511 | + RDMA_NLDEV_ATTR_CHARDEV_NAME, /* string */ |
---|
| 512 | + RDMA_NLDEV_ATTR_CHARDEV_ABI, /* u64 */ |
---|
| 513 | + RDMA_NLDEV_ATTR_CHARDEV, /* u64 */ |
---|
| 514 | + RDMA_NLDEV_ATTR_UVERBS_DRIVER_ID, /* u64 */ |
---|
| 515 | + /* |
---|
| 516 | + * Counter-specific attributes. |
---|
| 517 | + */ |
---|
| 518 | + RDMA_NLDEV_ATTR_STAT_MODE, /* u32 */ |
---|
| 519 | + RDMA_NLDEV_ATTR_STAT_RES, /* u32 */ |
---|
| 520 | + RDMA_NLDEV_ATTR_STAT_AUTO_MODE_MASK, /* u32 */ |
---|
| 521 | + RDMA_NLDEV_ATTR_STAT_COUNTER, /* nested table */ |
---|
| 522 | + RDMA_NLDEV_ATTR_STAT_COUNTER_ENTRY, /* nested table */ |
---|
| 523 | + RDMA_NLDEV_ATTR_STAT_COUNTER_ID, /* u32 */ |
---|
| 524 | + RDMA_NLDEV_ATTR_STAT_HWCOUNTERS, /* nested table */ |
---|
| 525 | + RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY, /* nested table */ |
---|
| 526 | + RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_NAME, /* string */ |
---|
| 527 | + RDMA_NLDEV_ATTR_STAT_HWCOUNTER_ENTRY_VALUE, /* u64 */ |
---|
| 528 | + |
---|
| 529 | + /* |
---|
| 530 | + * CQ adaptive moderatio (DIM) |
---|
| 531 | + */ |
---|
| 532 | + RDMA_NLDEV_ATTR_DEV_DIM, /* u8 */ |
---|
| 533 | + |
---|
| 534 | + RDMA_NLDEV_ATTR_RES_RAW, /* binary */ |
---|
| 535 | + |
---|
| 536 | + /* |
---|
430 | 537 | * Always the end |
---|
431 | 538 | */ |
---|
432 | 539 | RDMA_NLDEV_ATTR_MAX |
---|
433 | 540 | }; |
---|
| 541 | + |
---|
| 542 | +/* |
---|
| 543 | + * Supported counter bind modes. All modes are mutual-exclusive. |
---|
| 544 | + */ |
---|
| 545 | +enum rdma_nl_counter_mode { |
---|
| 546 | + RDMA_COUNTER_MODE_NONE, |
---|
| 547 | + |
---|
| 548 | + /* |
---|
| 549 | + * A qp is bound with a counter automatically during initialization |
---|
| 550 | + * based on the auto mode (e.g., qp type, ...) |
---|
| 551 | + */ |
---|
| 552 | + RDMA_COUNTER_MODE_AUTO, |
---|
| 553 | + |
---|
| 554 | + /* |
---|
| 555 | + * Which qp are bound with which counter is explicitly specified |
---|
| 556 | + * by the user |
---|
| 557 | + */ |
---|
| 558 | + RDMA_COUNTER_MODE_MANUAL, |
---|
| 559 | + |
---|
| 560 | + /* |
---|
| 561 | + * Always the end |
---|
| 562 | + */ |
---|
| 563 | + RDMA_COUNTER_MODE_MAX, |
---|
| 564 | +}; |
---|
| 565 | + |
---|
| 566 | +/* |
---|
| 567 | + * Supported criteria in counter auto mode. |
---|
| 568 | + * Currently only "qp type" is supported |
---|
| 569 | + */ |
---|
| 570 | +enum rdma_nl_counter_mask { |
---|
| 571 | + RDMA_COUNTER_MASK_QP_TYPE = 1, |
---|
| 572 | + RDMA_COUNTER_MASK_PID = 1 << 1, |
---|
| 573 | +}; |
---|
434 | 574 | #endif /* _UAPI_RDMA_NETLINK_H */ |
---|