IBV_MODIFY_QP_RATE_LIMIT(3)

✨ IBV_MODIFY_QP_RATE_LIMIT(3) ✨

okay bestie, welcome to the Libibverbs Programmer's Manual πŸ’– this one's all about ibv_modify_qp_rate_limit, and ngl it's kind of a slay once you get it.


🌸 NAME 🌸

ibv_modify_qp_rate_limit β€” modify the send rate limits attributes of a queue pair (QP) πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <infiniband/verbs.h>

int ibv_modify_qp_rate_limit(struct ibv_qp *qp, struct ibv_qp_rate_limit_attr *attr);

✨ DESCRIPTION ✨

So like, ibv_modify_qp_rate_limit() does exactly what it says on the tin: it modifies the send rate limiting packet pacing attributes of the QP qp using the attributes you pass in attr. The attr argument is an ibv_qp_rate_limit_attr struct, as defined in <infiniband/verbs.h>. periodt.

The rate_limit is literally the MAX send rate this QP will send, as long as the link is not blocked and there are work requests sitting in the send queue. no cap.

You want finer control for shaping the rate limit of a QP? iconic, that's what max_burst_sz (single burst max bytes size) and typical_pkt_sz (typical packet bytes size) are for. πŸŽ€ These let the device adjust the inter-burst gap delay that's needed to correctly shape the scheduling of sends to the wire, so you can actually reach the requested application requirements. it's giving precision.

Setting a value of 0 for max_burst_sz or typical_pkt_sz will use the device's defaults. and just so you know, 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 */
};

⭐ RETURN VALUE ⭐

ibv_modify_qp_rate_limit() returns 0 on success πŸŽ‰, or the value of errno on failure (which indicates the failure reason). 😭


πŸ’€ ERRORS πŸ’€

EINVAL

Invalid arguments. πŸ™ˆ

EOPNOTSUPP

Function is not implemented for this device. (Heads up: ENOSYS may sometimes be returned by old versions of libibverbs.) πŸ’€


πŸ‘‘ SEE ALSO πŸ‘‘

ibv_create_qp(3), ibv_destroy_qp(3), ibv_modify_qp(3), ibv_query_qp(3)


🧚 AUTHORS 🧚

Alex Rosenbaum <alexr@mellanox.com>

Bodong Wang <bodong@mellanox.com>


and that's the whole vibe, bestie 🫢 this page came to you from libibverbs, dated 2018-01-09 β€” go forth and rate-limit responsibly, mwah πŸ’…πŸŒΈ

πŸ“¦ where this page comes from