[PATCH v4 1/2] ethdev: add random item support
Ferruh Yigit
ferruh.yigit at amd.com
Thu Dec 14 13:18:24 CET 2023
On 12/14/2023 10:58 AM, Michael Baum wrote:
> Add support for a new item type "RTE_FLOW_ITEM_TYPE_RANDOM".
> This item enables to match on some random value as a part of flow rule.
>
> Signed-off-by: Michael Baum <michaelba at nvidia.com>
> ---
> doc/guides/nics/features/default.ini | 1 +
> doc/guides/prog_guide/rte_flow.rst | 14 +++++++++++
> doc/guides/rel_notes/release_24_03.rst | 5 ++++
> lib/ethdev/rte_flow.c | 1 +
> lib/ethdev/rte_flow.h | 35 +++++++++++++++++++++++++-
> 5 files changed, 55 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
> index 806cb033ff..6d50236292 100644
> --- a/doc/guides/nics/features/default.ini
> +++ b/doc/guides/nics/features/default.ini
> @@ -140,6 +140,7 @@ pppoe_proto_id =
> ptype =
> quota =
> raw =
> +random =
> represented_port =
> sctp =
> tag =
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 627b845bfb..900fdaefb6 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -1573,6 +1573,20 @@ Matches the packet type as defined in rte_mbuf_ptype.
>
> - ``packet_type``: L2/L3/L4 and tunnel information.
>
> +Item: ``RANDOM``
> +^^^^^^^^^^^^^^^^
> +
> +Matches a random value.
> +
> +A random unsigned integer (at most 32-bit) is generated for each packet during
> +flow rule processing, by either HW, SW or some external source.
> +Application can match on either exact value or range of values.
> +This value is not based on the packet data/headers.
> +Application shouldn't assume that this value is kept during the lifetime of
> +the packet.
> +
> +- ``value``: Specific value to match.
> +
Hi Michael,
What is the usecase for the 'random' flow item?
Is it to match some kind of metadata generated by HW?
Or is it a way to sampling traffic?
And how random 'random' item is, is it configured/set in HW or random
per packet?
More information about the dev
mailing list