IBV_QUERY_PORT(3)
π IBV_QUERY_PORT π
okay bestie, welcome to the ibv_query_port page from the Libibverbs Programmer's Manual β¨ this is the one where you ask a port "hey girl, what's your deal?" and it tells you literally everything π«Ά
πΈ NAME πΈ
ibv_query_port β query an RDMA port's attributes π
β¨ SYNOPSIS β¨
#include <infiniband/verbs.h>
int ibv_query_port(struct ibv_context *context, uint8_t port_num,
struct ibv_port_attr *port_attr);
π DESCRIPTION π
so ibv_query_port() hands you back the attributes of port port_num for the device context, and it drops them through the pointer port_attr π
the port_attr argument is an ibv_port_attr struct, and it's defined in <infiniband/verbs.h> like this:
struct ibv_port_attr {
enum ibv_port_state state; /* Logical port state */
enum ibv_mtu max_mtu; /* Max MTU supported by port */
enum ibv_mtu active_mtu; /* Actual MTU */
int gid_tbl_len; /* Length of source GID table */
uint32_t port_cap_flags; /* Port capabilities */
uint32_t max_msg_sz; /* Maximum message size */
uint32_t bad_pkey_cntr; /* Bad P_Key counter */
uint32_t qkey_viol_cntr; /* Q_Key violation counter */
uint16_t pkey_tbl_len; /* Length of partition table */
uint16_t lid; /* Base port LID */
uint16_t sm_lid; /* SM LID */
uint8_t lmc; /* LMC of LID */
uint8_t max_vl_num; /* Maximum number of VLs */
uint8_t sm_sl; /* SM service level */
uint8_t subnet_timeout; /* Subnet propagation delay */
uint8_t init_type_reply;/* Type of initialization performed by SM */
uint8_t active_width; /* Currently active link width */
uint8_t active_speed; /* Currently active link speed if speed<XDR,NDR otherwise */
uint8_t phys_state; /* Physical port state */
uint8_t link_layer; /* link layer protocol of the port */
uint8_t flags; /* Port flags */
uint16_t port_cap_flags2;/* Port capabilities */
uint32_t active_speed_ex;/* Currently active link speed, if it is 0 refer to active_speed instead */
};
ngl that's a whole lot of fields and every single one is eating, no skips π
the possible values for the link layer field are IBV_LINK_LAYER_INFINIBAND, IBV_LINK_LAYER_ETHERNET, or IBV_LINK_LAYER_UNSPECIFIED π
and here are the supported port flags:
IBV_QPF_GRH_REQUIREDβ when this flag is set, the applications must create all AH with GRH configured. it's giving mandatory, not optional, periodt π
π¦ RETURN VALUE π¦
ibv_query_port() returns 0 on success, or the value of errno on failure (and that errno value is what tells you why it flopped π).
π SEE ALSO π
π AUTHORS π
Dotan Barak <dotanba@gmail.com> β
libibverbs Β· 2006-10-31 β yeah she's been iconic since way back, and she's still serving πβ¨ go query that port bestie, you 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 trixie: libibverbs-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 noble: libibverbs-dev 50.0-2build2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibverbs-dev 50.0-2ubuntu0.2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu questing: libibverbs-dev 56.1-1ubuntu1
- ubuntu resolute: libibverbs-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: libibverbs-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