RDMA_CONNECT(3)
πΈ rdma_connect(3) β the Librdmacm Programmer's Manual glow-up πΈ
okay bestie, welcome to the librdmacm programmer's manual π this is rdma_connect, and yes, it's exactly as iconic as it sounds.
β¨ NAME β¨
rdma_connect β Initiate an active connection request. like, you're the one reaching out first. main character energy fr fr π
β¨ SYNOPSIS β¨
#include <rdma/rdma_cma.h>
int rdma_connect (struct rdma_cm_id *id, struct rdma_conn_param
*conn_param);
that's it. two args. you got this π
β¨ ARGUMENTS β¨
idβ the RDMA identifier. your lil handle on the whole situation πͺͺconn_paramβ the connection parameters. wanna know what's in there? scroll down to CONNECTION PROPERTIES, it's all laid out for you π
β¨ DESCRIPTION β¨
so here's the tea β if your rdma_cm_id is type RDMA_PS_TCP, this call initiates a connection request to a remote destination. and if your rdma_cm_id is type RDMA_PS_UDP, it initiates a lookup of the remote QP providing the datagram service. two vibes, one function. versatile queen π
β¨ RETURN VALUE β¨
- Returns
0on success π - Returns
-1on error π
and if there's an error, errno gets set to tell you why it went wrong. read your errno, bestie, it's literally trying to communicate with you.
β¨ NOTES β¨
β οΈ okay important: you must have resolved a route to the destination address first. that means you already calledrdma_resolve_routeorrdma_create_epbefore calling this routine. no route, no connect. periodt.
β¨ CONNECTION PROPERTIES β¨
these are the properties that configure the communication, and they're specified by the conn_param parameter when you're connecting or establishing datagram communication. let's go one by one, no skipping π«Ά
private_dataβ references a user-controlled data buffer. the contents get copied and transparently passed to the remote side as part of the communication request. can beNULLif you don't needprivate_dataat all. no pressure πΈprivate_data_lenβ the size of that user-controlled data buffer. but heads up π the actual amount of data transferred to the remote side is transport dependent and may be larger than that requested. so like, it can over-deliver. relatable.responder_resourcesβ the maximum number of outstanding RDMA read and atomic operations that the local side will accept from the remote side. applies only toRDMA_PS_TCP. this value must be less than or equal to the local RDMA device attributemax_qp_rd_atomand the remote RDMA device attributemax_qp_init_rd_atom. also the remote endpoint can adjust this value when accepting the connection. so it's a suggestion, not a decree πinitiator_depthβ the maximum number of outstanding RDMA read and atomic operations that the local side will have to the remote side. applies only toRDMA_PS_TCP. this value must be less than or equal to the local RDMA device attributemax_qp_init_rd_atomand the remote RDMA device attributemax_qp_rd_atom. and yeah, the remote endpoint can adjust this one too when accepting the connection.flow_controlβ specifies if hardware flow control is available. this value gets exchanged with the remote peer and is not used to configure the QP. applies only toRDMA_PS_TCP.retry_countβ the maximum number of times that a data transfer operation should be retried on the connection when an error occurs. this setting controls how many times to retry send, RDMA, and atomic operations when timeouts occur. applies only toRDMA_PS_TCP.rnr_retry_countβ the maximum number of times that a send operation from the remote peer should be retried on a connection after receiving a receiver not ready (RNR) error. RNR errors happen when a send request arrives before a buffer has been posted to receive the incoming data. applies only toRDMA_PS_TCP. (imagine showing up and nobody's home π)srqβ specifies if the QP associated with the connection is using a shared receive queue. this field is ignored by the library if a QP has been created on therdma_cm_id. applies only toRDMA_PS_TCP.qp_numβ specifies the QP number associated with the connection. this field is also ignored by the library if a QP has been created on therdma_cm_id. applies only toRDMA_PS_TCP.
β¨ INFINIBAND SPECIFIC β¨
okay so on top of all the connection properties above, InfiniBand QPs get configured with a minimum RNR NAK timer and local ACK timeout value. here's the deal:
- The minimum RNR NAK timer value is set to
0, for a delay of 655 ms. - The local ACK timeout is calculated based on the packet lifetime and the local HCA ACK delay.
- The packet lifetime is determined by the InfiniBand Subnet Administrator and is part of the resolved route (path record) information.
- The HCA ACK delay is a property of the locally used HCA.
also, retry count and RNR retry count values are 3-bit values. tiny little numbers. precious.
and the length of the private data provided by the user is limited to 56 bytes for RDMA_PS_TCP, or 180 bytes for RDMA_PS_UDP. so keep it cute and keep it short πΈ
β¨ IWARP SPECIFIC β¨
connections established over iWarp RDMA devices currently require that the active side of the connection send the first message. yes, you have to text first. it's giving situationship but okay, that's just how iWarp works π¦
β¨ SEE ALSO β¨
go read these next, they're all part of the friend group:
rdma_cm(7)rdma_create_id(3)rdma_resolve_route(3)rdma_disconnect(3)rdma_listen(3)rdma_get_cm_event(3)
okay that's the whole page bestie, you absolutely ate this π
β¨ this was the librdmacm programmer's manual, RDMA_CONNECT(3), dated 2010-07-19 β vintage but still serving π bye love u, go connect something π«Άπ
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- arch rolling: rdma-core 65.0-1 Β· GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-MIT AND GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-FreeBSD AND GPL-2.0-or-later OR LicenseRef-Intel-BSD-3-Clause AND GPL-2.0-or-later OR LicenseRef-PathScale-BSD-Patent-License AND CC0-1.0 AND MIT AND BSD-2-Clause AND CPL-1.0 OR BSD-2-Clause OR GPL-2.0-or-later
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- debian bookworm: librdmacm-dev 44.0-2 Β· BSD-MIT OR GPL-2.0-only
- debian trixie: librdmacm-dev 56.1-1 Β· BSD-MIT OR GPL-2.0-only
- fedora 43: rdma-core-devel 58.0-4.fc43 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 43: rdma-core-devel 58.0-4.fc43 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixos 26.05: rdma-core 62.0
- nixpkgs unstable: rdma-core 65.0
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- ubuntu jammy: librdmacm-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: librdmacm-dev 50.0-2build2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: librdmacm-dev 50.0-2ubuntu0.2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu questing: librdmacm-dev 56.1-1ubuntu1
- ubuntu resolute: librdmacm-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: librdmacm-dev 64.0-1ubuntu1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms