> -----Original Message-----
> From: Dewar, Alan [mailto:ad7...@intl.att.com]
> Sent: Friday, January 12, 2018 10:45 AM
> To: Dumitrescu, Cristian <cristian.dumitre...@intel.com>;
> 'alangordonde...@gmail.com' <alangordonde...@gmail.com>
> Cc: 'dev@dpdk.org' <dev@dpdk.org>; 'Alan Dewar' <alan.de...@att.com>;
> Kantecki, Tomasz <tomasz.kante...@intel.com>; Singh, Jasvinder
> <jasvinder.si...@intel.com>
> Subject: RE: [PATCH v5] sched: make RED scaling configurable
> 
> 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

Hi Alan,

After taking to Tomasz, I can also confirm you're right, so let's keep your 
initial proposal here.

This line of code will only work if this function is called once at most (this 
was my rationale to suggest the change), but this is fine, as this is enforced 
by testing the red_init flag when this function starts.

Regards,
Cristian

Reply via email to