[dpdk-dev] [RFC v2] ethdev: add flow metadata

Ferruh Yigit ferruh.yigit at intel.com
Mon Aug 20 17:45:51 CEST 2018


On 6/26/2018 9:54 AM, Xueming Li wrote:
> Currently, rte_flow pattern only match packet header fields.
> This patch adds additional data to match the packet.
> 
> For example, in egress direction, to do an action depending on the VM
> id, the application needs to configure rte_flow rule with the new
> metadata pattern:
>     pattern meta data is {vm} / end action encap …
> Then the PMD will send VM id as metadata associated in mbuf to NIC,
> then egress flow on NIC match metadata as other regular packet headers,
> the appropriate encapsulation is done according to the VM id metadata.
> 
> Metadata could be used on ingress as well to save useful info before
> flow modification (not defined yet) or decapsulation action. PMD is
> responsible to save metadata into mbuf field. The application must get
> metadata from the mbuf.
> 
> Cc: Thomas Monjalon <thomas at monjalon.net>
> Cc: Olivier Matz <olivier.matz at 6wind.com>
> Cc: Shahaf Shuler <shahafs at mellanox.com>
> Signed-off-by: Xueming Li <xuemingl at mellanox.com>
> ---
>  doc/guides/prog_guide/rte_flow.rst |  7 +++++++
>  lib/librte_ethdev/rte_flow.c       |  1 +
>  lib/librte_ethdev/rte_flow.h       | 28 ++++++++++++++++++++++++++++
>  3 files changed, 36 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index b305a72a5..7989e5856 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -1191,6 +1191,13 @@ Normally preceded by any of:
>  - `Item: ICMP6_ND_NS`_
>  - `Item: ICMP6_ND_OPT`_
>  
> +Item: ``META``
> +^^^^^^^^^^^^^^
> +
> +Matches a metadata variable.
> +
> +- ``data``: 64 bit value.
> +

Isn't this "user data" more than metadata?

And there is only one userdata can be provided for a flow.
Can there be a need to provide multiple userdata? Should we support it?
For your example, on egress what if you want to do specific action on a flow for
both VM id and process id, you can only pass single user data?
What about passing a key-value pair?



More information about the dev mailing list