logo资料库

RDMA_Aware_Programming_user_manual.pdf

第1页 / 共216页
第2页 / 共216页
第3页 / 共216页
第4页 / 共216页
第5页 / 共216页
第6页 / 共216页
第7页 / 共216页
第8页 / 共216页
资料共216页,剩余部分请下载后查看
RDMA Aware Networks Programming User Manual
Table of Contents
Revision History
Glossary
1 RDMA Architecture Overview
1.1 InfiniBand
1.2 Virtual Protocol Interconnect® (VPI)
1.3 RDMA over Converged Ethernet (RoCE)
1.4 Comparison of RDMA Technologies
1.5 Key Components
1.6 Support for Existing Applications and ULPs
1.7 References
2 RDMA-Aware Programming Overview
2.1 Available Communication Operations
2.1.1 Send/Send With Immediate
2.1.2 Receive
2.1.3 RDMA Read
2.1.4 RDMA Write / RDMA Write With Immediate
2.1.5 Atomic Fetch and Add / Atomic Compare and Swap
2.2 Transport Modes
2.2.1 Reliable Connection (RC)
2.2.2 Unreliable Connection (UC)
2.2.3 Unreliable Datagram (UD)
2.3 Key Concepts
2.3.1 Send Request (SR)
2.3.2 Receive Request (RR)
2.3.3 Completion Queue
2.3.4 Memory Registration
2.3.5 Memory Window
2.3.6 Address Vector
2.3.7 Global Routing Header (GRH)
2.3.8 Protection Domain
2.3.9 Asynchronous Events
2.3.10 Scatter Gather
2.3.11 Polling
2.4 Typical Application
3 VPI Verbs API
3.1 Initialization
3.1.1 ibv_fork_init
3.2 Device Operations
3.2.1 ibv_get_device_list
3.2.2 ibv_free_device_list
3.2.3 ibv_get_device_name
3.2.4 ibv_get_device_guid
3.2.5 ibv_open_device
3.2.6 ibv_close_device
3.2.7 ibv_node_type_str
3.2.8 ibv_port_state_str
3.3 Verb Context Operations
3.3.1 ibv_query_device
3.3.2 ibv_query_port
3.3.3 ibv_query_gid
3.3.4 ibv_query_pkey
3.3.5 ibv_alloc_pd
3.3.6 ibv_dealloc_pd
3.3.7 ibv_create_cq
3.3.8 ibv_resize_cq
3.3.9 ibv_destroy_cq
3.3.10 ibv_create_comp_channel
3.3.11 ibv_destroy_comp_channel
3.4 Protection Domain Operations
3.4.1 ibv_reg_mr
3.4.2 ibv_dereg_mr
3.4.3 ibv_create_qp
3.4.4 ibv_destroy_qp
3.4.5 ibv_create_srq
3.4.6 ibv_modify_srq
3.4.7 ibv_destroy_srq
3.4.8 ibv_open_xrc_domain
3.4.9 ibv_create_xrc_srq
3.4.10 ibv_close_xrc_domain
3.4.11 ibv_create_xrc_rcv_qp
3.4.12 ibv_modify_xrc_rcv_qp
3.4.13 ibv_reg_xrc_rcv_qp
3.4.14 ibv_unreg_xrc_rcv_qp
3.4.15 ibv_create_ah
3.4.16 ibv_destroy_ah
3.5 Queue Pair Bringup (ibv_modify_qp)
3.5.1 ibv_modify_qp
3.5.2 RESET to INIT
3.5.3 INIT to RTR
3.5.4 RTR to RTS
3.6 Active Queue Pair Operations
3.6.1 ibv_query_qp
3.6.2 ibv_query_srq
3.6.3 ibv_query_xrc_rcv_qp
3.6.4 ibv_post_recv
3.6.5 ibv_post_send
3.6.6 ibv_post_srq_recv
3.6.7 ibv_req_notify_cq
3.6.8 ibv_get_cq_event
3.6.9 ibv_ack_cq_events
3.6.10 ibv_poll_cq
3.6.11 ibv_init_ah_from_wc
3.6.12 ibv_create_ah_from_wc
3.6.13 ibv_attach_mcast
3.6.14 ibv_detach_mcast
3.7 Event Handling Operations
3.7.1 ibv_get_async_event
3.7.2 ib_ack_async_event
3.7.3 ibv_event_type_str
3.8 Experimental APIs
3.8.1 ibv_exp_query_device
3.8.2 ibv_exp_create_qp
3.8.3 ibv_exp_post_send
4 RDMA_CM API
4.1 Event Channel Operations
4.1.1 rdma_create_event_channel
4.1.2 rdma_destroy_event_channel
4.2 Connection Manager (CM) ID Operations
4.2.1 rdma_create_id
4.2.2 rdma_destroy_id
4.2.3 rdma_migrate_id
4.2.4 rdma_set_option
4.2.5 rdma_create_ep
4.2.6 rdma_destroy_ep
4.2.7 rdma_resolve_addr
4.2.8 rdma_bind_addr
4.2.9 rdma_resolve_route
4.2.10 rdma_listen
4.2.11 rdma_connect
4.2.12 rdma_get_request
4.2.13 rdma_accept
4.2.14 rdma_reject
4.2.15 rdma_notify
4.2.16 rdma_disconnect
4.2.17 rdma_get_src_port
4.2.18 rdma_get_dst_port
4.2.19 rdma_get_local_addr
4.2.20 rdma_get_peer_addr
4.2.21 rdma_get_devices
4.2.22 rdma_free_devices
4.2.23 rdma_getaddrinfo
4.2.24 rdma_freeaddrinfo
4.2.25 rdma_create_qp
4.2.26 rdma_destroy_qp
4.2.27 rdma_join_multicast
4.2.28 rdma_leave_multicast
4.3 Event Handling Operations
4.3.1 rdma_get_cm_event
4.3.2 rdma_ack_cm_event
4.3.3 rdma_event_str
5 RDMA Verbs API
5.1 Protection Domain Operations
5.1.1 rdma_reg_msgs
5.1.2 rdma_reg_read
5.1.3 rdma_reg_write
5.1.4 rdma_dereg_mr
5.1.5 rdma_create_srq
5.1.6 rdma_destroy_srq
5.2 Active Queue Pair Operations
5.2.1 rdma_post_recvv
5.2.2 rdma_post_sendv
5.2.3 rdma_post_readv
5.2.4 rdma_post_writev
5.2.5 rdma_post_recv
5.2.6 rdma_post_send
5.2.7 rdma_post_read
5.2.8 rdma_post_write
5.2.9 rdma_post_ud_send
5.2.10 rdma_get_send_comp
5.2.11 rdma_get_recv_comp
6 Events
6.1 IBV Events
6.1.1 IBV_EVENT_CQ_ERR
6.1.2 IBV_EVENT_QP_FATAL
6.1.3 IBV_EVENT_QP_REQ_ERR
6.1.4 IBV_EVENT_QP_ACCESS_ERR
6.1.5 IBV_EVENT_COMM_EST
6.1.6 IBV_EVENT_SQ_DRAINED
6.1.7 IBV_EVENT_PATH_MIG
6.1.8 IBV_EVENT_PATH_MIG_ERR
6.1.9 IBV_EVENT_DEVICE_FATAL
6.1.10 IBV_EVENT_PORT_ACTIVE
6.1.11 IBV_EVENT_PORT_ERR
6.1.12 IBV_EVENT_LID_CHANGE
6.1.13 IBV_EVENT_PKEY_CHANGE
6.1.14 IBV_EVENT_SM_CHANGE
6.1.15 IBV_EVENT_SRQ_ERR
6.1.16 IBV_EVENT_SRQ_LIMIT_REACHED
6.1.17 IBV_EVENT_QP_LAST_WQE_REACHED
6.1.18 IBV_EVENT_CLIENT_REREGISTER
6.1.19 IBV_EVENT_GID_CHANGE
6.2 IBV WC Events
6.2.1 IBV_WC_SUCCESS
6.2.2 IBV_WC_LOC_LEN_ERR
6.2.3 IBV_WC_LOC_QP_OP_ERR
6.2.4 IBV_WC_LOC_EEC_OP_ERR
6.2.5 IBV_WC_LOC_PROT_ERR
6.2.6 IBV_WC_WR_FLUSH_ERR
6.2.7 IBV_WC_MW_BIND_ERR
6.2.8 IBV_WC_BAD_RESP_ERR
6.2.9 IBV_WC_LOC_ACCESS_ERR
6.2.10 IBV_WC_REM_INV_REQ_ERR
6.2.11 IBV_WC_REM_ACCESS_ERR
6.2.12 IBV_WC_REM_OP_ERR
6.2.13 IBV_WC_RETRY_EXC_ERR
6.2.14 IBV_WC_RNR_RETRY_EXC_ERR
6.2.15 IBV_WC_LOC_RDD_VIOL_ERR
6.2.16 IBV_WC_REM_INV_RD_REQ_ERR
6.2.17 IBV_WC_REM_ABORT_ERR
6.2.18 IBV_WC_INV_EECN_ERR
6.2.19 IBV_WC_INV_EEC_STATE_ERR
6.2.20 IBV_WC_FATAL_ERR
6.2.21 IBV_WC_RESP_TIMEOUT_ERR
6.2.22 IBV_WC_GENERAL_ERR
6.3 RDMA_CM Events
6.3.1 RDMA_CM_EVENT_ADDR_RESOLVED
6.3.2 RDMA_CM_EVENT_ADDR_ERROR
6.3.3 RDMA_CM_EVENT_ROUTE_RESOLVED
6.3.4 RDMA_CM_EVENT_ROUTE_ERROR
6.3.5 RDMA_CM_EVENT_CONNECT_REQUEST
6.3.6 RDMA_CM_EVENT_CONNECT_RESPONSE
6.3.7 RDMA_CM_EVENT_CONNECT_ERROR
6.3.8 RDMA_CM_EVENT_UNREACHABLE
6.3.9 RDMA_CM_EVENT_REJECTED
6.3.10 RDMA_CM_EVENT_ESTABLISHED
6.3.11 RDMA_CM_EVENT_DISCONNECTED
6.3.12 RDMA_CM_EVENT_DEVICE_REMOVAL
6.3.13 RDMA_CM_EVENT_MULTICAST_JOIN
6.3.14 RDMA_CM_EVENT_MULTICAST_ERROR
6.3.15 RDMA_CM_EVENT_ADDR_CHANGE
6.3.16 RDMA_CM_EVENT_TIMEWAIT_EXIT
7 Programming Examples Using IBV Verbs
7.1 Synopsis for RDMA_RC Example Using IBV Verbs
7.1.1 Main
7.1.2 print_config
7.1.3 resources_init
7.1.4 resources_create
7.1.5 sock_connect
7.1.6 connect_qp
7.1.7 modify_qp_to_init
7.1.8 post_receive
7.1.9 sock_sync_data
7.1.10 modify_qp_to_rtr
7.1.11 modify_qp_to_rts
7.1.12 post_send
7.1.13 poll_completion
7.1.14 resources_destroy
7.2 Code for Send, Receive, RDMA Read, RDMA Write
7.3 Synopsis for Multicast Example Using RDMA_CM and IBV Verbs
7.3.1 Main
7.3.2 Run
7.4 Code for Multicast Using RDMA_CM and IBV Verbs
8 Programming Examples Using RDMA Verbs
8.1 Automatic Path Migration (APM)
8.2 Multicast Code Example Using RDMA CM
8.3 Shared Received Queue (SRQ)
Appendix A: Experimental APIs
A.1 Dynamically Connected Transport
Appendix B: Verbs API for Extended Atomics Support
B.1 Supported Hardware
B.2 Verbs Interface Changes
Appendix C: User-Mode Memory Registration (UMR)
C.1 Interfaces
Appendix D: Cross-Channel Communications Support
D.1 Usage Model
D.2 Resource Initialization
D.3 Posting Request List
RDMA Aware Networks Programming User Manual Rev 1.7 www.mellanox.com
Rev 1.7 NOTE: NOTE: THIS HARDWARE, SOFTWARE OR TEST SUITE PRODUCT (“PRODUCT(S)”) AND ITS RELATED THIS HARDWARE, SOFTWARE OR TEST SUITE PRODUCT (“PRODUCT(S)”) AND ITS RELATED DOCUMENTATION ARE PROVIDED BY MELLANOX TECHNOLOGIES “AS-IS” WITH ALL FAULTS OF ANY DOCUMENTATION ARE PROVIDED BY MELLANOX TECHNOLOGIES “AS-IS” WITH ALL FAULTS OF ANY KIND AND SOLELY FOR THE PURPOSE OF AIDING THE CUSTOMER IN TESTING APPLICATIONS THAT USE KIND AND SOLELY FOR THE PURPOSE OF AIDING THE CUSTOMER IN TESTING APPLICATIONS THAT USE THE PRODUCTS IN DESIGNATED SOLUTIONS. THE CUSTOMER'S MANUFACTURING TEST ENVIRONMENT THE PRODUCTS IN DESIGNATED SOLUTIONS. THE CUSTOMER'S MANUFACTURING TEST ENVIRONMENT HAS NOT MET THE STANDARDS SET BY MELLANOX TECHNOLOGIES TO FULLY QUALIFY THE PRODUCT(S) HAS NOT MET THE STANDARDS SET BY MELLANOX TECHNOLOGIES TO FULLY QUALIFY THE AND/OR THE SYSTEM USING IT. THEREFORE, MELLANOX TECHNOLOGIES CANNOT AND DOES NOT PRODUCTO(S) AND/OR THE SYSTEM USING IT. THEREFORE, MELLANOX TECHNOLOGIES CANNOT AND GUARANTEE OR WARRANT THAT THE PRODUCTS WILL OPERATE WITH THE HIGHEST QUALITY. ANY DOES NOT GUARANTEE OR WARRANT THAT THE PRODUCTS WILL OPERATE WITH THE HIGHEST EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF QUALITY. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT ARE DISCLAIMED. WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL MELLANOX BE LIABLE TO CUSTOMER OR ANY THIRD PARTIES FOR ANY DIRECT, ARE DISCLAIMED. IN NO EVENT SHALL MELLANOX BE LIABLE TO CUSTOMER OR ANY THIRD PARTIES INDIRECT, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES OF ANY KIND (INCLUDING, BUT NOT FOR ANY DIRECT, INDIRECT, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES OF ANY KIND LIMITED TO, PAYMENT FOR PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, (INCLUDING, BUT NOT LIMITED TO, PAYMENT FOR PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE ARISING IN ANY WAY FROM THE USE OF THE PRODUCT(S) AND RELATED DOCUMENTATION EVEN IF OR OTHERWISE) ARISING IN ANY WAY FROM THE USE OF THE PRODUCT(S) AND RELATED ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. DOCUMENTATION EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Mellanox Technologies Mellanox Technologies 350 Oakmead Parkway Suite 100 350 Oakmead Parkway Suite 100 Sunnyvale, CA 94085 Sunnyvale, CA 94085 U.S.A. U.S.A. www.mellanox.com www.mellanox.com Tel: (408) 970-3400 Tel: (408) 970-3400 Fax: (408) 970-3403 Fax: (408) 970-3403 Mellanox Technologies, Ltd. Mellanox Technologies, Ltd. Hakidma 26 Beit Mellanox Ofer Industrial Park PO Box 586 Yokneam 20692 Yokneam 2069200 Israel Israel www.mellanox.com www.mellanox.com Tel: +972 (0)74 723 7200 Tel: +972 (0)74 723 7200 Fax: +972 (0)4 959 3245 Fax: +972 (0)4 959 3245 © Copyright 2015. Mellanox Technologies. All Rights Reserved. Mellanox®, Mellanox logo, BridgeX®, ConnectX®, Connect-IB®, CoolBox®, CORE-Direct®, GPUDirect®, InfiniBridge®, © Copyright 2013. Mellanox Technologies. All Rights Reserved. InfiniHost®, InfiniScale®, Kotura®, Kotura logo, MetroX®, MLNX-OS®, PhyX®, ScalableHPC®, SwitchX®, TestX®, UFM®, Virtual Protocol Interconnect®, Voltaire® and Voltaire logo are registered trademarks of Mellanox Technologies, Ltd. Mellanox®, Mellanox logo, BridgeX®, ConnectX®, CORE-Direct®, InfiniBridge®, InfiniHost®, InfiniScale®, PhyX®, SwitchX®, Virtual Protocol Interconnect® and Voltaire® are registered trademarks of Mellanox Technologies, Ltd. CyPU™, ExtendX™, FabricIT™, FPGADirect™, HPC-X™, Mellanox Care™, Mellanox CloudX™, Mellanox Open Ethernet™, Mellanox PeerDirect™, Mellanox Virtual Modular Switch™, MetroDX™, NVMeDirect™, StPU™, Connect-IB™, FabricIT™, MLNX-OS™, MetroX™, ScalableHPC™, Unbreakable-Link™, UFM™ and Unified Fabric Switch-IB™, Unbreakable-Link™ are trademarks of Mellanox Technologies, Ltd. Manager™ are trademarks of Mellanox Technologies, Ltd. All other trademarks are property of their respective owners. All other trademarks are property of their respective owners. 2 Mellanox Technologies Document Number:
Table of Contents Rev 1.7 Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Chapter 1 RDMA Architecture Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.1 InfiniBand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.2 Virtual Protocol Interconnect® (VPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.3 RDMA over Converged Ethernet (RoCE). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.4 Comparison of RDMA Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.5 Key Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.6 Support for Existing Applications and ULPs . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.7 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Chapter 2 RDMA-Aware Programming Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1 Available Communication Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.1 Send/Send With Immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.2 Receive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.3 RDMA Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.1.4 RDMA Write / RDMA Write With Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.1.5 Atomic Fetch and Add / Atomic Compare and Swap. . . . . . . . . . . . . . . . . . . . . . 20 2.2 Transport Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.1 Reliable Connection (RC). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.2 Unreliable Connection (UC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.2.3 Unreliable Datagram (UD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.3 Key Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3.1 Send Request (SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3.2 Receive Request (RR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3.3 Completion Queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3.4 Memory Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3.5 Memory Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.3.6 Address Vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.3.7 Global Routing Header (GRH) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.3.8 Protection Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.3.9 Asynchronous Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.3.10 Scatter Gather . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.3.11 Polling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.4 Typical Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Chapter 3 VPI Verbs API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Initialization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.1.1 ibv_fork_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.2 Device Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 ibv_get_device_list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 ibv_free_device_list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 ibv_get_device_name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.2.1 3.2.2 3.2.3 3.1 Mellanox Technologies 3
Rev 1.7 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 ibv_get_device_guid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 ibv_open_device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ibv_close_device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ibv_node_type_str. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ibv_port_state_str . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.3 Verb Context Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 ibv_query_device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.3.1 ibv_query_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.3.2 ibv_query_gid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.3.3 ibv_query_pkey. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.3.4 ibv_alloc_pd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.3.5 ibv_dealloc_pd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.3.6 ibv_create_cq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.3.7 ibv_resize_cq. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.3.8 3.3.9 ibv_destroy_cq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.3.10 ibv_create_comp_channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.3.11 ibv_destroy_comp_channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.4 Protection Domain Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 ibv_reg_mr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 3.4.1 ibv_dereg_mr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.4.2 ibv_create_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.4.3 ibv_destroy_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.4.4 ibv_create_srq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.4.5 ibv_modify_srq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 3.4.6 ibv_destroy_srq. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.4.7 ibv_open_xrc_domain. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.4.8 3.4.9 ibv_create_xrc_srq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.4.10 ibv_close_xrc_domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.4.11 ibv_create_xrc_rcv_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.4.12 ibv_modify_xrc_rcv_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.4.13 ibv_reg_xrc_rcv_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 3.4.14 ibv_unreg_xrc_rcv_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 3.4.15 ibv_create_ah . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 3.4.16 ibv_destroy_ah . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 3.5 Queue Pair Bringup (ibv_modify_qp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 3.5.1 ibv_modify_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 3.5.2 RESET to INIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 3.5.3 INIT to RTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 3.5.4 RTR to RTS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.6 Active Queue Pair Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 ibv_query_qp. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 ibv_query_srq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 ibv_query_xrc_rcv_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 ibv_post_recv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 ibv_post_send . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 ibv_post_srq_recv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 4 Mellanox Technologies
Rev 1.7 3.8.1 3.8.2 3.8.3 3.7.1 3.7.2 3.7.3 ibv_req_notify_cq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.6.7 ibv_get_cq_event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.6.8 ibv_ack_cq_events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 3.6.9 3.6.10 ibv_poll_cq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.6.11 ibv_init_ah_from_wc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 3.6.12 ibv_create_ah_from_wc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.6.13 ibv_attach_mcast. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 3.6.14 ibv_detach_mcast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 3.7 Event Handling Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 ibv_get_async_event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 ib_ack_async_event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 ibv_event_type_str . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 3.8 Experimental APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 ibv_exp_query_device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 ibv_exp_create_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 ibv_exp_post_send . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Chapter 4 RDMA_CM API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.1 Event Channel Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.1.1 rdma_create_event_channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.1.2 rdma_destroy_event_channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.2 Connection Manager (CM) ID Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4.2.1 rdma_create_id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4.2.2 rdma_destroy_id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4.2.3 rdma_migrate_id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 4.2.4 rdma_set_option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 4.2.5 rdma_create_ep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.2.6 rdma_destroy_ep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 4.2.7 rdma_resolve_addr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 4.2.8 rdma_bind_addr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.2.9 rdma_resolve_route. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 4.2.10 rdma_listen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 4.2.11 rdma_connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 4.2.12 rdma_get_request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 4.2.13 rdma_accept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.2.14 rdma_reject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.2.15 rdma_notify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.2.16 rdma_disconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.2.17 rdma_get_src_port. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 4.2.18 rdma_get_dst_port. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 4.2.19 rdma_get_local_addr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 4.2.20 rdma_get_peer_addr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.2.21 rdma_get_devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 4.2.22 rdma_free_devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 4.2.23 rdma_getaddrinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 4.2.24 rdma_freeaddrinfo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 4.2.25 rdma_create_qp. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Mellanox Technologies 5
Rev 1.7 4.2.26 rdma_destroy_qp. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.2.27 rdma_join_multicast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.2.28 rdma_leave_multicast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.3 Event Handling Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.3.1 rdma_get_cm_event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 4.3.2 rdma_ack_cm_event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 4.3.3 rdma_event_str . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Chapter 5 RDMA Verbs API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 5.1 Protection Domain Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 5.1.1 rdma_reg_msgs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 5.1.2 rdma_reg_read. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 5.1.3 rdma_reg_write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 5.1.4 rdma_dereg_mr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 5.1.5 rdma_create_srq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 5.1.6 rdma_destroy_srq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 5.2 Active Queue Pair Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 5.2.1 rdma_post_recvv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 5.2.2 rdma_post_sendv. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 5.2.3 rdma_post_readv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 5.2.4 rdma_post_writev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 5.2.5 rdma_post_recv. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 5.2.6 rdma_post_send. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 5.2.7 rdma_post_read. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 5.2.8 rdma_post_write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 5.2.9 rdma_post_ud_send. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 5.2.10 rdma_get_send_comp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 5.2.11 rdma_get_recv_comp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Chapter 6 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 IBV Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 6.1.1 IBV_EVENT_CQ_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 6.1.2 IBV_EVENT_QP_FATAL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 6.1.3 IBV_EVENT_QP_REQ_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 6.1.4 IBV_EVENT_QP_ACCESS_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 6.1.5 IBV_EVENT_COMM_EST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 6.1.6 IBV_EVENT_SQ_DRAINED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 6.1.7 IBV_EVENT_PATH_MIG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 6.1.8 IBV_EVENT_PATH_MIG_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 6.1.9 IBV_EVENT_DEVICE_FATAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 6.1.10 IBV_EVENT_PORT_ACTIVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 6.1.11 IBV_EVENT_PORT_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 6.1.12 IBV_EVENT_LID_CHANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 6.1.13 IBV_EVENT_PKEY_CHANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 6.1.14 IBV_EVENT_SM_CHANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6.1.15 IBV_EVENT_SRQ_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6.1.16 IBV_EVENT_SRQ_LIMIT_REACHED. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6.1 6 Mellanox Technologies
Rev 1.7 6.2 6.1.17 IBV_EVENT_QP_LAST_WQE_REACHED . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6.1.18 IBV_EVENT_CLIENT_REREGISTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6.1.19 IBV_EVENT_GID_CHANGE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 IBV WC Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.2.1 IBV_WC_SUCCESS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.2.2 IBV_WC_LOC_LEN_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.2.3 IBV_WC_LOC_QP_OP_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.2.4 IBV_WC_LOC_EEC_OP_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.2.5 IBV_WC_LOC_PROT_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.2.6 IBV_WC_WR_FLUSH_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.2.7 IBV_WC_MW_BIND_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.2.8 IBV_WC_BAD_RESP_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.2.9 IBV_WC_LOC_ACCESS_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.10 IBV_WC_REM_INV_REQ_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.11 IBV_WC_REM_ACCESS_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.12 IBV_WC_REM_OP_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.13 IBV_WC_RETRY_EXC_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.14 IBV_WC_RNR_RETRY_EXC_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.15 IBV_WC_LOC_RDD_VIOL_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.16 IBV_WC_REM_INV_RD_REQ_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.17 IBV_WC_REM_ABORT_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.18 IBV_WC_INV_EECN_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2.19 IBV_WC_INV_EEC_STATE_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.2.20 IBV_WC_FATAL_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.2.21 IBV_WC_RESP_TIMEOUT_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.2.22 IBV_WC_GENERAL_ERR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.3 RDMA_CM Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.3.1 RDMA_CM_EVENT_ADDR_RESOLVED . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.3.2 RDMA_CM_EVENT_ADDR_ERROR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.3.3 RDMA_CM_EVENT_ROUTE_RESOLVED . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.3.4 RDMA_CM_EVENT_ROUTE_ERROR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 6.3.5 RDMA_CM_EVENT_CONNECT_REQUEST. . . . . . . . . . . . . . . . . . . . . . . . . 116 6.3.6 RDMA_CM_EVENT_CONNECT_RESPONSE. . . . . . . . . . . . . . . . . . . . . . . . 117 6.3.7 RDMA_CM_EVENT_CONNECT_ERROR . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.3.8 RDMA_CM_EVENT_UNREACHABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.3.9 RDMA_CM_EVENT_REJECTED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.3.10 RDMA_CM_EVENT_ESTABLISHED. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.3.11 RDMA_CM_EVENT_DISCONNECTED. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.3.12 RDMA_CM_EVENT_DEVICE_REMOVAL. . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.3.13 RDMA_CM_EVENT_MULTICAST_JOIN . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.3.14 RDMA_CM_EVENT_MULTICAST_ERROR . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.3.15 RDMA_CM_EVENT_ADDR_CHANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 6.3.16 RDMA_CM_EVENT_TIMEWAIT_EXIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Chapter 7 Programming Examples Using IBV Verbs . . . . . . . . . . . . . . . . . . . . . . . . . 119 7.1 Synopsis for RDMA_RC Example Using IBV Verbs. . . . . . . . . . . . . . . . . . . . 119 7.1.1 Main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Mellanox Technologies 7
Rev 1.7 7.1.2 print_config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7.1.3 resources_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7.1.4 resources_create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7.1.5 sock_connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7.1.6 connect_qp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7.1.7 modify_qp_to_init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7.1.8 post_receive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7.1.9 sock_sync_data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7.1.10 modify_qp_to_rtr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 7.1.11 modify_qp_to_rts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 7.1.12 post_send. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 7.1.13 poll_completion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 7.1.14 resources_destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 7.2 Code for Send, Receive, RDMA Read, RDMA Write . . . . . . . . . . . . . . . . . . . 121 7.3 Synopsis for Multicast Example Using RDMA_CM and IBV Verbs. . . . . . . . 148 7.3.1 Main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 7.3.2 Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 7.4 Code for Multicast Using RDMA_CM and IBV Verbs . . . . . . . . . . . . . . . . . . 149 Chapter 8 Programming Examples Using RDMA Verbs . . . . . . . . . . . . . . . . . . . . . . 160 8.1 Automatic Path Migration (APM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 8.2 Multicast Code Example Using RDMA CM. . . . . . . . . . . . . . . . . . . . . . . . . . . 174 8.3 Shared Received Queue (SRQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Appendix A Experimental APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199 A.1 Dynamically Connected Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 Appendix B Verbs API for Extended Atomics Support . . . . . . . . . . . . . . . . . .203 B.1 Supported Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 B.2 Verbs Interface Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Appendix C User-Mode Memory Registration (UMR) . . . . . . . . . . . . . . . . . . .206 C.1 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Appendix D Cross-Channel Communications Support . . . . . . . . . . . . . . . . . .211 D.1 Usage Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 D.2 Resource Initialization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 D.3 Posting Request List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 8 Mellanox Technologies
分享到:
收藏