net/mlx4_core: Adjust the schedule queue port in reset-to-init too
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 21 May 2015 12:14:09 +0000 (15:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 May 2015 03:05:10 +0000 (23:05 -0400)
It's legal for drivers to provide the QP port through the
QPC schedule-queue field on the reset-to-init QP state change.

Add adjusting of the schedule queue port in the SRIOV wrapper
for that operation too.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

index 82d562b90865e1df340f5b4720adc2d7f9ca4774..15ec0818165882cfa36c7a76dd15ec5c9a37b6ac 100644 (file)
@@ -2703,6 +2703,10 @@ static void adjust_proxy_tun_qkey(struct mlx4_dev *dev, struct mlx4_vhcr *vhcr,
        context->qkey = cpu_to_be32(qkey);
 }
 
+static int adjust_qp_sched_queue(struct mlx4_dev *dev, int slave,
+                                struct mlx4_qp_context *qpc,
+                                struct mlx4_cmd_mailbox *inbox);
+
 int mlx4_RST2INIT_QP_wrapper(struct mlx4_dev *dev, int slave,
                             struct mlx4_vhcr *vhcr,
                             struct mlx4_cmd_mailbox *inbox,
@@ -2725,6 +2729,10 @@ int mlx4_RST2INIT_QP_wrapper(struct mlx4_dev *dev, int slave,
        struct res_srq *srq;
        int local_qpn = be32_to_cpu(qpc->local_qpn) & 0xffffff;
 
+       err = adjust_qp_sched_queue(dev, slave, qpc, inbox);
+       if (err)
+               return err;
+
        err = qp_res_start_move_to(dev, slave, qpn, RES_QP_HW, &qp, 0);
        if (err)
                return err;