{net,IB}/mlx5: Modify QP commands via mlx5 ifc
authorSaeed Mahameed <saeedm@mellanox.com>
Tue, 19 Jul 2016 15:03:21 +0000 (18:03 +0300)
committerLeon Romanovsky <leon@kernel.org>
Wed, 17 Aug 2016 14:45:58 +0000 (17:45 +0300)
commit1a412fb1caa2c1b77719ccb5ed8b0c3c2bc65da7
tree3932dca111e30df6cebae0a31679cddff00ce06e
parent09a7d9eca1a6cf5eb4f9abfdf8914db9dbd96f08
{net,IB}/mlx5: Modify QP commands via mlx5 ifc

Prior to this patch we assumed that modify QP commands have the
same layout.

In ConnectX-4 for each QP transition there is a specific command
and their layout can vary.

e.g: 2err/2rst commands don't have QP context in their layout and before
this patch we posted the QP context in those commands.

Fortunately the FW only checks the suffix of the commands and executes
them, while ignoring all invalid data sent after the valid command
layout.

This patch removes mlx5_modify_qp_mbox_in and changes
mlx5_core_qp_modify to receive the required transition and QP context
with opt_param_mask if needed.  This way the caller is not required to
provide the command inbox layout and it will be generated automatically.

mlx5_core_qp_modify will generate the command inbox/outbox layouts
according to the requested transition and will fill the requested
parameters.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/qp.c
drivers/net/ethernet/mellanox/mlx5/core/qp.c
include/linux/mlx5/qp.h