Commit 61242b3a authored by Chengchang Tang's avatar Chengchang Tang Committed by Wang Hai
Browse files

RDMA/hns: Modify the print level of CQE error

stable inclusion
from stable-v5.10.219
commit 45b31be4dd22827903df15c548b97b416790139b
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IA6S8B
CVE: CVE-2024-38590

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=45b31be4dd22827903df15c548b97b416790139b



--------------------------------

[ Upstream commit 349e859952285ab9689779fb46de163f13f18f43 ]

Too much print may lead to a panic in kernel. Change ibdev_err() to
ibdev_err_ratelimited(), and change the printing level of cqe dump
to debug level.

Fixes: 7c044adc ("RDMA/hns: Simplify the cqe code of poll cq")
Signed-off-by: default avatarChengchang Tang <tangchengchang@huawei.com>
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20240412091616.370789-11-huangjunxian6@hisilicon.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>

Conflicts:
	drivers/infiniband/hw/hns/hns_roce_hw_v2.c
[Only the context is different, and no code is modified.]
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
parent 12b4c31f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4040,8 +4040,9 @@ static void get_cqe_status(struct hns_roce_dev *hr_dev, struct hns_roce_qp *qp,
		   wc->status == IB_WC_WR_FLUSH_ERR))
		return;

	ibdev_err(&hr_dev->ib_dev, "error cqe status 0x%x:\n", cqe_status);
	print_hex_dump(KERN_ERR, "", DUMP_PREFIX_NONE, 16, 4, cqe,
	ibdev_err_ratelimited(&hr_dev->ib_dev, "error cqe status 0x%x:\n",
			      cqe_status);
	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_NONE, 16, 4, cqe,
		       cq->cqe_size, false);
	wc->vendor_err = hr_reg_read(cqe, CQE_SUB_STATUS);