On  Thur, May 19, 2022 10:55 Dumitrescu, Cristian 
<cristian.dumitre...@intel.com>:
> I don't understand the purpose of this proposed API function, can you please
> explain?
> 
> It looks to me that you want to have an alternative way to create a meter
> profile, so why not use the existing API function rte_mtr_meter_profile_add() 
> ?
> It does the same thing.
> 
> Also, who allocates this opaque array meter_profile_cfg? Assuming it is the 
> user
> that needs to allocate it, how does the user know its size?

The creation of a meter is still done thru the rte_mtr_meter_profile_add() API.
It is responsible for memory allocation and parameters calculation.
The rte_mtr_meter_profile_get() API just returns the pointer to the object
allocated earlier, based on the Meter ID, saving the lookup time.
User still have to manage the lifecycle with add/destroy functions.
PMD allocates this opaque pointer and knows its size, user doesn't need to 
worry.
I hope that my examples in the meeting minutes explain this concept clear 
enough.

Reply via email to