diff mbox series

[for-next,06/13] RDMA/hns: Modify qp will return errno When qp type is illegal

Message ID 1532503781-45205-7-git-send-email-oulijun@huawei.com (mailing list archive)
State Changes Requested
Headers show
Series Updates hns for v4.19 | expand

Commit Message

Lijun Ou July 25, 2018, 7:29 a.m. UTC
When qp type is illegal according to RoCE protocol, The verb of modify
qp will direct return a errno. This patch fixes it.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jason Gunthorpe July 26, 2018, 10:50 p.m. UTC | #1
On Wed, Jul 25, 2018 at 03:29:34PM +0800, Lijun Ou wrote:
> When qp type is illegal according to RoCE protocol, The verb of modify
> qp will direct return a errno. This patch fixes it.
> 
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index a69bfc6..cb677f0 100644
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -3441,6 +3441,7 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp,
>  		;
>  	} else {
>  		dev_err(dev, "Illegal state for QP!\n");
> +		ret = -EAGAIN;
>  		goto out;

Should this be EGAIN? What do other drivers do? I though this was EINVAL?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index a69bfc6..cb677f0 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -3441,6 +3441,7 @@  static int hns_roce_v2_modify_qp(struct ib_qp *ibqp,
 		;
 	} else {
 		dev_err(dev, "Illegal state for QP!\n");
+		ret = -EAGAIN;
 		goto out;
 	}