From: Yang Yingliang <yangyingliang@huawei.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: <stephen@networkplumber.org>, <netdev@vger.kernel.org>
Subject: Re: [PATCH iproute2 2/2] netem: add 64bit rates support
Date: Thu, 16 Jan 2014 10:28:59 +0800 [thread overview]
Message-ID: <52D743EB.9010701@huawei.com> (raw)
In-Reply-To: <1389801367.31367.345.camel@edumazet-glaptop2.roam.corp.google.com>
On 2014/1/15 23:56, Eric Dumazet wrote:
> On Wed, 2014-01-15 at 17:42 +0800, Yang Yingliang wrote:
>> netem support 64bit rates start from linux-3.13.
>> Add 64bit rates support in tc tools.
>>
>> tc qdisc show dev eth0
>> qdisc netem 1: dev eth4 root refcnt 2 limit 1000 rate 35Gbit
>>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>> tc/q_netem.c | 29 ++++++++++++++++++++++++-----
>> 1 file changed, 24 insertions(+), 5 deletions(-)
>>
[...]
>>
>> if (dist_data) {
>> if (addattr_l(n, MAX_DIST * sizeof(dist_data[0]),
>> @@ -522,6 +532,7 @@ static int netem_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>> struct tc_netem_qopt qopt;
>> const struct tc_netem_rate *rate = NULL;
>> int len = RTA_PAYLOAD(opt) - sizeof(qopt);
>> + __u64 *rate64 = NULL;
>
> __u64 rate64 = 0;
>
>> SPRINT_BUF(b1);
>>
>> if (opt == NULL)
>> @@ -572,6 +583,11 @@ static int netem_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>> return -1;
>> ecn = RTA_DATA(tb[TCA_NETEM_ECN]);
>> }
>> + if (tb[TCA_NETEM_RATE64]) {
>> + if (RTA_PAYLOAD(tb[TCA_NETEM_RATE64]) < sizeof(*rate64))
>> + return -1;
>> + rate64 = RTA_DATA(tb[TCA_NETEM_RATE64]);
>
> rate64 = rta_getattr_u64(tb[TCA_NETEM_RATE64]);
It looks better, I'll send a v2.
Thanks!
prev parent reply other threads:[~2014-01-16 2:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 9:42 [PATCH iproute2 0/2] two improvements in tc Yang Yingliang
2014-01-15 9:42 ` [PATCH iproute2 1/2] tbf: support sending burst/mtu to kernel directly Yang Yingliang
2014-01-15 9:42 ` [PATCH iproute2 2/2] netem: add 64bit rates support Yang Yingliang
2014-01-15 15:56 ` Eric Dumazet
2014-01-16 2:28 ` Yang Yingliang [this message]
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=52D743EB.9010701@huawei.com \
--to=yangyingliang@huawei.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).