]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/bnxt_re: Report QP rate limit in debugfs
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Mon, 2 Feb 2026 13:34:11 +0000 (19:04 +0530)
committerLeon Romanovsky <leon@kernel.org>
Mon, 2 Feb 2026 13:37:59 +0000 (08:37 -0500)
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>
drivers/infiniband/hw/bnxt_re/debugfs.c

index 88817c86ae243358dac413ed05a9999ae45549fd..e025217861c2438669119a4dcdd203cc9f8bd34b 100644 (file)
@@ -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)) {