diff options
author | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> | 2017-09-20 08:46:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-21 14:56:32 -0400 |
commit | 21f4d5cc25ec0e6e8eb8420dd2c399e6d2fc7d14 (patch) | |
tree | b6d820299994336c14458d8a198a1cb9fce79730 /net | |
parent | c8e1812960eeae42e2183154927028511c4bc566 (diff) |
net_sched/hfsc: fix curve activation in hfsc_change_class()
If real-time or fair-share curves are enabled in hfsc_change_class()
class isn't inserted into rb-trees yet. Thus init_ed() and init_vf()
must be called in place of update_ed() and update_vf().
Remove isn't required because for now curves cannot be disabled.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_hfsc.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index daaf214e5201..3f88b75488b0 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
@@ -958,6 +958,8 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, | |||
958 | } | 958 | } |
959 | 959 | ||
960 | if (cl != NULL) { | 960 | if (cl != NULL) { |
961 | int old_flags; | ||
962 | |||
961 | if (parentid) { | 963 | if (parentid) { |
962 | if (cl->cl_parent && | 964 | if (cl->cl_parent && |
963 | cl->cl_parent->cl_common.classid != parentid) | 965 | cl->cl_parent->cl_common.classid != parentid) |
@@ -978,6 +980,8 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, | |||
978 | } | 980 | } |
979 | 981 | ||
980 | sch_tree_lock(sch); | 982 | sch_tree_lock(sch); |
983 | old_flags = cl->cl_flags; | ||
984 | |||
981 | if (rsc != NULL) | 985 | if (rsc != NULL) |
982 | hfsc_change_rsc(cl, rsc, cur_time); | 986 | hfsc_change_rsc(cl, rsc, cur_time); |
983 | if (fsc != NULL) | 987 | if (fsc != NULL) |
@@ -986,10 +990,21 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, | |||
986 | hfsc_change_usc(cl, usc, cur_time); | 990 | hfsc_change_usc(cl, usc, cur_time); |
987 | 991 | ||
988 | if (cl->qdisc->q.qlen != 0) { | 992 | if (cl->qdisc->q.qlen != 0) { |
989 | if (cl->cl_flags & HFSC_RSC) | 993 | int len = qdisc_peek_len(cl->qdisc); |
990 | update_ed(cl, qdisc_peek_len(cl->qdisc)); | 994 | |
991 | if (cl->cl_flags & HFSC_FSC) | 995 | if (cl->cl_flags & HFSC_RSC) { |
992 | update_vf(cl, 0, cur_time); | 996 | if (old_flags & HFSC_RSC) |
997 | update_ed(cl, len); | ||
998 | else | ||
999 | init_ed(cl, len); | ||
1000 | } | ||
1001 | |||
1002 | if (cl->cl_flags & HFSC_FSC) { | ||
1003 | if (old_flags & HFSC_FSC) | ||
1004 | update_vf(cl, 0, cur_time); | ||
1005 | else | ||
1006 | init_vf(cl, len); | ||
1007 | } | ||
993 | } | 1008 | } |
994 | sch_tree_unlock(sch); | 1009 | sch_tree_unlock(sch); |
995 | 1010 | ||