Skip to content

Commit 949e7c0

Browse files
kaleshap86rleon
authored andcommitted
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: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Link: https://patch.msgid.link/20260202133413.3182578-4-kalesh-anakkur.purayil@broadcom.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 13edc7d commit 949e7c0

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

drivers/infiniband/hw/bnxt_re/debugfs.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,35 @@ static ssize_t qp_info_read(struct file *filep,
8787
size_t count, loff_t *ppos)
8888
{
8989
struct bnxt_re_qp *qp = filep->private_data;
90+
struct bnxt_qplib_qp *qplib_qp;
91+
u32 rate_limit = 0;
9092
char *buf;
9193
int len;
9294

9395
if (*ppos)
9496
return 0;
9597

98+
qplib_qp = &qp->qplib_qp;
99+
if (qplib_qp->shaper_allocation_status)
100+
rate_limit = qplib_qp->rate_limit;
101+
96102
buf = kasprintf(GFP_KERNEL,
97103
"QPN\t\t: %d\n"
98104
"transport\t: %s\n"
99105
"state\t\t: %s\n"
100106
"mtu\t\t: %d\n"
101107
"timeout\t\t: %d\n"
102-
"remote QPN\t: %d\n",
108+
"remote QPN\t: %d\n"
109+
"shaper allocated : %d\n"
110+
"rate limit\t: %d kbps\n",
103111
qp->qplib_qp.id,
104112
bnxt_re_qp_type_str(qp->qplib_qp.type),
105113
bnxt_re_qp_state_str(qp->qplib_qp.state),
106114
qp->qplib_qp.mtu,
107115
qp->qplib_qp.timeout,
108-
qp->qplib_qp.dest_qpn);
116+
qp->qplib_qp.dest_qpn,
117+
qplib_qp->shaper_allocation_status,
118+
rate_limit);
109119
if (!buf)
110120
return -ENOMEM;
111121
if (count < strlen(buf)) {

0 commit comments

Comments
 (0)