On 2/12/2024 6:12 PM, Gregory Etelson wrote:
> Template table creation API sets table flows capacity.
> If application needs more flows then the table was designed for,
> the following procedures must be completed:
> 1. Create a new template table with larger flows capacity.
> 2. Re-create existing flows in the new table and delete flows from
>    the original table.
> 3. Destroy original table.
> 
> Application cannot always execute that procedure:
> * Port may not have sufficient resources to allocate a new table
>   while maintaining original table.
> * Application may not have existing flows "recipes" to re-create
>   flows in a new table.
> 
> The patch defines a new API that allows application to resize
> existing template table:
> 
> * Resizable template table must be created with the
>   RTE_FLOW_TABLE_SPECIALIZE_RESIZABLE_TABLE bit set.
> 
> * Application resizes existing table with the
>   `rte_flow_template_table_resize()` function call.
>   The table resize procedure updates the table maximal flow number
>   only. Other table attributes are not affected by the table resize.
>   ** The table resize procedure must not interrupt
>      existing table flows operations in hardware.
>   ** The table resize procedure must not alter flow handles held by
>      application.
> 
> * After `rte_flow_template_table_resize()` returned, application must
>   update table flow rules by calling
>   `rte_flow_async_update_resized()`.
>   The call reconfigures internal flow resources for the new table
>   configuration.
>   The flow update must not interrupt hardware flow operations.
> 
> * After table flows were updated, application must call
>   `rte_flow_template_table_resize_complete()`.
>   The function releases PMD resources related to the original
>   table.
>   Application can start new table resize after
>   `rte_flow_template_table_resize_complete()` returned.
> 
> Testpmd commands:
> 
> * Create resizable template table
> flow template_table <port-id> create table_id <tbl-id> resizable \
>   [transfer|ingress|egres] group <group-id> \
>   rules_number <initial table capacity> \
>   pattern_template  <pt1> [ pattern_template <pt2> [ ... ]] \
>   actions_template  <at1> [ actions_template <at2> [ ... ]]
> 
> * Resize table:
> flow template_table <tbl-id> resize table_resize_id <tbl-id> \
>   table_resize_rules_num <new table capacity>
> 
> * Queue a flow update:
> flow queue <port-id> update_resized <tbl-id> rule <flow-id>
> 
> * Complete table resize:
> flow template_table <port-id> resize_complete table <tbl-id>
> 
> Signed-off-by: Gregory Etelson <getel...@nvidia.com>h
> Acked-by: Ori Kam <or...@nvidia.com>
>

There are some checkpatch warnings [1], but except that looks good to me

Acked-by: Ferruh Yigit <ferruh.yi...@amd.com>


@Thomas was reviewing the patch, I will wait him to proceed.



[1]
[PATCH] ethdev: add template table resize API

WARNING:REPEATED_WORD: Possible repeated word: 'template'
#567: FILE: doc/guides/rel_notes/release_24_03.rst:76:
+    Set when template template must be created with the resizable property.

WARNING:TYPO_SPELLING: 'wheather' may be misspelled - perhaps 'weather'?
#569: FILE: doc/guides/rel_notes/release_24_03.rst:78:
+    Query wheather template table can be resized.
           ^^^^^^^^

ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#801: FILE: lib/ethdev/rte_flow.h:5945:
+                         rte_flow_template_table_attr *tbl_attr);
                                                       ^
(better to join to "const struct" line)

Reply via email to