Skip to content

Commit efb9cbf

Browse files
Junxian Huangrleon
authored andcommitted
RDMA/hns: Fix unnecessary err return when using invalid congest control algorithm
Add a default congest control algorithm so that driver won't return an error when the configured algorithm is invalid. Fixes: f91696f ("RDMA/hns: Support congestion control type selection according to the FW") Signed-off-by: Junxian Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 0550d46 commit efb9cbf

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4760,10 +4760,15 @@ static int check_cong_type(struct ib_qp *ibqp,
47604760
cong_alg->wnd_mode_sel = WND_LIMIT;
47614761
break;
47624762
default:
4763-
ibdev_err(&hr_dev->ib_dev,
4764-
"error type(%u) for congestion selection.\n",
4765-
hr_dev->caps.cong_type);
4766-
return -EINVAL;
4763+
ibdev_warn(&hr_dev->ib_dev,
4764+
"invalid type(%u) for congestion selection.\n",
4765+
hr_dev->caps.cong_type);
4766+
hr_dev->caps.cong_type = CONG_TYPE_DCQCN;
4767+
cong_alg->alg_sel = CONG_DCQCN;
4768+
cong_alg->alg_sub_sel = UNSUPPORT_CONG_LEVEL;
4769+
cong_alg->dip_vld = DIP_INVALID;
4770+
cong_alg->wnd_mode_sel = WND_LIMIT;
4771+
break;
47674772
}
47684773

47694774
return 0;

0 commit comments

Comments
 (0)