MLX4DV_INIT_OBJ(3)
π MLX4DV_INIT_OBJ π
okay bestie, this is a page from the Library Functions Manual β specifically the MLX4DV_INIT_OBJ(3) one β and it's all about setting up your mlx4 direct verbs object. no cap, it's giving "low-level but make it cute". let's get into it π¦
β¨ NAME β¨
mlx4dv_init_obj β Initialize mlx4 direct verbs object from ibv_xxx structures
πΈ SYNOPSIS πΈ
#include <infiniband/mlx4dv.h>
int mlx4dv_init_obj(struct mlx4dv_obj *obj, uint64_t obj_type);
π DESCRIPTION π
so mlx4dv_init_obj() will initialize all the mlx4dv_xxx structs based on the type you supply. where does the info for that initialization come from? it's taken from the ibv_xx structs you pass in as part of the input. literally, that's the source. π«Ά
when you request information of a CQ, that marks it as owned by direct verbs for all consumer index related actions. and here's the tea: the initialization type can be a combination of several types together. so you're not locked into just one, you can stack 'em. π
struct mlx4dv_qp {
uint32_t *rdb;
uint32_t *sdb;
struct {
uint32_t wqe_cnt;
int wqe_shift;
int offset;
} sq;
struct {
uint32_t wqe_cnt;
int wqe_shift;
int offset;
} rq;
struct {
void *buf;
size_t length;
} buf;
uint64_t comp_mask; /* Use enum mlx4dv_qp_comp_mask */
off_t uar_mmap_offset; /* If MLX4DV_QP_MASK_UAR_MMAP_OFFSET is set in comp_mask, this will contain the mmap offset of *sdb* */
};
struct mlx4dv_cq {
struct {
void *buf;
size_t length;
} buf;
uint32_t cqe_cnt;
uint32_t cqn;
uint32_t *set_ci_db;
uint32_t *arm_db;
int arm_sn;
int cqe_size;
uint64_t comp_mask; /* Use enum mlx4dv_cq_comp_mask */
void *cq_uar;
};
struct mlx4dv_srq {
struct {
void *buf;
size_t length;
} buf;
int wqe_shift;
int head;
int tail;
uint32_t *db;
uint64_t comp_mask;
};
struct mlx4dv_rwq {
__be32 *rdb;
struct {
uint32_t wqe_cnt;
int wqe_shift;
int offset;
} rq;
struct {
void *buf;
size_t length;
} buf;
uint64_t comp_mask;
};
struct mlx4dv_obj {
struct {
struct ibv_qp *in;
struct mlx4dv_qp *out;
} qp;
struct {
struct ibv_cq *in;
struct mlx4dv_cq *out;
} cq;
};
enum mlx4dv_obj_type {
MLX4DV_OBJ_QP = 1 << 0,
MLX4DV_OBJ_CQ = 1 << 1,
MLX4DV_OBJ_SRQ = 1 << 2,
};
π RETURN VALUE π
returns 0 on success, or the value of errno on failure β and that errno is literally telling you why it flopped. periodt. π
π NOTES π
- Compatibility masks (
comp_mask) are in/out fields. yes bestie, they go both ways. π
π SEE ALSO π
π AUTHORS π
Maor Gottlieb <maorg@mellanox.com>
and that's a wrap on MLX4DV_INIT_OBJ(3) fr fr π β this page is version 1.0.0, dated 2017-02-02, and it's living in the MLX4DV_INIT_OBJ(3) manual. slay, go init some objects πβ¨
π¦ 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
- Copyright (c) 2017 Mellanox Technologies, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms