[0/2] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE

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

Message

Suanming Mou Dec. 14, 2023, 3:12 a.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)

As the two struct ``rte_flow_action_modify_data`` and
``rte_flow_field_data`` share the same information, the struct
``rte_flow_action_modify_data`` will be converge to the name more
generic struct ``rte_flow_field_data`` in next release as well.

Suanming Mou (2):
  ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE
  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          |   7 +
 doc/guides/rel_notes/release_24_03.rst      |   7 +-
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   6 +
 drivers/net/mlx5/mlx5_flow.h                |   3 +
 drivers/net/mlx5/mlx5_flow_hw.c             |  73 ++++
 lib/ethdev/rte_flow.c                       |   1 +
 lib/ethdev/rte_flow.h                       | 230 ++++++++---
 11 files changed, 690 insertions(+), 62 deletions(-)