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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111128233004.GH3045@nuttenaction>
Date:	Tue, 29 Nov 2011 00:30:04 +0100
From:	Hagen Paul Pfeifer <hagen@...u.net>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	netdev@...r.kernel.org, Stephen Hemminger <shemminger@...tta.com>
Subject: Re: [PATCH v2 net-next 2/2] netem: add cell concept to simulate
 special MAC behavior

* Eric Dumazet | 2011-11-29 00:01:07 [+0100]:

>> -static psched_time_t packet_len_2_sched_time(unsigned int len, u32 rate)
>> +static psched_time_t packet_len_2_sched_time(unsigned int len,
>> +					     struct netem_sched_data *q)
>>  {
>> -	return PSCHED_NS2TICKS((u64)len * NSEC_PER_SEC / rate);
>> +	len += q->packet_overhead;
>> +
>> +	if (q->cell_size) {
>> +		u32 carry = len % q->cell_size;
>> +		len += carry;
>
>I dont understand this part  (len += carry;)

Say the original packet is 100 byte, cellsize is 40 byte: three full size link
layer frames are required: 40 + 40 + 40 == 100 + 20. This is used for TDMA,
ATM or slot schemes where the remainder cannot be used.

Later in code carry is reused if cell overhead is configured.

>Also you use a lot of divides... Probably OK for netem...

I know, but

1) the branch is not hot (not taken at all if rate is not called)
2) cell_size could not restricted to a power of two - so I saw no real
   optimization potential.


Hagen
--
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