net/mlx5: Open-code modify QP in steering module
authorLeon Romanovsky <leonro@mellanox.com>
Sat, 4 Apr 2020 15:25:48 +0000 (18:25 +0300)
committerLeon Romanovsky <leonro@mellanox.com>
Sun, 19 Apr 2020 12:53:18 +0000 (15:53 +0300)
Remove dependency on qp.c from SW steering by open
coding modify QP interface.

Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c

index 690e418..266b913 100644 (file)
@@ -585,8 +585,10 @@ static int dr_modify_qp_rst2init(struct mlx5_core_dev *mdev,
        MLX5_SET(qpc, qpc, rre, 1);
        MLX5_SET(qpc, qpc, rwe, 1);
 
-       return mlx5_core_qp_modify(mdev, MLX5_CMD_OP_RST2INIT_QP, 0, qpc,
-                                  &dr_qp->mqp);
+       MLX5_SET(rst2init_qp_in, in, opcode, MLX5_CMD_OP_RST2INIT_QP);
+       MLX5_SET(rst2init_qp_in, in, qpn, dr_qp->mqp.qpn);
+
+       return mlx5_cmd_exec_in(mdev, rst2init_qp, in);
 }
 
 static int dr_cmd_modify_qp_rtr2rts(struct mlx5_core_dev *mdev,
@@ -600,12 +602,13 @@ static int dr_cmd_modify_qp_rtr2rts(struct mlx5_core_dev *mdev,
 
        MLX5_SET(rtr2rts_qp_in, in, qpn, dr_qp->mqp.qpn);
 
-       MLX5_SET(qpc, qpc, log_ack_req_freq, 0);
        MLX5_SET(qpc, qpc, retry_count, attr->retry_cnt);
        MLX5_SET(qpc, qpc, rnr_retry, attr->rnr_retry);
 
-       return mlx5_core_qp_modify(mdev, MLX5_CMD_OP_RTR2RTS_QP, 0, qpc,
-                                  &dr_qp->mqp);
+       MLX5_SET(rtr2rts_qp_in, in, opcode, MLX5_CMD_OP_RTR2RTS_QP);
+       MLX5_SET(rtr2rts_qp_in, in, qpn, dr_qp->mqp.qpn);
+
+       return mlx5_cmd_exec_in(mdev, rtr2rts_qp, in);
 }
 
 static int dr_cmd_modify_qp_init2rtr(struct mlx5_core_dev *mdev,
@@ -636,8 +639,10 @@ static int dr_cmd_modify_qp_init2rtr(struct mlx5_core_dev *mdev,
        MLX5_SET(qpc, qpc, primary_address_path.vhca_port_num, attr->port_num);
        MLX5_SET(qpc, qpc, min_rnr_nak, 1);
 
-       return mlx5_core_qp_modify(mdev, MLX5_CMD_OP_INIT2RTR_QP, 0, qpc,
-                                  &dr_qp->mqp);
+       MLX5_SET(init2rtr_qp_in, in, opcode, MLX5_CMD_OP_INIT2RTR_QP);
+       MLX5_SET(init2rtr_qp_in, in, qpn, dr_qp->mqp.qpn);
+
+       return mlx5_cmd_exec_in(mdev, init2rtr_qp, in);
 }
 
 static int dr_prepare_qp_to_rts(struct mlx5dr_domain *dmn)