]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/sched/cls_api.c
net/sched: cls_flower: Add offload support using egress Hardware device
[karo-tx-linux.git] / net / sched / cls_api.c
index 2ee29a3375f6672812e45e12250ec90ac1ed892c..3fbba79a4ef0521604df48275fb7dae8a8b7099e 100644 (file)
@@ -345,7 +345,8 @@ replay:
                        if (err == 0) {
                                struct tcf_proto *next = rtnl_dereference(tp->next);
 
-                               tfilter_notify(net, skb, n, tp, fh,
+                               tfilter_notify(net, skb, n, tp,
+                                              t->tcm_handle,
                                               RTM_DELTFILTER, false);
                                if (tcf_destroy(tp, false))
                                        RCU_INIT_POINTER(*back, next);
@@ -429,7 +430,8 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb,
        if (!skb)
                return -ENOBUFS;
 
-       if (tcf_fill_node(net, skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) {
+       if (tcf_fill_node(net, skb, tp, fh, portid, n->nlmsg_seq,
+                         n->nlmsg_flags, event) <= 0) {
                kfree_skb(skb);
                return -EINVAL;
        }
@@ -680,6 +682,30 @@ int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts)
 }
 EXPORT_SYMBOL(tcf_exts_dump_stats);
 
+int tcf_exts_get_dev(struct net_device *dev, struct tcf_exts *exts,
+                    struct net_device **hw_dev)
+{
+#ifdef CONFIG_NET_CLS_ACT
+       const struct tc_action *a;
+       LIST_HEAD(actions);
+
+       if (tc_no_actions(exts))
+               return -EINVAL;
+
+       tcf_exts_to_list(exts, &actions);
+       list_for_each_entry(a, &actions, list) {
+               if (a->ops->get_dev) {
+                       a->ops->get_dev(a, dev_net(dev), hw_dev);
+                       break;
+               }
+       }
+       if (*hw_dev)
+               return 0;
+#endif
+       return -EOPNOTSUPP;
+}
+EXPORT_SYMBOL(tcf_exts_get_dev);
+
 static int __init tc_filter_init(void)
 {
        rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_ctl_tfilter, NULL, NULL);