On 2024/10/9 16:07, Bruce Richardson wrote:
> On Wed, Oct 09, 2024 at 08:57:41AM +0800, fengchengwen wrote:
>> On 2024/10/8 22:43, Bruce Richardson wrote:
>>> Add function to allow querying a node in the scheduler tree. Returns
>>> the parameters as were given to the add function. Adding this function
>>> allows apps to just query the hierarchy rather than having to maintain
>>> their own copies of it internally.
>>>
>>> Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>
>>> ---
>
> Hi,
>
> thanks for the detailed review. Most comments are fine and will fix. One
> reply below for just one of them though.
>
> /Bruce
>
> <snip>
>>> + */
>>> +__rte_experimental
>>> +int
>>> +rte_tm_node_query(uint16_t port_id,
>>> + uint32_t node_id,
>>> + uint32_t *parent_node_id,
>>> + uint32_t *priority,
>>> + uint32_t *weight,
>>> + uint32_t *level_id,
>>> + struct rte_tm_node_params *params,
>>> + struct rte_tm_error *error);
>>> +
>>
>> Suggest this new function place after node_resume in header/impl.c(e.g.
>> source or trace), keep them consistency
>
> Why do you think it should go after node resume? I deliberately placed it
> after node_add function since the parameters are matching each other,
> whatever parameters you provided on add, you get returned to you on query.
To one object, we may have four basic operation: add/del/modify/query, I always
keep this order in .c/.h file.
As for the tm node case, we could treat node_suspend/node_resume as the modify
operation.
It is just a personal coding style. From my point of view, it's fine in that
order.
>
>