IBV_QUERY_DEVICE(3)
π IBV_QUERY_DEVICE π
okay so bestie, welcome to ibv_query_device(3) β it's the Libibverbs Programmer's Manual page and honestly? it's giving "let me tell you everything about this RDMA device". π¦
β¨ NAME β¨
ibv_query_device β query an RDMA device's attributes π
πΈ SYNOPSIS πΈ
#include <infiniband/verbs.h>
int ibv_query_device(struct ibv_context *context,
struct ibv_device_attr *device_attr);
π DESCRIPTION π
so ibv_query_device() hands you back all the attributes of the device that belongs to context. literally it just returns the deets. π
and the device_attr argument? it's a pointer to an ibv_device_attr struct, which lives in <infiniband/verbs.h>. iconic.
and here's the whole struct, no cap, every single field with its comment exactly as the universe intended:
struct ibv_device_attr {
char fw_ver[64]; /* FW version */
uint64_t node_guid; /* Node GUID (in network byte order) */
uint64_t sys_image_guid; /* System image GUID (in network byte order) */
uint64_t max_mr_size; /* Largest contiguous block that can be registered */
uint64_t page_size_cap; /* Supported memory shift sizes */
uint32_t vendor_id; /* Vendor ID, per IEEE */
uint32_t vendor_part_id; /* Vendor supplied part ID */
uint32_t hw_ver; /* Hardware version */
int max_qp; /* Maximum number of supported QPs */
int max_qp_wr; /* Maximum number of outstanding WR on any work queue */
unsigned int device_cap_flags; /* HCA capabilities mask */
int max_sge; /* Maximum number of s/g per WR for SQ & RQ of QP for non RDMA Read operations */
int max_sge_rd; /* Maximum number of s/g per WR for RDMA Read operations */
int max_cq; /* Maximum number of supported CQs */
int max_cqe; /* Maximum number of CQE capacity per CQ */
int max_mr; /* Maximum number of supported MRs */
int max_pd; /* Maximum number of supported PDs */
int max_qp_rd_atom; /* Maximum number of RDMA Read & Atomic operations that can be outstanding per QP */
int max_ee_rd_atom; /* Maximum number of RDMA Read & Atomic operations that can be outstanding per EEC */
int max_res_rd_atom; /* Maximum number of resources used for RDMA Read & Atomic operations by this HCA as the Target */
int max_qp_init_rd_atom; /* Maximum depth per QP for initiation of RDMA Read & Atomic operations */
int max_ee_init_rd_atom; /* Maximum depth per EEC for initiation of RDMA Read & Atomic operations */
enum ibv_atomic_cap atomic_cap; /* Atomic operations support level */
int max_ee; /* Maximum number of supported EE contexts */
int max_rdd; /* Maximum number of supported RD domains */
int max_mw; /* Maximum number of supported MWs */
int max_raw_ipv6_qp; /* Maximum number of supported raw IPv6 datagram QPs */
int max_raw_ethy_qp; /* Maximum number of supported Ethertype datagram QPs */
int max_mcast_grp; /* Maximum number of supported multicast groups */
int max_mcast_qp_attach; /* Maximum number of QPs per multicast group which can be attached */
int max_total_mcast_qp_attach;/* Maximum number of QPs which can be attached to multicast groups */
int max_ah; /* Maximum number of supported address handles */
int max_fmr; /* Maximum number of supported FMRs */
int max_map_per_fmr; /* Maximum number of (re)maps per FMR before an unmap operation in required */
int max_srq; /* Maximum number of supported SRQs */
int max_srq_wr; /* Maximum number of WRs per SRQ */
int max_srq_sge; /* Maximum number of s/g per SRQ */
uint16_t max_pkeys; /* Maximum number of partitions */
uint8_t local_ca_ack_delay; /* Local CA ack delay */
uint8_t phys_port_cnt; /* Number of physical ports */
};
π RETURN VALUE π
- success β
ibv_query_device()returns0β¨ - failure β it returns the value of
errno, which tells you why it flopped π
π₯ NOTES π₯
so like, the maximum values this function gives you back are the upper limits of what the device can support. that's the ceiling, bestie. the absolute most. π
but β and this is the important part β it may not be possible to actually use those maximum values, because the real number of any resource you can create might be limited by:
- the machine configuration
- the amount of host memory
- user permissions
- the amount of resources already in use by other users/processes
not me thinking max means max π it's the theoretical ceiling, not a promise. plan accordingly, fr fr.
π SEE ALSO π
π AUTHORS π
- Dotan Barak
<dotanba@gmail.com>β thank you for your service, king π«Ά
and that's the whole page, bestie!! this lil cutie is from libibverbs and it's dated 2006-10-31 β a true vintage icon serving RDMA realness since way back. mwah π β¨
π¦ 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: libibverbs-dev 44.0-2 Β· BSD-MIT OR GPL-2.0-only
- 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 jammy: libibverbs-dev 39.0-1 Β· BSD-MIT 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