提交 e63943ab 编写于 作者: Y Yixing Liu 提交者: Zheng Zengkai

RDMA/hns: Fix roce v1 traffic_class problem

driver inclusion
category: Bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I61FED

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

When it is roce v1, if the traffic_class value exceeds 63,
the following error will appear:
modify qp to 2 state failed(22)
Failed to create AH

This is because the driver intercepts the over-spec value
in set dscp, and there is no need to obtain dscp for roce v1,
so the driver does not intercept v1.

Fixes: 11ef2ec6 ("RDMA/hns: Support DSCP of userspace")
Signed-off-by: NYixing Liu <liuyixing1@huawei.com>
Reviewed-by: NYangyang Li <liyangyang20@huawei.com>
Reviewed-by: NYue Haibing <yuehaibing@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 5b5b38ba
......@@ -61,8 +61,8 @@ int hns_roce_create_ah(struct ib_ah *ibah, struct rdma_ah_init_attr *init_attr,
struct hns_roce_dev *hr_dev = to_hr_dev(ibah->device);
struct hns_roce_ib_create_ah_resp resp = {};
struct hns_roce_ah *ah = to_hr_ah(ibah);
u8 priority;
u8 tc_mode;
u8 priority = 0;
u8 tc_mode = 0;
int ret;
if (hr_dev->pci_dev->revision == PCI_REVISION_ID_HIP08 && udata)
......@@ -81,7 +81,10 @@ int hns_roce_create_ah(struct ib_ah *ibah, struct rdma_ah_init_attr *init_attr,
ret = hr_dev->hw->get_dscp(hr_dev, get_tclass(grh), &tc_mode,
&priority);
if (ret && ret != -EOPNOTSUPP)
if (ret == -EOPNOTSUPP)
ret = 0;
if (ret && grh->sgid_attr->gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP)
return ret;
if (tc_mode == HNAE3_TC_MAP_MODE_DSCP &&
......
......@@ -5038,7 +5038,8 @@ static int hns_roce_set_sl(struct ib_qp *ibqp,
ret = hns_roce_hw_v2_get_dscp(hr_dev, get_tclass(&attr->ah_attr.grh),
&hr_qp->tc_mode, &hr_qp->priority);
if (ret && ret != -EOPNOTSUPP) {
if (ret && ret != -EOPNOTSUPP &&
grh->sgid_attr->gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP) {
ibdev_err(ibdev, "failed to get dscp, ret = %d.\n", ret);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册