How to set Traffic Class using ibverbs

I have CX3 and CX5 adapters. And the same code of application using ibverbs api. When use CX3, field of TC in GRH has value 0x00. But when I use CX5 GRH TC has value 0x20. How can I control it. RDMA_CM set option I can not use, because use ibverbs api. May be via mlxconfig? Any help would be useful. Thanks.​

P.S. Any changes via linux utils in MLNX_OFED did nothing for me.​

Hello Ivan,

ibv_create_ah() holds this info and is used when calling ibv_post_send()

Please refer to

Section 3.4.15 ibv_create_ah

ibv_create_ah creates an AH. An AH contains all of the necessary data to reach a remote destination.

In connected transport modes (RC, UC) the AH is associated with a queue pair (QP). In

the datagram transport modes (UD), the AH is associated with a work request (WR).

struct ibv_ah_attr is defined as follows:

struct ibv_ah_attr


struct ibv_global_route grh;

uint16_t dlid;

uint8_t sl;

uint8_t src_path_bits;

uint8_t static_rate;

uint8_t is_global;

uint8_t port_num;


In the ibv_global_route struct the user should pass the TClass

struct ibv_global_route is defined as follows:

struct ibv_global_route


union ibv_gid dgid;

uint32_t flow_label;

uint8_t sgid_index;

uint8_t hop_limit;

uint8_t traffic_class;


Best Regards,