UMAD_GET_PORT(3)
π UMAD_GET_PORT β open and close an InfiniBand port
okay bestie, gather round, because this is a manual page from the OpenIB Programmer's Manual (that's the manual name, keep it in your notes π) and it's about two little functions that open and close an InfiniBand port. yes, umad_get_port and umad_release_port. iconic duo. they come as a pair, like you and your emotional support water bottle π«Ά
β¨ NAME β¨
umad_get_port, umad_release_port β open and close an InfiniBand port
lowkey the most self-explanatory NAME section of all time, and honestly? we love a function that knows what it is.
πΈ SYNOPSIS πΈ
#include <infiniband/umad.h>
int umad_get_port(char *ca_name, int portnum, umad_port_t *port);
int umad_release_port(umad_port_t *port);
two functions, both returning int. no cap. π
π¦ DESCRIPTION π¦
so here's the tea β
umad_get_port() fills the port structure with the IB port attributes specified by ca_name and portnum, or the default port if ca_name is NULL and portnum is zero.
and here's the cute part β if you only specify one of ca_name and portnum, the other one gets used as a filter. for example: passing a NULL ca_name and 2 for the portnum means "get me a port from any of the local IB devices, as long as it is the second port". it's giving β¨ picky but flexible β¨
not me being dramatic but LISTEN: the library may use some reference scheme to support port caching, so umad_release_port() should be called before the port structure can be deallocated. do not just free it and walk away, bestie, that's a red flag π©
the argument port is an umad_port_t struct, as specified in <infiniband/umad.h>.
and here's that struct in all its glory, verbatim, because we do NOT mess with source code around here π
typedef struct umad_port {
char ca_name[UMAD_CA_NAME_LEN]; /* Name of the device */
int portnum; /* Physical port number */
uint base_lid; /* Base port LID */
uint lmc; /* LMC of LID */
uint sm_lid; /* SM LID */
uint sm_sl; /* SM service level */
uint state; /* Logical port state */
uint phys_state; /* Physical port state */
uint rate; /* Port link bit rate */
uint64_t capmask; /* Port capabilities */
uint64_t gid_prefix; /* Gid prefix of this port */
uint64_t port_guid; /* GUID of this port */
} umad_port_t;
look at all those fields. ca_name, portnum, base_lid, lmc, sm_lid, sm_sl, state, phys_state, rate, capmask, gid_prefix, port_guid. twelve fields of pure information. she's thorough π
umad_release_port() releases the resources that were allocated by the umad_get_port() function for the specified IB port. it's the cleanup bestie. the "okay we're done here, thank you next" function. π
π RETURN VALUE π
both umad_get_port() and umad_release_port() return 0 on success, and a negative value on error.
so like, 0 = slay, negative = not slay. simple as that. π
π AUTHORS π
the legends who made this happen:
- Hal Rosenstock
<halr@voltaire.com> - Dotan Barak
<dotanb@mellanox.co.il>
periodt. absolute icons. π«Ά
π SEE ALSO π
nothing listed here bestie, but like⦠check <infiniband/umad.h> obviously. iykyk.
and that's the whole page!! this one came from the OpenIB folks, dated May 21, 2007, and it lives at section 3 of the manual β so when you're lost, just yell man 3 umad_get_port and it'll come running π§β¨
π¦ 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: libibumad-dev 44.0-2 Β· BSD-MIT OR GPL-2.0-only
- debian trixie: libibumad-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
- 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: libibumad-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibumad-dev 50.0-2build2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibumad-dev 50.0-2ubuntu0.2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu questing: libibumad-dev 56.1-1ubuntu1
- ubuntu resolute: libibumad-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: libibumad-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