[dpdk-dev] [PATCH v2 1/5] ethdev: update modify field flow action
Ori Kam
orika at nvidia.com
Mon Oct 11 09:19:34 CEST 2021
Hi Slava,
> -----Original Message-----
> From: Slava Ovsiienko <viacheslavo at nvidia.com>
> Sent: Monday, October 11, 2021 2:46 AM
> Subject: [PATCH v2 1/5] ethdev: update modify field flow action
>
> The generic modify field flow action introduced in [1] has some issues related to the immediate source
> operand:
>
> - immediate source can be presented either as an unsigned
> 64-bit integer or pointer to data pattern in memory.
> There was no explicit pointer field defined in the union.
>
> - the byte ordering for 64-bit integer was not specified.
> Many fields have shorter lengths and byte ordering
> is crucial.
>
> - how the bit offset is applied to the immediate source
> field was not defined and documented.
>
> - 64-bit integer size is not enough to provide IPv6
> addresses.
>
> In order to cover the issues and exclude any ambiguities the following is done:
>
> - introduce the explicit pointer field
> in rte_flow_action_modify_data structure
>
> - replace the 64-bit unsigned integer with 16-byte array
>
> - update the modify field flow action documentation
>
> [1] commit 73b68f4c54a0 ("ethdev: introduce generic modify flow action")
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
> ---
> doc/guides/prog_guide/rte_flow.rst | 16 ++++++++++++++++
> doc/guides/rel_notes/release_21_11.rst | 9 +++++++++
> lib/ethdev/rte_flow.h | 17 ++++++++++++++---
> 3 files changed, 39 insertions(+), 3 deletions(-)
>
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 2b42d5ec8c..1ceecb399f 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -2835,6 +2835,22 @@ a packet to any other part of it.
> ``value`` sets an immediate value to be used as a source or points to a location of the value in memory. It
> is used instead of ``level`` and ``offset`` for ``RTE_FLOW_FIELD_VALUE`` and
> ``RTE_FLOW_FIELD_POINTER`` respectively.
> +The data in memory should be presented exactly in the same byte order
> +and length as in the relevant flow item, i.e. data for field with type
> +RTE_FLOW_FIELD_MAC_DST should follow the conventions of dst field in
> +rte_flow_item_eth structure, with type RTE_FLOW_FIELD_IPV6_SRC -
> +rte_flow_item_ipv6 conventions, and so on. If the field size is large
> +than
> +16 bytes the pattern can be provided as pointer only.
> +
> +The bitfield extracted from the memory being applied as second
> +operation parameter is defined by action width and by the destination field offset.
> +Application should provide the data in immediate value memory (either
> +as buffer or by pointer) exactly as item field without any applied
> +explicit offset, and destination packet field (with specified width and
> +bit offset) will be replaced by immediate source bits from the same bit
> +offset. For example, to replace the third byte of MAC address with
> +value 0x85, application should specify destination width as 8,
> +destination width as 16, and provide immediate value as sequence of bytes {xxx, xxx, 0x85, xxx, xxx, xxx}.
>
I think you have a typo destination width as 16 should be destination offset as 16.
If fixed you can add my ack to the next version.
Best,
Ori
More information about the dev
mailing list