net: sched: move the can_offload check from binding phase to rule insertion phase
[linux-2.6-microblaze.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_main.c
index e810868..28ae00b 100644 (file)
@@ -3106,6 +3106,9 @@ int mlx5e_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
 {
        struct mlx5e_priv *priv = cb_priv;
 
+       if (!tc_can_offload(priv->netdev))
+               return -EOPNOTSUPP;
+
        switch (type) {
        case TC_SETUP_CLSFLOWER:
                return mlx5e_setup_tc_cls_flower(priv, type_data);
@@ -3141,8 +3144,6 @@ int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type,
 {
        switch (type) {
 #ifdef CONFIG_MLX5_ESWITCH
-       case TC_SETUP_CLSFLOWER:
-               return 0; /* will be removed after conversion from ndo */
        case TC_SETUP_BLOCK:
                return mlx5e_setup_tc_block(dev, type_data);
 #endif