Hello, This implements ratelimited ibdev printk functions, similar to their dev_*_ratelimited counterparts. I've submitted the first patch before [1] without usage, I'm now adding the corresponding EFA patch as well. cxgb4, hfi1, mlx4, vmw_pvrdma, rdmavt and rxe could also benefit from this if they move to ibvdev prints: $ git grep ratelimited -- drivers/infiniband/[hs]w drivers/infiniband/hw/cxgb4/mem.c: pr_warn_ratelimited("%s: dma map failure (non fatal)\n", drivers/infiniband/hw/cxgb4/resource.c: pr_warn_ratelimited("%s: Out of RQT memory\n", drivers/infiniband/hw/hfi1/chip.c: dd_dev_info_ratelimited(dd, "DCC Error: fmconfig error: %s\n", drivers/infiniband/hw/hfi1/chip.c: dd_dev_info_ratelimited(dd, "DCC Error: PortRcv error: %s\n" drivers/infiniband/hw/hfi1/chip.c: dd_dev_info_ratelimited(dd, "8051 access to LCB blocked\n"); drivers/infiniband/hw/hfi1/chip.c: dd_dev_info_ratelimited(dd, "host access to LCB blocked\n"); drivers/infiniband/hw/hfi1/chip.c: dd_dev_info_ratelimited(dd, "DCC Error: %s\n", drivers/infiniband/hw/hfi1/chip.c: dd_dev_info_ratelimited(dd, "%s: PortErrorAction bounce\n", drivers/infiniband/hw/hfi1/chip.c: dd_dev_info_ratelimited(dd, "SDMA engine %u interrupt, but no status bits set\n", drivers/infiniband/hw/hfi1/hfi.h:#define dd_dev_err_ratelimited(dd, fmt, ...) \ drivers/infiniband/hw/hfi1/hfi.h: dev_err_ratelimited(&(dd)->pcidev->dev, "%s: " fmt, \ drivers/infiniband/hw/hfi1/hfi.h:#define dd_dev_warn_ratelimited(dd, fmt, ...) \ drivers/infiniband/hw/hfi1/hfi.h: dev_warn_ratelimited(&(dd)->pcidev->dev, "%s: " fmt, \ drivers/infiniband/hw/hfi1/hfi.h:#define dd_dev_info_ratelimited(dd, fmt, ...) \ drivers/infiniband/hw/hfi1/hfi.h: dev_info_ratelimited(&(dd)->pcidev->dev, "%s: " fmt, \ drivers/infiniband/hw/hfi1/mad.c: pr_err_ratelimited("hfi1: Invalid trap 0x%0x dropped. Total dropped: %d\n", drivers/infiniband/hw/hfi1/mad.c: pr_warn_ratelimited("hfi1: Maximum trap limit reached for 0x%0x traps\n", drivers/infiniband/hw/mlx4/qp.c: pr_warn_ratelimited("Unexpected event type %d on WQ 0x%06x. Events are not supported for WQs\n", drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c: dev_warn_ratelimited(&dev->pdev->dev, drivers/infiniband/sw/rdmavt/cq.c: rvt_pr_err_ratelimited(rdi, "CQ is full!\n"); drivers/infiniband/sw/rdmavt/vt.h:#define rvt_pr_err_ratelimited(rdi, fmt, ...) \ drivers/infiniband/sw/rdmavt/vt.h: __rvt_pr_err_ratelimited((rdi)->driver_f.get_pci_dev(rdi), \ drivers/infiniband/sw/rdmavt/vt.h:#define __rvt_pr_err_ratelimited(pdev, name, fmt, ...) \ drivers/infiniband/sw/rdmavt/vt.h: dev_err_ratelimited(&(pdev)->dev, "%s: " fmt, name, ##__VA_ARGS__) drivers/infiniband/sw/rxe/rxe.h: pr_warn_ratelimited("failed crc calculation, err: %d\n", err); drivers/infiniband/sw/rxe/rxe_net.c: pr_err_ratelimited("no route to %pI4\n", &daddr->s_addr); drivers/infiniband/sw/rxe/rxe_net.c: pr_err_ratelimited("no route to %pI6\n", daddr); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad qp type\n"); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad qp type\n"); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad qp type\n"); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("unsupported qp type\n"); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad pkey = 0x%x\n", pkey); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad pkey = 0x%0x\n", pkey); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad qkey, got 0x%x expected 0x%x for qpn 0x%x\n", drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("port %d != qp port %d\n", drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("dst addr %pI4 != qp source addr %pI4\n", drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("source addr %pI4 != qp dst addr %pI4\n", drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("dst addr %pI6 != qp source addr %pI6\n", drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("source addr %pI6 != qp dst addr %pI6\n", drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad tver\n"); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("no qp matches qpn 0x%x\n", qpn); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("no grh for mcast qpn\n"); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("failed matching dgid\n"); drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad ICRC from %pI6c\n", drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad ICRC from %pI4\n", drivers/infiniband/sw/rxe/rxe_recv.c: pr_warn_ratelimited("bad ICRC from unknown\n"); drivers/infiniband/sw/rxe/rxe_resp.c: pr_err_ratelimited("Failed sending ack\n"); drivers/infiniband/sw/rxe/rxe_resp.c: pr_err_ratelimited("Failed sending ack\n"); [1] https://patchwork.kernel.org/patch/10926991/ Thanks, Gal Gal Pressman (2): RDMA/core: Introduce ratelimited ibdev printk functions RDMA/efa: Rate limit admin queue error prints drivers/infiniband/hw/efa/efa_com.c | 70 ++++++------ drivers/infiniband/hw/efa/efa_com_cmd.c | 136 ++++++++++++++---------- include/rdma/ib_verbs.h | 51 +++++++++ 3 files changed, 171 insertions(+), 86 deletions(-) -- 2.22.0