net/mlx4_core: Adjust the schedule queue port for single ported IB VFs
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 21 May 2015 12:14:08 +0000 (15:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 May 2015 03:05:09 +0000 (23:05 -0400)
Some VF drivers flow set the schedule queue in the QP context but
without setting none of OPTPAR_SCHED_QUEUE or OPTPAR_PRIMARY_ADDR_PATH.

To allow for such non-modified drivers to function as single ported
IB VFs, we must adjust the schedule queue port whenever being set,
e.g as currently done for single ported Eth VFs.

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 bafe2180cf0c413c4d971f8043e401a018dc8100..82d562b90865e1df340f5b4720adc2d7f9ca4774 100644 (file)
@@ -3526,8 +3526,8 @@ static int adjust_qp_sched_queue(struct mlx4_dev *dev, int slave,
        pri_sched_queue = (qpc->pri_path.sched_queue & ~(1 << 6)) |
                          ((port & 1) << 6);
 
-       if (optpar & MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH ||
-           mlx4_is_eth(dev, port + 1)) {
+       if (optpar & (MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH | MLX4_QP_OPTPAR_SCHED_QUEUE) ||
+           qpc->pri_path.sched_queue || mlx4_is_eth(dev, port + 1)) {
                qpc->pri_path.sched_queue = pri_sched_queue;
        }