> > > Hi Alan, > > > > > > What is the intention of the new rte_red_set_scaling() function? > > > 1. Is it to be called only once, before any RED object gets created? > > > 2. Is it possible to call it post-init, but in this case any RED > > > object already created are not impacted (they continue to work)? > > > > > > If the answer is 2, then yes, we could simply drop the > > > __rte_red_reset() and do the RED globals reset as part of the > > > rte_red_set_scaling() function transparently. > > > > > > If the answer is 1, then we probably need to keep your approach: we > > > need a global rte_red_init_done flag, and rte_red_set_scaling() could > > > only be called at init time before any red objects are created. > > > > > > I probably need to spend more time assessing all the code implications. > > > > > > Regards, > > > Cristian > > > > Hi Alan, > > > > After talking to Tomasz, we agreed that 2. Is not an option, as any > previously created red object will be broken. > > > > So 1. Is the right answer, therefore this function can be called only once > and only before any red objects are created. So, IMO we should do this: > -when rte_red_init_done is true, we need to return error -when > rte_red_init_done is false, we need to perform red initialization and set this > flag > > > > Agree? > > Yes, as long as you're happy with keeping __rte_red_reset for the unit-tests. >
OK