I have a ConnectX-6 Infiniband/VPI Adapter. I can setup the hardware rate limit when creating a qp like this:
...
ibv_qp_attr.ah_attr.static_rate = 7; // set qp rate limit to 40Gbps
...
ibv_modify_qp(qp, &ibv_qp_attr, flags);
...
But I cannot dynamically change the qp rate limit later using the above code after creating the qp.
I also checked the ibv_modify_qp_rate_limit()
API, but it keeps return EINVAL when I try to set the rate limit using this API:
struct ibv_qp_rate_limit_attr rl_attr;
memset(&rl_attr, 0, sizeof(rl_attr));
rl_attr.rate_limit = 100;
ibv_modify_qp_rate_limit(qp, &rl_attr); // returns EINVAL
Am I using the API right? How can I dynamically change the hardware rate limit of a qp? (or set the global hardware rate limit).