net: sched: red: notify drivers about RED's limit parameter
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 12 Nov 2018 22:58:16 +0000 (14:58 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Nov 2018 16:51:28 +0000 (08:51 -0800)
RED qdisc's limit parameter changes the behaviour of the qdisc,
for instance if it's set to 0 qdisc will drop all the packets.

When replace operation happens and parameter is set to non-0
a new fifo qdisc will be instantiated and replace the old child
qdisc which will be destroyed.

Drivers need to know the parameter, even if they don't impose
the actual limit to be able to reliably reconstruct the Qdisc
hierarchy.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_cls.h
net/sched/sch_red.c

index 5d31820b7e805618a464e24e1486ce4385f13145..c497ada7f591e95ad12191941268b21d33412bff 100644 (file)
@@ -850,6 +850,7 @@ struct tc_red_qopt_offload_params {
        u32 min;
        u32 max;
        u32 probability;
+       u32 limit;
        bool is_ecn;
        bool is_harddrop;
        struct gnet_stats_queue *qstats;
index 4b5ca172ee2da41c36dcc7d2d2ea76e6715d28f4..9df9942340eaaa30ed38fc3345649f287a373bee 100644 (file)
@@ -166,6 +166,7 @@ static int red_offload(struct Qdisc *sch, bool enable)
                opt.set.min = q->parms.qth_min >> q->parms.Wlog;
                opt.set.max = q->parms.qth_max >> q->parms.Wlog;
                opt.set.probability = q->parms.max_P;
+               opt.set.limit = q->limit;
                opt.set.is_ecn = red_use_ecn(q);
                opt.set.is_harddrop = red_use_harddrop(q);
                opt.set.qstats = &sch->qstats;