[v1,0/2] ethdev: add random item support

Message ID 20230822090505.3242455-1-michaelba@nvidia.com (mailing list archive)
Headers
Series ethdev: add random item support |

Message

Michael Baum Aug. 22, 2023, 9:05 a.m. UTC
Add support for matching random value using new "rte_flow_item_random"
structure.
This random value is not based on the packet data/headers.
Application shouldn't assume that this value is kept during the life
time of the packet.

Michael Baum (2):
  ethdev: add random item support
  app/testpmd: add random item support

 app/test-pmd/cmdline_flow.c                 | 30 ++++++++++++++++++-
 doc/guides/nics/features/default.ini        |  1 +
 doc/guides/prog_guide/rte_flow.rst          | 11 +++++++
 doc/guides/rel_notes/release_23_11.rst      |  4 +++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  4 +++
 lib/ethdev/rte_flow.c                       |  1 +
 lib/ethdev/rte_flow.h                       | 33 +++++++++++++++++++++
 7 files changed, 83 insertions(+), 1 deletion(-)
  

Comments

Ivan Malov Aug. 22, 2023, 12:41 p.m. UTC | #1
Hi Michael,

Very interesting proposal. However, could you please
provide a use case example for this feature and also
provide an example of where such value could come
from, theoretically.

Thank you.

On Tue, 22 Aug 2023, Michael Baum wrote:

> Add support for matching random value using new "rte_flow_item_random"
> structure.
> This random value is not based on the packet data/headers.
> Application shouldn't assume that this value is kept during the life
> time of the packet.
>
> Michael Baum (2):
>  ethdev: add random item support
>  app/testpmd: add random item support
>
> app/test-pmd/cmdline_flow.c                 | 30 ++++++++++++++++++-
> doc/guides/nics/features/default.ini        |  1 +
> doc/guides/prog_guide/rte_flow.rst          | 11 +++++++
> doc/guides/rel_notes/release_23_11.rst      |  4 +++
> doc/guides/testpmd_app_ug/testpmd_funcs.rst |  4 +++
> lib/ethdev/rte_flow.c                       |  1 +
> lib/ethdev/rte_flow.h                       | 33 +++++++++++++++++++++
> 7 files changed, 83 insertions(+), 1 deletion(-)
>
> -- 
> 2.25.1
>
>
  
Michael Baum Aug. 22, 2023, 2:09 p.m. UTC | #2
Hi Ivan, 

On Tue, 22 Aug 2023, Ivan Malov wrote: 
> 
> Hi Michael,
> 
> Very interesting proposal. However, could you please provide a use case example for this feature

I can think about 2 different use cases:
1. Sampling - when application wants to sample certain percentage of the flow, it can match random value for getting it.
2. Distribution - when application wants to distribute the traffic between ports/queues, it can match all random value range with send to port/queue actions.

> and also provide an example of where such value could come from, theoretically.

The random value can come from everywhere, it can come from hardware, software or even from the system clock.

> 
> Thank you.
> 
> On Tue, 22 Aug 2023, Michael Baum wrote:
> 
> > Add support for matching random value using new "rte_flow_item_random"
> > structure.
> > This random value is not based on the packet data/headers.
> > Application shouldn't assume that this value is kept during the life
> > time of the packet.
> >
> > Michael Baum (2):
> >  ethdev: add random item support
> >  app/testpmd: add random item support
> >
> > app/test-pmd/cmdline_flow.c                 | 30 ++++++++++++++++++-
> > doc/guides/nics/features/default.ini        |  1 +
> > doc/guides/prog_guide/rte_flow.rst          | 11 +++++++
> > doc/guides/rel_notes/release_23_11.rst      |  4 +++
> > doc/guides/testpmd_app_ug/testpmd_funcs.rst |  4 +++
> > lib/ethdev/rte_flow.c                       |  1 +
> > lib/ethdev/rte_flow.h                       | 33 +++++++++++++++++++++
> > 7 files changed, 83 insertions(+), 1 deletion(-)
> >
> > --
> > 2.25.1
  
Stephen Hemminger Aug. 22, 2023, 2:09 p.m. UTC | #3
On Tue, 22 Aug 2023 16:41:09 +0400 (+04)
Ivan Malov <ivan.malov@arknetworks.am> wrote:

> Hi Michael,
> 
> Very interesting proposal. However, could you please
> provide a use case example for this feature and also
> provide an example of where such value could come
> from, theoretically.

A possible use case is netflow or ipfix traffic sampling