Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #944

weighted-fair queuing

From "Mark" <mark_cruzNOTFORSPAM@hotmail.com>
Newsgroups comp.unix.programmer, comp.programming
Subject weighted-fair queuing
Date 2011-10-20 19:19 -0400
Organization Aioe.org NNTP Server
Message-ID <j7qaa8$rnh$1@speranza.aioe.org> (permalink)

Cross-posted to 2 groups.

Show all headers | View raw


Hello

I'm writing an application for embedded platform, and I need to utilize 
weighted-fair queuing scheduling algorithm supported by the target hardware. 
So I basically have to assign weight values correctly and commit it in 
registers, and here is some confusion.

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. So I came up 
with this simple approach:

#define MAX_WEIGHT_WFQ 131072u
#define QUEUES 8

static inline unsigned int mapweight(int weight)
{
    return ((MAX_WEIGHT_WFQ / QUEUES) * weight) / 10;
}

But it's not quite correct, it doesn't allow to fully utilize the available 
capacity of weight (131072). Thanks in advance for any comments.

Mark 

Back to comp.programming | Previous | Next — Next in thread | Find similar | Unroll thread


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