Unverified Commit 7eee9210 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11618 RDMA/hns: Fix ah error counter in sw stat not increasing

parents b4480f1e bda4da53
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -63,8 +63,10 @@ int hns_roce_create_ah(struct ib_ah *ibah, struct rdma_ah_init_attr *init_attr,
	u32 max_sl;
	int ret;

	if (hr_dev->pci_dev->revision == PCI_REVISION_ID_HIP08 && udata)
		return -EOPNOTSUPP;
	if (hr_dev->pci_dev->revision == PCI_REVISION_ID_HIP08 && udata) {
		ret = -EOPNOTSUPP;
		goto err_out;
	}

	ah->av.port = rdma_ah_get_port_num(ah_attr);
	ah->av.gid_index = grh->sgid_index;
@@ -83,7 +85,7 @@ int hns_roce_create_ah(struct ib_ah *ibah, struct rdma_ah_init_attr *init_attr,
		ret = 0;

	if (ret && grh->sgid_attr->gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP)
		return ret;
		goto err_out;

	if (tc_mode == HNAE3_TC_MAP_MODE_DSCP &&
	    grh->sgid_attr->gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP)
@@ -96,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, max_sl);
		return -EINVAL;
		ret = -EINVAL;
		goto err_out;
	}

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