Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #945
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Rainer Weikusat <rweikusat@mssgmbh.com> |
| Newsgroups | comp.unix.programmer, comp.programming |
| Subject | Re: weighted-fair queuing |
| Date | Fri, 21 Oct 2011 00:51:20 +0100 |
| Lines | 19 |
| Message-ID | <87fwin1atj.fsf@sapphire.mobileactivedefense.com> (permalink) |
| References | <j7qaa8$rnh$1@speranza.aioe.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| X-Trace | individual.net lUcZoQWHIeNTXNnHeTqKog5+eHHUYAVs9my5kV/CTbChZpQuM= |
| Cancel-Lock | sha1:vbgxwyFUWmpYCHU9xhhAkX9OOpc= sha1:Ipno+YxS8WcNytA+bhwJDAYNsTY= |
| User-Agent | Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
| Xref | x330-a1.tempe.blueboxinc.net comp.unix.programmer:1447 comp.programming:945 |
Cross-posted to 2 groups.
Show key headers only | View raw
"Mark" <mark_cruzNOTFORSPAM@hotmail.com> writes:
[...]
> Weights that can be assigned by user from upper layer software are in range
> 1-32, the max weight value in h/w is 131072, therefore I need some way to
> scale down input value (1-32) to properly fit in the hardware.
This looks rather as if you would need to scale it up. Given that you
need to map a value in the range (1, 2^5) [2^5 ::= 2 to the fifth
power] to the range (0, 2^17), an obvious idea would be
static inline unsigned map_weight(unsigned weight)
{
return weight * (1 << 12);
}
(since 2^17/2^5 = 2^12, 131072 / 32 = 4096).
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
weighted-fair queuing "Mark" <mark_cruzNOTFORSPAM@hotmail.com> - 2011-10-20 19:19 -0400
Re: weighted-fair queuing Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-10-21 00:51 +0100
Re: weighted-fair queuing Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-10-21 02:42 +0100
Re: weighted-fair queuing "Mark" <mark_cruzNOTFORSPAM@hotmail.com> - 2011-10-21 21:28 -0400
csiph-web