[v5,0/3] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE

Message ID 20240201122922.474250-1-suanmingm@nvidia.com (mailing list archive)
Headers
Series ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE |

Message

Suanming Mou Feb. 1, 2024, 12:29 p.m. UTC
  The new item type is added for the case user wants to match traffic
based on packet field compare result with other fields or immediate
value.

e.g. take advantage the compare item user will be able to accumulate
a IPv4/TCP packet's TCP data_offset and IPv4 IHL field to a tag
register, then compare the tag register with IPv4 header total length
to understand the packet has payload or not.

The supported operations can be as below:
 - RTE_FLOW_ITEM_COMPARE_EQ (equal)
 - RTE_FLOW_ITEM_COMPARE_NE (not equal)
 - RTE_FLOW_ITEM_COMPARE_LT (less than)
 - RTE_FLOW_ITEM_COMPARE_LE (less than or equal)
 - RTE_FLOW_ITEM_COMPARE_GT (great than)
 - RTE_FLOW_ITEM_COMPARE_GE (great than or equal)

V5:
 - rebase on top of next-net
 - add sample detail for rte_flow_field.

V4:
 - rebase on top of the latest version.
 - move ACTION_MODIFY_PATTERN_SIZE and modify_field_ids rename
   to first patch.
 - add comparison flow create sample in testpmd_funcs.rst.

V3:
 - fix code style missing empty line in rte_flow.rst.
 - fix missing the ABI change release notes.

V2:
 - Since modify field data struct is experiment, rename modify
   field data directly instead of adding new flow field struct.


Suanming Mou (3):
  ethdev: rename action modify field data structure
  ethdev: add compare item
  net/mlx5: add compare item support

 app/test-pmd/cmdline_flow.c                 | 416 +++++++++++++++++++-
 doc/guides/nics/features/default.ini        |   1 +
 doc/guides/nics/features/mlx5.ini           |   1 +
 doc/guides/nics/mlx5.rst                    |   7 +
 doc/guides/prog_guide/rte_flow.rst          |   9 +-
 doc/guides/rel_notes/release_24_03.rst      |   8 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  24 ++
 drivers/net/mlx5/mlx5_flow.c                |   4 +-
 drivers/net/mlx5/mlx5_flow.h                |   9 +-
 drivers/net/mlx5/mlx5_flow_dv.c             |  10 +-
 drivers/net/mlx5/mlx5_flow_hw.c             |  73 ++++
 lib/ethdev/rte_flow.c                       |   1 +
 lib/ethdev/rte_flow.h                       | 332 +++++++++-------
 13 files changed, 726 insertions(+), 169 deletions(-)
  

Comments

Ferruh Yigit Feb. 1, 2024, 6:56 p.m. UTC | #1
On 2/1/2024 12:29 PM, Suanming Mou wrote:
> The new item type is added for the case user wants to match traffic
> based on packet field compare result with other fields or immediate
> value.
> 
> e.g. take advantage the compare item user will be able to accumulate
> a IPv4/TCP packet's TCP data_offset and IPv4 IHL field to a tag
> register, then compare the tag register with IPv4 header total length
> to understand the packet has payload or not.
> 
> The supported operations can be as below:
>  - RTE_FLOW_ITEM_COMPARE_EQ (equal)
>  - RTE_FLOW_ITEM_COMPARE_NE (not equal)
>  - RTE_FLOW_ITEM_COMPARE_LT (less than)
>  - RTE_FLOW_ITEM_COMPARE_LE (less than or equal)
>  - RTE_FLOW_ITEM_COMPARE_GT (great than)
>  - RTE_FLOW_ITEM_COMPARE_GE (great than or equal)
> 
> V5:
>  - rebase on top of next-net
>  - add sample detail for rte_flow_field.
> 
> V4:
>  - rebase on top of the latest version.
>  - move ACTION_MODIFY_PATTERN_SIZE and modify_field_ids rename
>    to first patch.
>  - add comparison flow create sample in testpmd_funcs.rst.
> 
> V3:
>  - fix code style missing empty line in rte_flow.rst.
>  - fix missing the ABI change release notes.
> 
> V2:
>  - Since modify field data struct is experiment, rename modify
>    field data directly instead of adding new flow field struct.
> 
> 
> Suanming Mou (3):
>   ethdev: rename action modify field data structure
>   ethdev: add compare item
>   net/mlx5: add compare item support
> 

Mostly looks good, please find comments on a few minor issues on patches.
  
Suanming Mou Feb. 2, 2024, 12:32 a.m. UTC | #2
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: Friday, February 2, 2024 2:56 AM
> To: Suanming Mou <suanmingm@nvidia.com>
> Cc: dev@dpdk.org; Ori Kam <orika@nvidia.com>
> Subject: Re: [PATCH v5 0/3] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE
> 
> On 2/1/2024 12:29 PM, Suanming Mou wrote:
> > The new item type is added for the case user wants to match traffic
> > based on packet field compare result with other fields or immediate
> > value.
> >
> > e.g. take advantage the compare item user will be able to accumulate a
> > IPv4/TCP packet's TCP data_offset and IPv4 IHL field to a tag
> > register, then compare the tag register with IPv4 header total length
> > to understand the packet has payload or not.
> >
> > The supported operations can be as below:
> >  - RTE_FLOW_ITEM_COMPARE_EQ (equal)
> >  - RTE_FLOW_ITEM_COMPARE_NE (not equal)
> >  - RTE_FLOW_ITEM_COMPARE_LT (less than)
> >  - RTE_FLOW_ITEM_COMPARE_LE (less than or equal)
> >  - RTE_FLOW_ITEM_COMPARE_GT (great than)
> >  - RTE_FLOW_ITEM_COMPARE_GE (great than or equal)
> >
> > V5:
> >  - rebase on top of next-net
> >  - add sample detail for rte_flow_field.
> >
> > V4:
> >  - rebase on top of the latest version.
> >  - move ACTION_MODIFY_PATTERN_SIZE and modify_field_ids rename
> >    to first patch.
> >  - add comparison flow create sample in testpmd_funcs.rst.
> >
> > V3:
> >  - fix code style missing empty line in rte_flow.rst.
> >  - fix missing the ABI change release notes.
> >
> > V2:
> >  - Since modify field data struct is experiment, rename modify
> >    field data directly instead of adding new flow field struct.
> >
> >
> > Suanming Mou (3):
> >   ethdev: rename action modify field data structure
> >   ethdev: add compare item
> >   net/mlx5: add compare item support
> >
> 
> Mostly looks good, please find comments on a few minor issues on patches.

Sure, thanks.