]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/pkt_cls.h
Merge tag 'mfd-for-linus-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
[karo-tx-linux.git] / include / net / pkt_cls.h
index c99508d426ccfe8220c992209a35f84589d09906..767b03a3fe67a5efdd59e7f9f53a0a1f8f588ff0 100644 (file)
@@ -69,17 +69,19 @@ struct tcf_exts {
        int police;
 };
 
-static inline void tcf_exts_init(struct tcf_exts *exts, int action, int police)
+static inline int tcf_exts_init(struct tcf_exts *exts, int action, int police)
 {
 #ifdef CONFIG_NET_CLS_ACT
        exts->type = 0;
        exts->nr_actions = 0;
        exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *),
                                GFP_KERNEL);
-       WARN_ON(!exts->actions); /* TODO: propagate the error to callers */
+       if (!exts->actions)
+               return -ENOMEM;
 #endif
        exts->action = action;
        exts->police = police;
+       return 0;
 }
 
 /**
@@ -121,7 +123,7 @@ static inline void tcf_exts_to_list(const struct tcf_exts *exts,
        for (i = 0; i < exts->nr_actions; i++) {
                struct tc_action *a = exts->actions[i];
 
-               list_add(&a->list, actions);
+               list_add_tail(&a->list, actions);
        }
 #endif
 }
@@ -484,4 +486,20 @@ struct tc_cls_matchall_offload {
        unsigned long cookie;
 };
 
+enum tc_clsbpf_command {
+       TC_CLSBPF_ADD,
+       TC_CLSBPF_REPLACE,
+       TC_CLSBPF_DESTROY,
+       TC_CLSBPF_STATS,
+};
+
+struct tc_cls_bpf_offload {
+       enum tc_clsbpf_command command;
+       struct tcf_exts *exts;
+       struct bpf_prog *prog;
+       const char *name;
+       bool exts_integrated;
+       u32 gen_flags;
+};
+
 #endif