net/mlx5e: Check for BlueFlame capability before allocating SQ uar
authorGal Pressman <galp@mellanox.com>
Mon, 27 Jun 2016 09:08:35 +0000 (12:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jun 2016 08:28:46 +0000 (04:28 -0400)
Previous to this patch mapping was always set to write combining without
checking whether BlueFlame is supported in the device.

Fixes: 0ba422410bbf ('net/mlx5: Fix global UAR mapping')
Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 4383f8c..793d7a1 100644 (file)
@@ -580,7 +580,7 @@ static int mlx5e_create_sq(struct mlx5e_channel *c,
        void *sqc_wq = MLX5_ADDR_OF(sqc, sqc, wq);
        int err;
 
-       err = mlx5_alloc_map_uar(mdev, &sq->uar, true);
+       err = mlx5_alloc_map_uar(mdev, &sq->uar, !!MLX5_CAP_GEN(mdev, bf));
        if (err)
                return err;