aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5
diff options
context:
space:
mode:
authorSaeed Mahameed <saeedm@mellanox.com>2016-07-19 11:03:21 -0400
committerLeon Romanovsky <leon@kernel.org>2016-08-17 10:45:58 -0400
commit1a412fb1caa2c1b77719ccb5ed8b0c3c2bc65da7 (patch)
tree3932dca111e30df6cebae0a31679cddff00ce06e /include/linux/mlx5
parent09a7d9eca1a6cf5eb4f9abfdf8914db9dbd96f08 (diff)
{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>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r--include/linux/mlx5/qp.h20
1 files changed, 3 insertions, 17 deletions
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h
index 16e1efecaf66..0aacb2a7480d 100644
--- a/include/linux/mlx5/qp.h
+++ b/include/linux/mlx5/qp.h
@@ -479,6 +479,7 @@ struct mlx5_qp_path {
479 u8 rmac[6]; 479 u8 rmac[6];
480}; 480};
481 481
482/* FIXME: use mlx5_ifc.h qpc */
482struct mlx5_qp_context { 483struct mlx5_qp_context {
483 __be32 flags; 484 __be32 flags;
484 __be32 flags_pd; 485 __be32 flags_pd;
@@ -520,21 +521,6 @@ struct mlx5_qp_context {
520 u8 rsvd1[24]; 521 u8 rsvd1[24];
521}; 522};
522 523
523struct mlx5_modify_qp_mbox_in {
524 struct mlx5_inbox_hdr hdr;
525 __be32 qpn;
526 u8 rsvd0[4];
527 __be32 optparam;
528 u8 rsvd1[4];
529 struct mlx5_qp_context ctx;
530 u8 rsvd2[16];
531};
532
533struct mlx5_modify_qp_mbox_out {
534 struct mlx5_outbox_hdr hdr;
535 u8 rsvd0[8];
536};
537
538static inline struct mlx5_core_qp *__mlx5_qp_lookup(struct mlx5_core_dev *dev, u32 qpn) 524static inline struct mlx5_core_qp *__mlx5_qp_lookup(struct mlx5_core_dev *dev, u32 qpn)
539{ 525{
540 return radix_tree_lookup(&dev->priv.qp_table.tree, qpn); 526 return radix_tree_lookup(&dev->priv.qp_table.tree, qpn);
@@ -549,8 +535,8 @@ int mlx5_core_create_qp(struct mlx5_core_dev *dev,
549 struct mlx5_core_qp *qp, 535 struct mlx5_core_qp *qp,
550 u32 *in, 536 u32 *in,
551 int inlen); 537 int inlen);
552int mlx5_core_qp_modify(struct mlx5_core_dev *dev, u16 operation, 538int mlx5_core_qp_modify(struct mlx5_core_dev *dev, u16 opcode,
553 struct mlx5_modify_qp_mbox_in *in, int sqd_event, 539 u32 opt_param_mask, void *qpc,
554 struct mlx5_core_qp *qp); 540 struct mlx5_core_qp *qp);
555int mlx5_core_destroy_qp(struct mlx5_core_dev *dev, 541int mlx5_core_destroy_qp(struct mlx5_core_dev *dev,
556 struct mlx5_core_qp *qp); 542 struct mlx5_core_qp *qp);