net/mlx5e: Enforce max flow-tables level >= 3
authorGal Pressman <galp@mellanox.com>
Thu, 11 Jun 2015 11:47:30 +0000 (14:47 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Jun 2015 22:55:25 +0000 (15:55 -0700)
The Ethernet driver requires at least 3 flow table levels to
operate, enforce that.

Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 9cc321a3acdfe7a3d53d9e6e1accece790b8e98f..5d480da801ce7ebc338e91756127032800cf6aea 100644 (file)
@@ -1663,7 +1663,10 @@ static int mlx5e_check_required_hca_cap(struct mlx5_core_dev *mdev)
            !MLX5_CAP_ETH(mdev, csum_cap) ||
            !MLX5_CAP_ETH(mdev, max_lso_cap) ||
            !MLX5_CAP_ETH(mdev, vlan_cap) ||
            !MLX5_CAP_ETH(mdev, csum_cap) ||
            !MLX5_CAP_ETH(mdev, max_lso_cap) ||
            !MLX5_CAP_ETH(mdev, vlan_cap) ||
-           !MLX5_CAP_ETH(mdev, rss_ind_tbl_cap)) {
+           !MLX5_CAP_ETH(mdev, rss_ind_tbl_cap) ||
+           MLX5_CAP_FLOWTABLE(mdev,
+                              flow_table_properties_nic_receive.max_ft_level)
+                              < 3) {
                mlx5_core_warn(mdev,
                               "Not creating net device, some required device capabilities are missing\n");
                return -ENOTSUPP;
                mlx5_core_warn(mdev,
                               "Not creating net device, some required device capabilities are missing\n");
                return -ENOTSUPP;