mbox series

[v8,00/10] ethdev: datapath-focused flow rules management

Message ID 20220220034409.2226860-1-akozyrev@nvidia.com (mailing list archive)
Headers
Series ethdev: datapath-focused flow rules management |

Message

Alexander Kozyrev Feb. 20, 2022, 3:43 a.m. UTC
  Three major changes to a generic RTE Flow API were implemented in order
to speed up flow rule insertion/destruction and adapt the API to the
needs of a datapath-focused flow rules management applications:

1. Pre-configuration hints.
Application may give us some hints on what type of resources are needed.
Introduce the configuration routine to prepare all the needed resources
inside a PMD/HW before any flow rules are created at the init stage.

2. Flow grouping using templates.
Use the knowledge about which flow rules are to be used in an application
and prepare item and action templates for them in advance. Group flow rules
with common patterns and actions together for better resource management.

3. Queue-based flow management.
Perform flow rule insertion/destruction asynchronously to spare the datapath
from blocking on RTE Flow API and allow it to continue with packet processing.
Enqueue flow rules operations and poll for the results later.

testpmd examples are part of the patch series. PMD changes will follow.

RFC: https://patchwork.dpdk.org/project/dpdk/cover/20211006044835.3936226-1-akozyrev@nvidia.com/

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

---
v8: fixed documentation indentation

v7:
- added sanity checks and device state validation
- added flow engine state validation
- added ingress/egress/transfer attibutes to templates
- moved user_data to a parameter list
- renamed asynchronous functions from "_q_" to "_async_"
- created a separate commit for indirect actions

v6: addressed more review comments
- fixed typos
- rewrote code snippets
- add a way to get queue size
- renamed port/queue attibutes parameters

v5: changed titles for testpmd commits

v4: 
- removed structures versioning
- introduced new rte_flow_port_info structure for rte_flow_info_get API
- renamed rte_flow_table_create to rte_flow_template_table_create

v3: addressed review comments and updated documentation
- added API to get info about pre-configurable resources
- renamed rte_flow_item_template to rte_flow_pattern_template
- renamed drain operation attribute to postpone
- renamed rte_flow_q_drain to rte_flow_q_push
- renamed rte_flow_q_dequeue to rte_flow_q_pull

v2: fixed patch series thread

Alexander Kozyrev (11):
  ethdev: introduce flow engine configuration
  ethdev: add flow item/action templates
  ethdev: bring in async queue-based flow rules operations
  ethdev: bring in async indirect actions operations
  app/testpmd: add flow engine configuration
  app/testpmd: add flow template management
  app/testpmd: add flow table management
  app/testpmd: add async flow create/destroy operations
  app/testpmd: add flow queue push operation
  app/testpmd: add flow queue pull operation
  app/testpmd: add async indirect actions operations

 app/test-pmd/cmdline_flow.c                   | 1726 ++++++++++++++++-
 app/test-pmd/config.c                         |  778 ++++++++
 app/test-pmd/testpmd.h                        |   67 +
 .../prog_guide/img/rte_flow_async_init.svg    |  205 ++
 .../prog_guide/img/rte_flow_async_usage.svg   |  354 ++++
 doc/guides/prog_guide/rte_flow.rst            |  345 ++++
 doc/guides/rel_notes/release_22_03.rst        |   26 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst   |  383 +++-
 lib/ethdev/ethdev_driver.h                    |    7 +-
 lib/ethdev/rte_flow.c                         |  500 +++++
 lib/ethdev/rte_flow.h                         |  766 ++++++++
 lib/ethdev/rte_flow_driver.h                  |  108 ++
 lib/ethdev/version.map                        |   15 +
 13 files changed, 5184 insertions(+), 96 deletions(-)
 create mode 100644 doc/guides/prog_guide/img/rte_flow_async_init.svg
 create mode 100644 doc/guides/prog_guide/img/rte_flow_async_usage.svg
  

Comments

Ferruh Yigit Feb. 22, 2022, 4:41 p.m. UTC | #1
On 2/20/2022 3:43 AM, Alexander Kozyrev wrote:
> Three major changes to a generic RTE Flow API were implemented in order
> to speed up flow rule insertion/destruction and adapt the API to the
> needs of a datapath-focused flow rules management applications:
> 
> 1. Pre-configuration hints.
> Application may give us some hints on what type of resources are needed.
> Introduce the configuration routine to prepare all the needed resources
> inside a PMD/HW before any flow rules are created at the init stage.
> 
> 2. Flow grouping using templates.
> Use the knowledge about which flow rules are to be used in an application
> and prepare item and action templates for them in advance. Group flow rules
> with common patterns and actions together for better resource management.
> 
> 3. Queue-based flow management.
> Perform flow rule insertion/destruction asynchronously to spare the datapath
> from blocking on RTE Flow API and allow it to continue with packet processing.
> Enqueue flow rules operations and poll for the results later.
> 
> testpmd examples are part of the patch series. PMD changes will follow.
> 
> RFC:https://patchwork.dpdk.org/project/dpdk/cover/20211006044835.3936226-1-akozyrev@nvidia.com/
> 
> Signed-off-by: Alexander Kozyrev<akozyrev@nvidia.com>
> Acked-by: Ori Kam<orika@nvidia.com>
> Acked-by: Ajit Khaparde<ajit.khaparde@broadcom.com>

Since these are new APIs and won't impact existing code, I think
can be OK to get with -rc2, only concern may be testing.

@Andrew, can you please review this version too, if it is good
for you, we can proceed.
  
Ferruh Yigit Feb. 22, 2022, 4:49 p.m. UTC | #2
On 2/22/2022 4:41 PM, Ferruh Yigit wrote:
> On 2/20/2022 3:43 AM, Alexander Kozyrev wrote:
>> Three major changes to a generic RTE Flow API were implemented in order
>> to speed up flow rule insertion/destruction and adapt the API to the
>> needs of a datapath-focused flow rules management applications:
>>
>> 1. Pre-configuration hints.
>> Application may give us some hints on what type of resources are needed.
>> Introduce the configuration routine to prepare all the needed resources
>> inside a PMD/HW before any flow rules are created at the init stage.
>>
>> 2. Flow grouping using templates.
>> Use the knowledge about which flow rules are to be used in an application
>> and prepare item and action templates for them in advance. Group flow rules
>> with common patterns and actions together for better resource management.
>>
>> 3. Queue-based flow management.
>> Perform flow rule insertion/destruction asynchronously to spare the datapath
>> from blocking on RTE Flow API and allow it to continue with packet processing.
>> Enqueue flow rules operations and poll for the results later.
>>
>> testpmd examples are part of the patch series. PMD changes will follow.
>>
>> RFC:https://patchwork.dpdk.org/project/dpdk/cover/20211006044835.3936226-1-akozyrev@nvidia.com/
>>
>> Signed-off-by: Alexander Kozyrev<akozyrev@nvidia.com>
>> Acked-by: Ori Kam<orika@nvidia.com>
>> Acked-by: Ajit Khaparde<ajit.khaparde@broadcom.com>
> 
> Since these are new APIs and won't impact existing code, I think
> can be OK to get with -rc2, only concern may be testing.
> 
> @Andrew, can you please review this version too, if it is good
> for you, we can proceed.

And this supposed to be a reply to v9, please review it:
https://patches.dpdk.org/user/todo/dpdk/?series=21774