]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: sched: constify tcf_proto and tc_action
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 5 Jul 2011 23:25:42 +0000 (23:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Jul 2011 09:52:16 +0000 (02:52 -0700)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
23 files changed:
include/net/act_api.h
include/net/pkt_sched.h
include/net/sch_generic.h
net/sched/act_api.c
net/sched/act_csum.c
net/sched/act_gact.c
net/sched/act_ipt.c
net/sched/act_mirred.c
net/sched/act_nat.c
net/sched/act_pedit.c
net/sched/act_police.c
net/sched/act_simple.c
net/sched/act_skbedit.c
net/sched/cls_api.c
net/sched/cls_basic.c
net/sched/cls_cgroup.c
net/sched/cls_flow.c
net/sched/cls_fw.c
net/sched/cls_route.c
net/sched/cls_rsvp.h
net/sched/cls_tcindex.c
net/sched/cls_u32.c
net/sched/sch_api.c

index bab385f13ac32e81fd758e88811397a11964b64e..c739531e156492e573e431d329fe058d6c56e9df 100644 (file)
@@ -72,7 +72,7 @@ struct tcf_act_hdr {
 
 struct tc_action {
        void                    *priv;
-       struct tc_action_ops    *ops;
+       const struct tc_action_ops      *ops;
        __u32                   type; /* for backward compat(TCA_OLD_COMPAT) */
        __u32                   order;
        struct tc_action        *next;
@@ -86,7 +86,7 @@ struct tc_action_ops {
        __u32   type; /* TBD to match kind */
        __u32   capab;  /* capabilities includes 4 bit version */
        struct module           *owner;
-       int     (*act)(struct sk_buff *, struct tc_action *, struct tcf_result *);
+       int     (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *);
        int     (*get_stats)(struct sk_buff *, struct tc_action *);
        int     (*dump)(struct sk_buff *, struct tc_action *, int, int);
        int     (*cleanup)(struct tc_action *, int bind);
@@ -115,7 +115,7 @@ extern void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
 extern int tcf_register_action(struct tc_action_ops *a);
 extern int tcf_unregister_action(struct tc_action_ops *a);
 extern void tcf_action_destroy(struct tc_action *a, int bind);
-extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res);
+extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res);
 extern struct tc_action *tcf_action_init(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind);
 extern struct tc_action *tcf_action_init_1(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind);
 extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
index 65afc496620410c1fac61923f30802c367318daa..fffdc603f4c8f72ff9a67e0d64daee4cc87c4db3 100644 (file)
@@ -99,9 +99,9 @@ static inline void qdisc_run(struct Qdisc *q)
                __qdisc_run(q);
 }
 
-extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp,
+extern int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
                              struct tcf_result *res);
-extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
+extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                       struct tcf_result *res);
 
 /* Calculate maximal size of packet seen by hard_start_xmit
index b931f021d7ab4712f3fa553bef09229f5bf5aeb4..4fc88f3ccd5f870a1647024e33572233314f4681 100644 (file)
@@ -181,8 +181,9 @@ struct tcf_proto_ops {
        struct tcf_proto_ops    *next;
        char                    kind[IFNAMSIZ];
 
-       int                     (*classify)(struct sk_buff*, struct tcf_proto*,
-                                       struct tcf_result *);
+       int                     (*classify)(struct sk_buff *,
+                                           const struct tcf_proto *,
+                                           struct tcf_result *);
        int                     (*init)(struct tcf_proto*);
        void                    (*destroy)(struct tcf_proto*);
 
@@ -205,8 +206,9 @@ struct tcf_proto {
        /* Fast access part */
        struct tcf_proto        *next;
        void                    *root;
-       int                     (*classify)(struct sk_buff*, struct tcf_proto*,
-                                       struct tcf_result *);
+       int                     (*classify)(struct sk_buff *,
+                                           const struct tcf_proto *,
+                                           struct tcf_result *);
        __be16                  protocol;
 
        /* All the rest */
@@ -214,7 +216,7 @@ struct tcf_proto {
        u32                     classid;
        struct Qdisc            *q;
        void                    *data;
-       struct tcf_proto_ops    *ops;
+       const struct tcf_proto_ops      *ops;
 };
 
 struct qdisc_skb_cb {
index 2f64262ab5d23d63826cc9afc67816b0dfcfe059..f2fb67e701a36a69b6a8beb0091363dd1b3ec4f7 100644 (file)
@@ -365,10 +365,10 @@ static struct tc_action_ops *tc_lookup_action_id(u32 type)
 }
 #endif
 
