mbox series

[v8,0/2] generic modify rte flow action support

Message ID 20210118161825.31516-1-akozyrev@nvidia.com (mailing list archive)
Headers show
Series generic modify rte flow action support | expand

Message

Alexander Kozyrev Jan. 18, 2021, 4:18 p.m. UTC
Implement a generic modify rte flow API as described in RFC:
http://patches.dpdk.org/patch/85384/

This API allows modifying a destination header field with data from
a source header field. Number of bits to use from the source is specified.
Tag, Mark or Metadata can also be used as a source/destination to allow
saving/overwriting an arbitrary header field with a user-specified value.
Alternatively, an immediate value can be provided by a user as a source.

Outermost/innermost packet fields (and Tag array elements) are
accessible via the level parameter to facilitate the modification
of encapsulated packet header fields. The offset parameter provides
the flexibility to copy/set any part of a packet starting the
specified packet header field.

Example of RTE_FLOW_ACTION_TYPE_MODIFY_FIELD implementation for MLX5:
https://patchwork.dpdk.org/patch/86736/

---
v1: https://patchwork.dpdk.org/patch/86173/
Initial design.
v2: https://patchwork.dpdk.org/cover/86369/
Added testpmd support.
v3: https://patchwork.dpdk.org/cover/86442/
Made dst_type, src_type and width only mandatory parameters.
v4: https://patchwork.dpdk.org/cover/86488/
Renamed action to RTE_FLOW_ACTION_TYPE_COPY_FIELD.
v5: https://patchwork.dpdk.org/cover/86705/
Redesigned as RTE_FLOW_ACTION_TYPE_MODIFY_FIELD.
v6: https://patchwork.dpdk.org/cover/86715/
Fixed typos in documentation.
v7: https://patchwork.dpdk.org/cover/86718/
Fixed warnings.
v8:
Added doxygen comments.

Alexander Kozyrev (2):
  ethdev: introduce generic modify rte flow action
  app/testpmd: add support for modify field flow action

 app/test-pmd/cmdline_flow.c            | 246 +++++++++++++++++++++++++
 doc/guides/prog_guide/rte_flow.rst     |  66 +++++++
 doc/guides/rel_notes/release_21_02.rst |   8 +
 lib/librte_ethdev/rte_flow.c           |   2 +
 lib/librte_ethdev/rte_flow.h           |  87 ++++++++-
 5 files changed, 408 insertions(+), 1 deletion(-)

Comments

Ajit Khaparde Jan. 18, 2021, 8:05 p.m. UTC | #1
On Mon, Jan 18, 2021 at 8:18 AM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
>
> Implement a generic modify rte flow API as described in RFC:
> http://patches.dpdk.org/patch/85384/
>
> This API allows modifying a destination header field with data from
> a source header field. Number of bits to use from the source is specified.
> Tag, Mark or Metadata can also be used as a source/destination to allow
> saving/overwriting an arbitrary header field with a user-specified value.
> Alternatively, an immediate value can be provided by a user as a source.
>
> Outermost/innermost packet fields (and Tag array elements) are
> accessible via the level parameter to facilitate the modification
> of encapsulated packet header fields. The offset parameter provides
> the flexibility to copy/set any part of a packet starting the
> specified packet header field.
>
> Example of RTE_FLOW_ACTION_TYPE_MODIFY_FIELD implementation for MLX5:
> https://patchwork.dpdk.org/patch/86736/
>
> ---
> v1: https://patchwork.dpdk.org/patch/86173/
> Initial design.
> v2: https://patchwork.dpdk.org/cover/86369/
> Added testpmd support.
> v3: https://patchwork.dpdk.org/cover/86442/
> Made dst_type, src_type and width only mandatory parameters.
> v4: https://patchwork.dpdk.org/cover/86488/
> Renamed action to RTE_FLOW_ACTION_TYPE_COPY_FIELD.
> v5: https://patchwork.dpdk.org/cover/86705/
> Redesigned as RTE_FLOW_ACTION_TYPE_MODIFY_FIELD.
> v6: https://patchwork.dpdk.org/cover/86715/
> Fixed typos in documentation.
> v7: https://patchwork.dpdk.org/cover/86718/
> Fixed warnings.
> v8:
> Added doxygen comments.
>
> Alexander Kozyrev (2):
>   ethdev: introduce generic modify rte flow action
>   app/testpmd: add support for modify field flow action
I see Thomas has some comments on one of the patches.
Please address that. Otherwise ack for the series.
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

>
>  app/test-pmd/cmdline_flow.c            | 246 +++++++++++++++++++++++++
>  doc/guides/prog_guide/rte_flow.rst     |  66 +++++++
>  doc/guides/rel_notes/release_21_02.rst |   8 +
>  lib/librte_ethdev/rte_flow.c           |   2 +
>  lib/librte_ethdev/rte_flow.h           |  87 ++++++++-
>  5 files changed, 408 insertions(+), 1 deletion(-)
>
> --
> 2.24.1
>