MLX4DV_QUERY_DEVICE(3)

πŸ’– MLX4DV_QUERY_DEVICE πŸ’–

okay bestie, welcome to section 3 of the Library Functions Manual β€” yes we're in the library functions manual, we're fancy like that πŸ’…


✨ NAME ✨

mlx4dv_query_device β€” the little function that goes "hey, what can this mlx4 device actually do?" πŸ”βœ¨


🌸 SYNOPSIS 🌸

#include <infiniband/mlx4dv.h>

int mlx4dv_query_device(struct ibv_context *ctx_in,
                        struct mlx4dv_context *attrs_out);

two args, one int, so simple, so iconic πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, mlx4dv_query_device() asks for all the mlx4-specific device info that you can actually use through the direct verbs interface. no cap, it's giving "tell me your secrets but only the mlx4 ones" 😌

this function hands you back a version and a compatibility mask. the version is literally the format of the internal hardware structures that mlx4dv.h exposes β€” like the vibe check for the struct layout 🫢. and if anybody adds new fields to the existing structures in the future? that's what the comp_mask field is for. she handles it. periodt. πŸ‘‘

and here's the struct, look at her:

struct mlx4dv_context {
        uint8_t         version;
        uint32_t        max_inl_recv_sz; /* Maximum supported size of inline receive  */
        uint64_t        comp_mask;
};

max_inl_recv_sz is the maximum supported size of inline receive, in case that wasn't clear from the comment bestie 😭 it's right there.


πŸ’« RETURN VALUE πŸ’«

  • 0 β€” slay, success ✨
  • the value of errno β€” not slay, failure, and that value tells you why it failed πŸ’€

🌈 NOTES 🌈

  • the compatibility mask (comp_mask) is an in/out field β€” it goes both ways, she's versatile πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

go read those too, i'm literally obsessed with a well-cross-referenced manpage πŸ“šπŸ’–


πŸ‘‘ AUTHORS πŸ‘‘

Maor Gottlieb <maorg@mellanox.com> β€” thank you for your service πŸ«‘πŸ’œ


ok that's the whole page bestie, nothing skipped, nothing missing, we ate that up fr fr πŸ“

version 1.0.0, dated 2017-06-27 β€” yes she's an elder but she's still main character energy, and this was the MLX4DV_QUERY_DEVICE(3) page, mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from