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

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Fri Jan 12 12:43:19 CET 2018



> -----Original Message-----
> From: Dewar, Alan [mailto:ad759e at intl.att.com]
> Sent: Friday, January 12, 2018 10:45 AM
> To: Dumitrescu, Cristian <cristian.dumitrescu at intel.com>;
> 'alangordondewar at gmail.com' <alangordondewar at gmail.com>
> Cc: 'dev at dpdk.org' <dev at dpdk.org>; 'Alan Dewar' <alan.dewar at att.com>;
> Kantecki, Tomasz <tomasz.kantecki at intel.com>; Singh, Jasvinder
> <jasvinder.singh at 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



More information about the dev mailing list