]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: sched: store Qdisc pointer in struct block
authorJiri Pirko <jiri@mellanox.com>
Fri, 13 Oct 2017 12:00:57 +0000 (14:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Oct 2017 20:00:40 +0000 (21:00 +0100)
Prepare for removal of tp->q and store Qdisc pointer in the block
structure.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 files changed:
include/net/pkt_cls.h
include/net/sch_generic.h
net/sched/cls_api.c
net/sched/sch_atm.c
net/sched/sch_cbq.c
net/sched/sch_drr.c
net/sched/sch_dsmark.c
net/sched/sch_fq_codel.c
net/sched/sch_hfsc.c
net/sched/sch_htb.c
net/sched/sch_ingress.c
net/sched/sch_multiq.c
net/sched/sch_prio.c
net/sched/sch_qfq.c
net/sched/sch_sfb.c
net/sched/sch_sfq.c

index 60d39789e4f07d19269df1acf2c57d1d6058b348..e6c9e1e4d71154af554d2db5672639439f630af5 100644 (file)
@@ -22,7 +22,7 @@ struct tcf_chain *tcf_chain_get(struct tcf_block *block, u32 chain_index,
                                bool create);
 void tcf_chain_put(struct tcf_chain *chain);
 int tcf_block_get(struct tcf_block **p_block,
-                 struct tcf_proto __rcu **p_filter_chain);
+                 struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q);
 void tcf_block_put(struct tcf_block *block);
 int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                 struct tcf_result *res, bool compat_mode);
@@ -30,7 +30,7 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp,
 #else
 static inline
 int tcf_block_get(struct tcf_block **p_block,
-                 struct tcf_proto __rcu **p_filter_chain)
+                 struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q)
 {
        return 0;
 }
index 684d8ed27eaae995f4aa4faa4d6535b98263f813..df4032ca1b7ff65e0cb457de0f8e1b52c8cf1eb2 100644 (file)
@@ -270,6 +270,7 @@ struct tcf_chain {
 
 struct tcf_block {
        struct list_head chain_list;
+       struct Qdisc *q;
 };
 
 static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
index 2977b8a908514d27d95dca3662d7d71a2d5a2a1f..f7d3f1f539b7b18a40d3e94a9c4acf998705c6d0 100644 (file)
@@ -241,7 +241,7 @@ tcf_chain_filter_chain_ptr_set(struct tcf_chain *chain,
 }
 
 int tcf_block_get(struct tcf_block **p_block,
-                 struct tcf_proto __rcu **p_filter_chain)
+                 struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q)
 {
        struct tcf_block *block = kzalloc(sizeof(*block), GFP_KERNEL);
        struct tcf_chain *chain;
@@ -257,6 +257,7 @@ int tcf_block_get(struct tcf_block **p_block,
                goto err_chain_create;
        }
        tcf_chain_filter_chain_ptr_set(chain, p_filter_chain);
+       block->q = q;
        *p_block = block;
        return 0;
 
index c5fcdf1a58a08824aef5b48c790a019e17134967..2dbd249c0b2fc86c88995f34889c2e242bc98970 100644 (file)
@@ -281,7 +281,7 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
                goto err_out;
        }
 
-       error = tcf_block_get(&flow->block, &flow->filter_list);
+       error = tcf_block_get(&flow->block, &flow->filter_list, sch);
        if (error) {
                kfree(flow);
                goto err_out;
@@ -546,7 +546,7 @@ static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt)
                p->link.q = &noop_qdisc;
        pr_debug("atm_tc_init: link (%p) qdisc %p\n", &p->link, p->link.q);
 
-       err = tcf_block_get(&p->link.block, &p->link.filter_list);
+       err = tcf_block_get(&p->link.block, &p->link.filter_list, sch);
        if (err)
                return err;
 
index dcef97fa804739df3ae3bc837e1938f3914d6d4f..c3b92d62190e7293c18fd7a78b02c336e839065f 100644 (file)
@@ -1566,7 +1566,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
        if (cl == NULL)
                goto failure;
 
-       err = tcf_block_get(&cl->block, &cl->filter_list);
+       err = tcf_block_get(&cl->block, &cl->filter_list, sch);
        if (err) {
                kfree(cl);
                return err;
index 2d0e8d4bdc29b00d8d681e3cdeceac13420bf8bd..753dc7a77b60ead3b702ac07d1b2bc148c417626 100644 (file)
@@ -412,7 +412,7 @@ static int drr_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
        struct drr_sched *q = qdisc_priv(sch);
        int err;
 
-       err = tcf_block_get(&q->block, &q->filter_list);
+       err = tcf_block_get(&q->block, &q->filter_list, sch);
        if (err)
                return err;
        err = qdisc_class_hash_init(&q->clhash);
index 2836c80c7aa517f0da3c5771a68fa58b625c936b..fb4fb71c68cfa6557d042b2bbc5ccebc5493e8a4 100644 (file)
@@ -344,7 +344,7 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
        if (!opt)
                goto errout;
 
-       err = tcf_block_get(&p->block, &p->filter_list);
+       err = tcf_block_get(&p->block, &p->filter_list, sch);
        if (err)
                return err;
 
index de3b57ceca7bd625c874fbece917c944aabc26d8..3c40edeff1e888234e42182abe0a9e2a432a4fda 100644 (file)
@@ -481,7 +481,7 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt)
                        return err;
        }
 
