net/mlx5e: Add qos capability check
authorHuy Nguyen <huyn@mellanox.com>
Sun, 27 Nov 2016 15:02:03 +0000 (17:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Nov 2016 20:09:34 +0000 (15:09 -0500)
Make sure firmware supports qos before exposing the DCB API.

Signed-off-by: Huy Nguyen <huyn@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 19403d6..2b42112 100644 (file)
@@ -3549,7 +3549,8 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
        if (MLX5_CAP_GEN(mdev, vport_group_manager)) {
                netdev->netdev_ops = &mlx5e_netdev_ops_sriov;
 #ifdef CONFIG_MLX5_CORE_EN_DCB
-               netdev->dcbnl_ops = &mlx5e_dcbnl_ops;
+               if (MLX5_CAP_GEN(mdev, qos))
+                       netdev->dcbnl_ops = &mlx5e_dcbnl_ops;
 #endif
        } else {
                netdev->netdev_ops = &mlx5e_netdev_ops_basic;