Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #945
| From | Rainer Weikusat <rweikusat@mssgmbh.com> |
|---|---|
| Newsgroups | comp.unix.programmer, comp.programming |
| Subject | Re: weighted-fair queuing |
| Date | 2011-10-21 00:51 +0100 |
| Message-ID | <87fwin1atj.fsf@sapphire.mobileactivedefense.com> (permalink) |
| References | <j7qaa8$rnh$1@speranza.aioe.org> |
Cross-posted to 2 groups.
"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