RDMA/mlx5: Set QP subtype immediately when it is known
authorLeon Romanovsky <leonro@mellanox.com>
Mon, 27 Apr 2020 15:46:06 +0000 (18:46 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 28 Apr 2020 23:42:21 +0000 (20:42 -0300)
commit318d2b06fbaa8fbce379a4e00901251b6368b4e3
treea3b4ff6179dee5ecc736f027337bd0ffa41d692e
parentc86936e6eb13bf3759e4cc0629ccc0076dd763de
RDMA/mlx5: Set QP subtype immediately when it is known

There is no need to delay QP subtype assignment to the end of the
create_qp() function and it is better to move it to be immediately
after it is checked so we would be able to rewrite later checks
to be based on it and not on over-written struct ib_qp_init_attr.

Link: https://lore.kernel.org/r/20200427154636.381474-7-leon@kernel.org
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/qp.c