#include <infiniband/verbs.h> int ibv_modify_qp_rate_limit(struct ibv_qp *qp, struct ibv_qp_rate_limit_attr *attr);
The rate_limit defines the MAX send rate this QP will send as long as the link in not blocked and there are work requests in send queue.
Finer control for shaping the rate limit of a QP is achieved by defining the max_burst_sz, single burst max bytes size and the typical_pkt_sz, typical packet bytes size. These allow the device to adjust the inter-burst gap delay required to correctly shape the scheduling of sends to the wire in order to reach for requested application requirements.
Setting a value of 0 for max_burst_sz or typical_pkt_sz will use the devices defaults. typical_pkt_sz will default to the port's MTU value.
struct ibv_qp_rate_limit_attr { uint32_t rate_limit; /* kbps */ uint32_t max_burst_sz; /* bytes */ uint16_t typical_pkt_sz; /* bytes */ };