-int tcf_action_exec(struct sk_buff *skb, struct tc_action *act,
+int tcf_action_exec(struct sk_buff *skb, const struct tc_action *act,
                    struct tcf_result *res)
 {
-       struct tc_action *a;
+       const struct tc_action *a;
        int ret = -1;
 
        if (skb->tc_verd & TC_NCLS) {
index 6cdf9abe475f065aa2b5d9c648131e80932bdeb0..453a73431ac47b8688a207b22d90f647dfc3eef4 100644 (file)
@@ -500,7 +500,7 @@ fail:
 }
 
 static int tcf_csum(struct sk_buff *skb,
-                   struct tc_action *a, struct tcf_result *res)
+                   const struct tc_action *a, struct tcf_result *res)
 {
        struct tcf_csum *p = a->priv;
        int action;
index 2b4ab4b05ce84843a30c1a378371bea829cdf3a5..b77f5a06a658f56bf3733ab72918aa63aedd1c16 100644 (file)
@@ -125,7 +125,8 @@ static int tcf_gact_cleanup(struct tc_action *a, int bind)
        return 0;
 }
 
-static int tcf_gact(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res)
+static int tcf_gact(struct sk_buff *skb, const struct tc_action *a,
+                   struct tcf_result *res)
 {
        struct tcf_gact *gact = a->priv;
        int action = TC_ACT_SHOT;
index 9fc211a1b20e6c1d344bcd99d756824c76d2de91..60f8f616e8fa2c7b73df63dff52119622f036168 100644 (file)
@@ -195,7 +195,7 @@ static int tcf_ipt_cleanup(struct tc_action *a, int bind)
        return tcf_ipt_release(ipt, bind);
 }
 
-static int tcf_ipt(struct sk_buff *skb, struct tc_action *a,
+static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a,
                   struct tcf_result *res)
 {
        int ret = 0, result = 0;
index 961386e2f2c08e0dffdd496b9bc7af2cc6eb04d0..102fc212cd64093726dffa311ba41716d2cc0250 100644 (file)
@@ -154,7 +154,7 @@ static int tcf_mirred_cleanup(struct tc_action *a, int bind)
        return 0;
 }
 
-static int tcf_mirred(struct sk_buff *skb, struct tc_action *a,
+static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
                      struct tcf_result *res)
 {
        struct tcf_mirred *m = a->priv;
index 762b027650a904a7cfd8d0bb62222423adba0a36..001d1b354869a18f06df2b7fd0fee14870bdb343 100644 (file)
@@ -102,7 +102,7 @@ static int tcf_nat_cleanup(struct tc_action *a, int bind)
        return tcf_hash_release(&p->common, bind, &nat_hash_info);
 }
 
-static int tcf_nat(struct sk_buff *skb, struct tc_action *a,
+static int tcf_nat(struct sk_buff *skb, const struct tc_action *a,
                   struct tcf_result *res)
 {
        struct tcf_nat *p = a->priv;
index 7affe9a92757d1611065b54c047b9f6f75f09faa..10d3aed86560973f0b91daabcd3ddfb62777c3a9 100644 (file)
@@ -120,7 +120,7 @@ static int tcf_pedit_cleanup(struct tc_action *a, int bind)
        return 0;
 }
 
-static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
+static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
                     struct tcf_result *res)
 {
        struct tcf_pedit *p = a->priv;
index b3b9b32f4e007de4b04af3385604a984c4cb88ca..6fb3f5af0f85c69e6be7c90f71242fa073f87691 100644 (file)
@@ -282,7 +282,7 @@ static int tcf_act_police_cleanup(struct tc_action *a, int bind)
        return ret;
 }
 
-static int tcf_act_police(struct sk_buff *skb, struct tc_action *a,
+static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a,
                          struct tcf_result *res)
 {
        struct tcf_police *police = a->priv;
index a34a22de60b3c65e0ed3b4613fe77e329663fe83..73e0a3ab4d55a0150045512771036330e4ca737b 100644 (file)
@@ -36,7 +36,8 @@ static struct tcf_hashinfo simp_hash_info = {
 };
 
 #define SIMP_MAX_DATA  32
-static int tcf_simp(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res)
+static int tcf_simp(struct sk_buff *skb, const struct tc_action *a,
+                   struct tcf_result *res)
 {
        struct tcf_defact *d = a->priv;
 
index 5f6f0c7c39059bb2f94bf69438bb324891a88a41..35dbbe91027e3734e1b9ccd52b5b9ce2edbcbf5a 100644 (file)
@@ -39,7 +39,7 @@ static struct tcf_hashinfo skbedit_hash_info = {
        .lock   =       &skbedit_lock,
 };
 
-static int tcf_skbedit(struct sk_buff *skb, struct tc_action *a,
+static int tcf_skbedit(struct sk_buff *skb, const struct tc_action *a,
                       struct tcf_result *res)
 {
        struct tcf_skbedit *d = a->priv;
index 9563887f219f64f55e8262ecd8483270c00b1980..a69d44f1dac51786bed33220446629761df6de85 100644 (file)
@@ -40,9 +40,9 @@ static DEFINE_RWLOCK(cls_mod_lock);
 
 /* Find classifier type by string name */
 
-static struct tcf_proto_ops *tcf_proto_lookup_ops(struct nlattr *kind)
+static const struct tcf_proto_ops *tcf_proto_lookup_ops(struct nlattr *kind)
 {
-       struct tcf_proto_ops *t = NULL;
+       const struct tcf_proto_ops *t = NULL;
 
        if (kind) {
                read_lock(&cls_mod_lock);
@@ -132,7 +132,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
        struct Qdisc  *q;
        struct tcf_proto **back, **chain;
        struct tcf_proto *tp;
-       struct tcf_proto_ops *tp_ops;
+       const struct tcf_proto_ops *tp_ops;
        const struct Qdisc_class_ops *cops;
        unsigned long cl;
        unsigned long fh;
index 8be8872dd571c168c798807f0dc89a3dbb4d859c..ea1f70b5a5f4747f2988c0b354a0abac7f2443da 100644 (file)
@@ -39,7 +39,7 @@ static const struct tcf_ext_map basic_ext_map = {
        .police = TCA_BASIC_POLICE
 };
 
-static int basic_classify(struct sk_buff *skb, struct tcf_proto *tp,
+static int basic_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                          struct tcf_result *res)
 {
        int r;
index 32a335194ca51e8dfb356d7a8a13f930e0cf247e..f84fdc3a7f279219d8bf3e8e97683562d748f711 100644 (file)
@@ -101,7 +101,7 @@ struct cls_cgroup_head {
        struct tcf_ematch_tree  ematches;
 };
 
-static int cls_cgroup_classify(struct sk_buff *skb, struct tcf_proto *tp,
+static int cls_cgroup_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                               struct tcf_result *res)
 {
        struct cls_cgroup_head *head = tp->root;
index 34533a5d1b3af317b55955c36da2ba4970d2c9ff..6994214db8f84d652360d6edcf30f9bb7f94af7d 100644 (file)
@@ -356,7 +356,7 @@ static u32 flow_key_get(struct sk_buff *skb, int key)
        }
 }
 
-static int flow_classify(struct sk_buff *skb, struct tcf_proto *tp,
+static int flow_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                         struct tcf_result *res)
 {
        struct flow_head *head = tp->root;
index 26e7bc4ffb79fc32e18a6bf678f3ee80824fcf2c..389af152ec45ae2e3a50313dd36a5797ef4a4048 100644 (file)
@@ -77,7 +77,7 @@ static inline int fw_hash(u32 handle)
                return handle & (HTSIZE - 1);
 }
 
-static int fw_classify(struct sk_buff *skb, struct tcf_proto *tp,
+static int fw_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                          struct tcf_result *res)
 {
        struct fw_head *head = (struct fw_head *)tp->root;
index a907905376dfb4913d16dcd2d11bcb456bf5504a..13ab66e9df585d884d687feaa77baf6bc017c8c5 100644 (file)
@@ -125,7 +125,7 @@ static inline int route4_hash_wild(void)
        return 0;                                               \
 }
 
-static int route4_classify(struct sk_buff *skb, struct tcf_proto *tp,
+static int route4_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                           struct tcf_result *res)
 {
        struct route4_head *head = (struct route4_head *)tp->root;
index ed691b148384218de903207dbd923becd131938d..be4505ee67a9f90dbaa5a8ad951ea9f220b27f13 100644 (file)
@@ -130,7 +130,7 @@ static struct tcf_ext_map rsvp_ext_map = {
                return r;                               \
 }
 
-static int rsvp_classify(struct sk_buff *skb, struct tcf_proto *tp,
+static int rsvp_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                         struct tcf_result *res)
 {
        struct rsvp_session **sht = ((struct rsvp_head *)tp->root)->ht;
index 36667fa64237902e52e11885745eb147be849394..dbe199234c6384bd553c5ac743600ac9886bff3b 100644 (file)
@@ -79,7 +79,7 @@ tcindex_lookup(struct tcindex_data *p, u16 key)
 }
 
 
-static int tcindex_classify(struct sk_buff *skb, struct tcf_proto *tp,
+static int tcindex_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                            struct tcf_result *res)
 {
        struct tcindex_data *p = PRIV(tp);
index 3b93fc0c89553829d2dea610d550b77cfb3be494..939b627b4795f7852323fbd8673a47b43ac1e61b 100644 (file)
@@ -93,7 +93,7 @@ static inline unsigned int u32_hash_fold(__be32 key,
        return h;
 }
 
-static int u32_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_result *res)
+static int u32_classify(struct sk_buff *skb, const struct tcf_proto *tp, struct tcf_result *res)
 {
        struct {
                struct tc_u_knode *knode;
index 8182aefafb028f39ceda64e1e93b52b87448cf61..dca6c1a576f77e70ee7cab5c187946c96a7219d2 100644 (file)
@@ -1644,7 +1644,7 @@ done:
  * to this qdisc, (optionally) tests for protocol and asks
  * specific classifiers.
  */
-int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp,
+int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
                       struct tcf_result *res)
 {
        __be16 protocol = skb->protocol;
@@ -1668,12 +1668,12 @@ int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp,
 }
 EXPORT_SYMBOL(tc_classify_compat);
 
-int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
+int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                struct tcf_result *res)
 {
        int err = 0;
 #ifdef CONFIG_NET_CLS_ACT
-       struct tcf_proto *otp = tp;
+       const struct tcf_proto *otp = tp;
 reclassify:
 #endif