#include <infiniband/mlx4dv.h> int mlx4dv_query_device(struct ibv_context *ctx_in, struct mlx4dv_context *attrs_out);
This function returns a version and compatibility mask. The version represents the format of the internal hardware structures that mlx4dv.h exposes. Future additions of new fields to the existing structures are handled by the comp_mask field.
struct mlx4dv_context {
uint8_t version;
uint32_t max_inl_recv_sz; /* Maximum supported size of inline receive */
uint64_t comp_mask;
};