aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/qp.c
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2018-09-12 09:33:55 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-09-12 14:58:17 -0600
commit99ed748e878a99c6c7b87bbec063eefd9e47cb42 (patch)
tree986bf32c5f6247ea496444d56dffbc6540c50d3d /drivers/infiniband/hw/mlx5/qp.c
parentIB/hfi1: set_intr_bits uses incorrect source for register modification (diff)
downloadlinux-dev-99ed748e878a99c6c7b87bbec063eefd9e47cb42.tar.xz
linux-dev-99ed748e878a99c6c7b87bbec063eefd9e47cb42.zip
IB/mlx5: Allow transition of DCI QP to reset
The transition is allowed from any state and the atrribute mask must be IB_QP_STATE. Fixes: c32a4f296e1d ("IB/mlx5: Add support for DC Initiator QP") Signed-off-by: Moni Shoua <monis@mellanox.com> Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/hw/mlx5/qp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index a2073ee7a16f..1f35ecbefffe 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -3272,7 +3272,9 @@ static bool modify_dci_qp_is_ok(enum ib_qp_state cur_state, enum ib_qp_state new
int req = IB_QP_STATE;
int opt = 0;
- if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) {
+ if (new_state == IB_QPS_RESET) {
+ return is_valid_mask(attr_mask, req, opt);
+ } else if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) {
req |= IB_QP_PKEY_INDEX | IB_QP_PORT;
return is_valid_mask(attr_mask, req, opt);
} else if (cur_state == IB_QPS_INIT && new_state == IB_QPS_INIT) {