Commit 87e122c9 authored by Junxian Huang's avatar Junxian Huang Committed by Chengchang Tang
Browse files

RDMA/hns: Fix ah error counter in sw stat not increasing when sl is invalid

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAQEU6



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

When sl is invalid, hns_roce_create_ah() returns directly without
jumping to sw stat path, thus leading to a problem that the ah error
counter does not increase in this case.

Fixes: ebccb56b ("RDMA/hns: Fix a missing validation check for sl")
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: default avatarXinghai Cen <cenxinghai@h-partners.com>
parent 57c04562
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -98,7 +98,8 @@ int hns_roce_create_ah(struct ib_ah *ibah, struct rdma_ah_init_attr *init_attr,
		ibdev_err_ratelimited(&hr_dev->ib_dev,
			  "failed to set sl, sl (%u) shouldn't be larger than %u.\n",
			  ah->av.sl, sl_num);
		return -EINVAL;
		ret = -EINVAL;
		goto err_out;
	}

	memcpy(ah->av.dgid, grh->dgid.raw, HNS_ROCE_GID_SIZE);