[PATCH v7] ethdev: add template table resize API

Etelson, Gregory getelson at nvidia.com
Wed Feb 14 18:07:28 CET 2024


Hello Ferruh,

>
> Having conflict while applying the patch, can you please rebase it on
> latest 'next-net'?

Will rebase and update the patch.

>
>> +    Query wheather template table can be resized.
>>
>
> s/wheather/whether/
>
> <...>

fix in updated patch

>
>> +__rte_experimental
>> +bool
>> +rte_flow_template_table_resizable
>> +     (__rte_unused uint16_t port_id,
>> +      const struct rte_flow_template_table_attr *tbl_attr);
>> +
>
> Syntax above is odd, why not move parenthesis to first line.

Agree that's odd style.
DPDK prefers that way.
Please check rte_flow_driver.h::rte_flow.ops.

>
> This is different than previous version, I just want to confirm if this
> is intentional.

That API version was discussed with Thomas.
The alternative was to introduce additional function call to query
whether a flow rule needs conversion after table resize.
As the result, the application still needs to iterate on all
table flow rules.

>
> Rules created *before* resize must be updated.

That part remains. The application must update
flow rules created before resize.

> Rules created *after* resize not need to be updated, but if API accepts
> them and just returns a quick success,

Calling update for new rules will return success without flow update.

>this helps user and even user may
> prefer to not keep track of flows as before and after resize,

The application now does not need to differentiate table flow rules.
All table flow rules must be updated after table resize.

>
>> +/**
>> + * @warning
>> + * @b EXPERIMENTAL: this API may change without prior notice.
>> + *
>> + * Resume normal operational mode after table was resized and
>> + * table rules were updated for the new table configuration.
>> + *
>> + * @param port_id
>> + *   Port identifier of Ethernet device.
>> + * @param table
>> + *   Template table that undergoing resize operation.
>> + * @param error
>> + *   Perform verbose error reporting if not NULL.
>> + *   PMDs initialize this structure in case of error only.
>> + *
>> + * @return
>> + *   - (0) if success.
>> + *   - (-ENODEV) if *port_id* invalid.
>> + *   - (-ENOTSUP) if underlying device does not support this functionality.
>> + *   - (-EINVAL) if there are rules that were not updated or
>> + *               *table* cannot complete table resize,
>> + *               unrecoverable error.
>> + */
>> +__rte_experimental
>> +int
>> +rte_flow_template_table_resize_complete(uint16_t port_id,
>> +                                     struct rte_flow_template_table *table,
>> +                                     struct rte_flow_error *error);
>
> I think I asked this before but perhaps missed the response,
> it is possible that user missed to update all flows and called this API,
> it will return -EINVAL, in this case it is not clear for user if there
> is a unrecoverable error or just need to update more flows.
>
> What do you think to send a different error for the case that there are
> flows not updated, so user can action on this information.
>
>

A different error is good.
What about EBUSY ?


More information about the dev mailing list