RDMA_GET_DEVICES(3)
β¨ NAME β¨
rdma_get_devices β bestie, this is how you get a list of all the RDMA devices that are currently available π
It lives in the librdmacm Programmer's Manual, so you already know it's about to be cute and powerful at the same time π
πΈ SYNOPSIS πΈ
#include <rdma/rdma_cma.h>
struct ibv_context ** rdma_get_devices (int *num_devices);
okay so she takes one pointer and hands you back a whole array of vibes. no cap. β¨
π¦ ARGUMENTS π¦
num_devicesβ if this is non-NULL, she'll write the number of devices she returned right into it. like, she's doing your bookkeeping for you. queen behavior π
π DESCRIPTION π
She returns a NULL-terminated array of opened RDMA devices. literally the whole roster, and the NULL at the end is her little "that's it, that's everybody" periodt π
And why do you even care? Because callers can use this routine to allocate resources on specific RDMA devices that will be shared across multiple rdma_cm_id's. so if you've got a bunch of ids and you want them all living their best life on the same device, this is the way. main character resource-sharing energy, fr fr π₯
β RETURN VALUE β
You get back an array of the available RDMA devices. slay π
But if the request fails, you get NULL. not slay π And on failure, errno will be set to indicate the failure reason β so always check it, bestie, it's giving free information.
ngl aNULLreturn with noerrnocheck is how you end up debugging at 3am. don't do that to yourself π«Ά
π NOTES π
- The returned array must be released by calling
rdma_free_devices. yes, she's handing you something, and yes, you have to give it back. clean up after yourself, icon π - Devices remain opened while the librdmacm is loaded. so they're just... chilling there, open, until librdmacm dips. that's the arrangement π
π SEE ALSO π
rdma_free_devices(3)β the friend who takes the array back off your hands. you two are a package deal, iykyk π§
and that's the whole page, bestie!! this one's from librdmacm, dated 2007-05-15, and it's filed under RDMA_GET_DEVICES(3) β go forth and get your devices, you've got this πβ¨π¦
π¦ 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