From: Yang Yingliang <yangyingliang@huawei.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: <eric.dumazet@gmail.com>
Subject: [PATCH 2/3] net: sched: htb: fix condition of failure when rate is 0
Date: Thu, 14 Nov 2013 17:01:53 +0800 [thread overview]
Message-ID: <1384419714-24364-3-git-send-email-yangyingliang@huawei.com> (raw)
In-Reply-To: <1384419714-24364-1-git-send-email-yangyingliang@huawei.com>
When rate32 is 0, it doesn't means wrong.
Because htb support 64bit rates now, it
could use rate64.
So change the condition, when rate32 and
rate64 are both 0, it goes to failure.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/sched/sch_htb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 0e1e38b..f983803 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1357,7 +1357,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
parent = parentid == TC_H_ROOT ? NULL : htb_find(parentid, sch);
hopt = nla_data(tb[TCA_HTB_PARMS]);
- if (!hopt->rate.rate || !hopt->ceil.rate)
+ if ((!hopt->rate.rate && !tb[TCA_HTB_RATE64]) ||
+ (!hopt->ceil.rate && !tb[TCA_HTB_CEIL64]))
goto failure;
/* Keeping backward compatible with rate_table based iproute2 tc */
--
1.7.12
next prev parent reply other threads:[~2013-11-14 9:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 9:01 [PATCH 0/3] net: sched: fix some issues introduced by 64bit rates Yang Yingliang
2013-11-14 9:01 ` [PATCH 1/3] net: sched: tbf: fix calculation of max_size Yang Yingliang
2013-11-14 14:38 ` Eric Dumazet
2013-11-15 7:23 ` Yang Yingliang
2013-11-14 9:01 ` Yang Yingliang [this message]
2013-11-14 14:37 ` [PATCH 2/3] net: sched: htb: fix condition of failure when rate is 0 Eric Dumazet
2013-11-14 9:01 ` [PATCH 3/3] net: sched: htb: fix calculation of quantum Yang Yingliang
2013-11-15 14:01 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1384419714-24364-3-git-send-email-yangyingliang@huawei.com \
--to=yangyingliang@huawei.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox