[dpdk-dev] [PATCH v5] sched: make RED scaling configurable

Dewar, Alan ad759e at intl.att.com
Fri Jan 12 11:44:43 CET 2018


Hi Cristian,

> > +
> > +	rte_red_scaling -= count - RTE_RED_SCALING;
>
> Why not simply: rte_red_scaling = count?

The RED code stores the moving average in a uint32_t as a pseudo floating point number with a fixed sized fractional part of 10 bits.
This allows a maximum queue length of 1024.   To support larger queues, the size of the fixed size fractional part needs to be reduced.

To support a maximum queue length of 2048, we need to reduce the size of the fractional part to nine bits, for 4096 reduce the fractional part to eight bits etc.

Hence the "rte_red_scaling -= count - RTE_RED_SCALING;"

It is just coincidence that RTE_RED_SCALING is 10 and 1024 = 2**10.  

I hope that's clear, it took me a time to get my head around it again.

Regards
Alan



More information about the dev mailing list