-       err = tcf_block_get(&q->block, &q->filter_list);
+       err = tcf_block_get(&q->block, &q->filter_list, sch);
        if (err)
                return err;
 
index 3f88b75488b03275b152298bab0e66ea02298caa..a692184bd333a457d7cb39f7e6f41d4006f3e36d 100644 (file)
@@ -1033,7 +1033,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
        if (cl == NULL)
                return -ENOBUFS;
 
-       err = tcf_block_get(&cl->block, &cl->filter_list);
+       err = tcf_block_get(&cl->block, &cl->filter_list, sch);
        if (err) {
                kfree(cl);
                return err;
@@ -1405,7 +1405,7 @@ hfsc_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
                return err;
        q->eligible = RB_ROOT;
 
-       err = tcf_block_get(&q->root.block, &q->root.filter_list);
+       err = tcf_block_get(&q->root.block, &q->root.filter_list, sch);
        if (err)
                return err;
 
index c6d7ae81b41f4e277afb93a3003fefcd3f27de35..57be73c0e1d25084956465fcb16e40c1009cea38 100644 (file)
@@ -1030,7 +1030,7 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)
        if (!opt)
                return -EINVAL;
 
-       err = tcf_block_get(&q->block, &q->filter_list);
+       err = tcf_block_get(&q->block, &q->filter_list, sch);
        if (err)
                return err;
 
@@ -1393,7 +1393,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
                if (!cl)
                        goto failure;
 
-               err = tcf_block_get(&cl->block, &cl->filter_list);
+               err = tcf_block_get(&cl->block, &cl->filter_list, sch);
                if (err) {
                        kfree(cl);
                        goto failure;
index 44de4ee51ce9fe963cc722cbad25d7b9af21a5ee..9ccc1b89b0d998d4b6069ff19a6d48206c505fe3 100644 (file)
@@ -59,7 +59,7 @@ static int ingress_init(struct Qdisc *sch, struct nlattr *opt)
        struct net_device *dev = qdisc_dev(sch);
        int err;
 
-       err = tcf_block_get(&q->block, &dev->ingress_cl_list);
+       err = tcf_block_get(&q->block, &dev->ingress_cl_list, sch);
        if (err)
                return err;
 
@@ -153,11 +153,11 @@ static int clsact_init(struct Qdisc *sch, struct nlattr *opt)
        struct net_device *dev = qdisc_dev(sch);
        int err;
 
-       err = tcf_block_get(&q->ingress_block, &dev->ingress_cl_list);
+       err = tcf_block_get(&q->ingress_block, &dev->ingress_cl_list, sch);
        if (err)
                return err;
 
-       err = tcf_block_get(&q->egress_block, &dev->egress_cl_list);
+       err = tcf_block_get(&q->egress_block, &dev->egress_cl_list, sch);
        if (err)
                return err;
 
index ff4fc3e0facd7d98b504b5315d7cfe7d0ffdf68a..31e0a284eeff963c29d310156d8d4e51860f8c09 100644 (file)
@@ -245,7 +245,7 @@ static int multiq_init(struct Qdisc *sch, struct nlattr *opt)
        if (opt == NULL)
                return -EINVAL;
 
-       err = tcf_block_get(&q->block, &q->filter_list);
+       err = tcf_block_get(&q->block, &q->filter_list, sch);
        if (err)
                return err;
 
index 2dd6c68ae91eefe2f4e61b40f833f136c7576871..95fad348c8d78ad032b529d1d08adda4b5870227 100644 (file)
@@ -212,7 +212,7 @@ static int prio_init(struct Qdisc *sch, struct nlattr *opt)
        if (!opt)
                return -EINVAL;
 
-       err = tcf_block_get(&q->block, &q->filter_list);
+       err = tcf_block_get(&q->block, &q->filter_list, sch);
        if (err)
                return err;
 
index 6ddfd4991108ad9de057a22175d87f667c24f370..8694c7b6d2b191d8e909783f31050f735060f77a 100644 (file)
@@ -1419,7 +1419,7 @@ static int qfq_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
        int i, j, err;
        u32 max_cl_shift, maxbudg_shift, max_classes;
 
-       err = tcf_block_get(&q->block, &q->filter_list);
+       err = tcf_block_get(&q->block, &q->filter_list, sch);
        if (err)
                return err;
 
index cc39e170b4aa2593177cd9364465a5bffa49839d..487d375f5a0667b4e8aeec9851c1dd362493f014 100644 (file)
@@ -553,7 +553,7 @@ static int sfb_init(struct Qdisc *sch, struct nlattr *opt)
        struct sfb_sched_data *q = qdisc_priv(sch);
        int err;
 
-       err = tcf_block_get(&q->block, &q->filter_list);
+       err = tcf_block_get(&q->block, &q->filter_list, sch);
        if (err)
                return err;
 
index 74ea863b824009acb94b956facc889dd80970edf..123a53af2506bdbc61669640cb3df588d4048892 100644 (file)
@@ -725,7 +725,7 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt)
        setup_deferrable_timer(&q->perturb_timer, sfq_perturbation,
                               (unsigned long)sch);
 
-       err = tcf_block_get(&q->block, &q->filter_list);
+       err = tcf_block_get(&q->block, &q->filter_list, sch);
        if (err)
                return err;