lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 16 Jan 2014 10:28:59 +0800
From:	Yang Yingliang <yangyingliang@...wei.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	<stephen@...workplumber.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH iproute2 2/2] netem: add 64bit rates support

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@...wei.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!

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