mlx4dv_set_context_attr(3) mlx4dv_set_context_attr(3)

mlx4dv_set_context_attr - Set context attributes

#include <infiniband/mlx4dv.h>
int mlx4dv_set_context_attr(struct ibv_context *context,

enum mlx4dv_set_ctx_attr_type attr_type,
void *attr);

mlx4dv_set_context_attr gives the ability to set vendor specific attributes on the RDMA context.

RDMA device context to work on.
The type of the provided attribute.
Pointer to the attribute to be set. ## attr_type
enum mlx4dv_set_ctx_attr_type {

/* Attribute type uint8_t */
Change the LOG WQs Range size for RSS
Provide an external buffer allocator
struct mlx4dv_ctx_allocators {

void *(*alloc)(size_t size, void *priv_data);
void (*free)(void *ptr, void *priv_data);
void *data; };
Function used for buffer allocation instead of libmlx4 internal method
Function used to free buffers allocated by alloc function
Metadata that can be used by alloc and free functions

Returns 0 on success, or the value of errno on failure (which indicates the failure reason).


Majd Dibbiny <>