Commit 949e7c06 authored by Kalesh AP's avatar Kalesh AP Committed by Leon Romanovsky
Browse files

RDMA/bnxt_re: Report QP rate limit in debugfs



Update QP info debugfs hook to report the rate limit applied
on the QP. 0 means unlimited.

Signed-off-by: default avatarDamodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Signed-off-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Link: https://patch.msgid.link/20260202133413.3182578-4-kalesh-anakkur.purayil@broadcom.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 13edc7d4
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -87,25 +87,35 @@ static ssize_t qp_info_read(struct file *filep,
			    size_t count, loff_t *ppos)
{
	struct bnxt_re_qp *qp = filep->private_data;
	struct bnxt_qplib_qp *qplib_qp;
	u32 rate_limit = 0;
	char *buf;
	int len;

	if (*ppos)
		return 0;

	qplib_qp = &qp->qplib_qp;
	if (qplib_qp->shaper_allocation_status)
		rate_limit = qplib_qp->rate_limit;

	buf = kasprintf(GFP_KERNEL,
			"QPN\t\t: %d\n"
			"transport\t: %s\n"
			"state\t\t: %s\n"
			"mtu\t\t: %d\n"
			"timeout\t\t: %d\n"
			"remote QPN\t: %d\n",
			"remote QPN\t: %d\n"
			"shaper allocated : %d\n"
			"rate limit\t: %d kbps\n",
			qp->qplib_qp.id,
			bnxt_re_qp_type_str(qp->qplib_qp.type),
			bnxt_re_qp_state_str(qp->qplib_qp.state),
			qp->qplib_qp.mtu,
			qp->qplib_qp.timeout,
			qp->qplib_qp.dest_qpn);
			qp->qplib_qp.dest_qpn,
			qplib_qp->shaper_allocation_status,
			rate_limit);
	if (!buf)
		return -ENOMEM;
	if (count < strlen(buf)) {