Commit bb8865f4 authored by Kamal Heib's avatar Kamal Heib Committed by Jason Gunthorpe
Browse files

RDMA/providers: Fix return value when QP type isn't supported

The proper return code is "-EOPNOTSUPP" when the requested QP type is
not supported by the provider.

Link: https://lore.kernel.org/r/20200130082049.463-1-kamalheib1@gmail.com


Signed-off-by: default avatarKamal Heib <kamalheib1@gmail.com>
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 5e29d144
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1141,7 +1141,7 @@ static int bnxt_re_init_qp_type(struct bnxt_re_dev *rdev,
	qptype = __from_ib_qp_type(init_attr->qp_type);
	if (qptype == IB_QPT_MAX) {
		ibdev_err(&rdev->ibdev, "QP type 0x%x not supported", qptype);
		qptype = -EINVAL;
		qptype = -EOPNOTSUPP;
		goto out;
	}

+1 −1
Original line number Diff line number Diff line
@@ -2127,7 +2127,7 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
	pr_debug("ib_pd %p\n", pd);

	if (attrs->qp_type != IB_QPT_RC)
		return ERR_PTR(-EINVAL);
		return ERR_PTR(-EOPNOTSUPP);

	php = to_c4iw_pd(pd);
	rhp = php->rhp;
+1 −1
Original line number Diff line number Diff line
@@ -1261,7 +1261,7 @@ struct ib_qp *hns_roce_create_qp(struct ib_pd *pd,
	default:{
		ibdev_err(ibdev, "not support QP type %d\n",
			  init_attr->qp_type);
		return ERR_PTR(-EINVAL);
		return ERR_PTR(-EOPNOTSUPP);
	}
	}

+1 −1
Original line number Diff line number Diff line
@@ -617,7 +617,7 @@ static struct ib_qp *i40iw_create_qp(struct ib_pd *ibpd,
	iwqp->ctx_info.qp_compl_ctx = (uintptr_t)qp;

	if (init_attr->qp_type != IB_QPT_RC) {
		err_code = -EINVAL;
		err_code = -EOPNOTSUPP;
		goto error;
	}
	if (iwdev->push_mode)
+1 −1
Original line number Diff line number Diff line
@@ -1636,7 +1636,7 @@ static struct ib_qp *_mlx4_ib_create_qp(struct ib_pd *pd,
	}
	default:
		/* Don't support raw QPs */
		return ERR_PTR(-EINVAL);
		return ERR_PTR(-EOPNOTSUPP);
	}

	return &qp->ibqp;
Loading