mbox series

[v2,0/4] ethdev: add template table insertion and matching types

Message ID 20230126232802.3960109-1-akozyrev@nvidia.com (mailing list archive)
Headers
Series ethdev: add template table insertion and matching types |

Message

Alexander Kozyrev Jan. 26, 2023, 11:27 p.m. UTC
  Bring more flexibility and control over both flow rule insertion
and packet matching mechanisms. Introduce 2 new flow table types:

1. Allow a user to specify the insertion type used in template tables.
The insertion type is responsible for choosing the appropriate key
value used to map inserted flow rules into a template table.

Flow rules can be inserted by calculating the hash value for
the pattern or inserted by index via the new create_by_index() API.
The idea of the index-based insertion is to avoid additional matches
and simply execute predefined actions after jumping to the index.

The insertion into an already occupied index results in an error.
The old rule must be destroyed first. An index cannot be bigger than
the size of the table, otherwise, the rule is rejected as well.

2. Allow a user to specify the hash calculation function used in template
tables. The hash calculation type is responsible for the calculation of
the flow rule index a packet would hit upon arrival at the table.

Control over this is useful for applications with custom RSS algorithms,
for example. An application can select various packet fields to serve as
a hash calculation source and jump to the appropriate flow rule location.
The RSS hash result will be used as the index in the table. For the linear
hash function, the mapping is one-to-one and the hash result is the index.
For other hash functions, the index is the hash result module table size.
The RSS hash result can be retrieved via modify_field API: HASH_RESULT.

RFC: https://patchwork.dpdk.org/project/dpdk/patch/20221214022110.393410-1-akozyrev@nvidia.com/
v2: changed the behavior in case of insertion into the same index.
 
Alexander Kozyrev (4):
  ethdev: add template table insertion type
  ethdev: add template table hash calculation function
  app/testpmd: add template table insertion type
  app/testpmd: add template table hash calculation function

 app/test-pmd/cmdline_flow.c            | 166 +++++++++++++++++++++++--
 app/test-pmd/config.c                  |  10 +-
 app/test-pmd/testpmd.h                 |   2 +-
 doc/guides/prog_guide/rte_flow.rst     |  20 +++
 doc/guides/rel_notes/release_23_03.rst |  10 ++
 lib/ethdev/rte_flow.c                  |  24 ++++
 lib/ethdev/rte_flow.h                  |  95 ++++++++++++++
 lib/ethdev/rte_flow_driver.h           |  11 ++
 lib/ethdev/version.map                 |   3 +
 9 files changed, 330 insertions(+), 11 deletions(-)
  

Comments

Ori Kam Feb. 1, 2023, 4:09 p.m. UTC | #1
Hi Alex,


> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Friday, 27 January 2023 1:28
> To: dev@dpdk.org
> Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> ferruh.yigit@amd.com; andrew.rybchenko@oktetlabs.ru; Ori Kam
> <orika@nvidia.com>
> Subject: [PATCH v2 0/4] ethdev: add template table insertion and matching
> types
> 
> Bring more flexibility and control over both flow rule insertion
> and packet matching mechanisms. Introduce 2 new flow table types:
> 
> 1. Allow a user to specify the insertion type used in template tables.
> The insertion type is responsible for choosing the appropriate key
> value used to map inserted flow rules into a template table.
> 
> Flow rules can be inserted by calculating the hash value for
> the pattern or inserted by index via the new create_by_index() API.
> The idea of the index-based insertion is to avoid additional matches
> and simply execute predefined actions after jumping to the index.
> 
> The insertion into an already occupied index results in an error.
> The old rule must be destroyed first. An index cannot be bigger than
> the size of the table, otherwise, the rule is rejected as well.
> 
> 2. Allow a user to specify the hash calculation function used in template
> tables. The hash calculation type is responsible for the calculation of
> the flow rule index a packet would hit upon arrival at the table.
> 
> Control over this is useful for applications with custom RSS algorithms,
> for example. An application can select various packet fields to serve as
> a hash calculation source and jump to the appropriate flow rule location.
> The RSS hash result will be used as the index in the table. For the linear
> hash function, the mapping is one-to-one and the hash result is the index.
> For other hash functions, the index is the hash result module table size.
> The RSS hash result can be retrieved via modify_field API: HASH_RESULT.
> 
> RFC:
> https://patchwork.dpdk.org/project/dpdk/patch/20221214022110.393410-1-
> akozyrev@nvidia.com/
> v2: changed the behavior in case of insertion into the same index.
> 
> Alexander Kozyrev (4):
>   ethdev: add template table insertion type
>   ethdev: add template table hash calculation function
>   app/testpmd: add template table insertion type
>   app/testpmd: add template table hash calculation function
> 
>  app/test-pmd/cmdline_flow.c            | 166 +++++++++++++++++++++++--
>  app/test-pmd/config.c                  |  10 +-
>  app/test-pmd/testpmd.h                 |   2 +-
>  doc/guides/prog_guide/rte_flow.rst     |  20 +++
>  doc/guides/rel_notes/release_23_03.rst |  10 ++
>  lib/ethdev/rte_flow.c                  |  24 ++++
>  lib/ethdev/rte_flow.h                  |  95 ++++++++++++++
>  lib/ethdev/rte_flow_driver.h           |  11 ++
>  lib/ethdev/version.map                 |   3 +
>  9 files changed, 330 insertions(+), 11 deletions(-)
> 
> --
> 2.18.2

Series-acked-by:  Ori Kam <orika@nvidia.com>
Best,
Ori