struct net_device *dev = tp->q->dev_queue->dev;
        struct tc_to_netdev offload;
        struct tc_cls_matchall_offload mall_offload = {0};
+       int err;
 
        offload.type = TC_SETUP_MATCHALL;
        offload.cls_mall = &mall_offload;
        offload.cls_mall->exts = &head->exts;
        offload.cls_mall->cookie = cookie;
 
-       return dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol,
-                                            &offload);
+       err = dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle, tp->protocol,
+                                           &offload);
+       if (!err)
+               head->flags |= TCA_CLS_FLAGS_IN_HW;
+
+       return err;
 }
 
 static void mall_destroy_hw_filter(struct tcf_proto *tp,
                }
        }
 
+       if (!tc_in_hw(new->flags))
+               new->flags |= TCA_CLS_FLAGS_NOT_IN_HW;
+
        *arg = (unsigned long) head;
        rcu_assign_pointer(tp->root, new);
        if (head)