On 10/17/18 8:27 AM, Dekel Peled wrote:
Thanks, PSB.
*From:* Andrew Rybchenko <arybche...@solarflare.com>
*Sent:* Tuesday, October 16, 2018 5:12 PM
*To:* Dekel Peled <dek...@mellanox.com>; wenzhuo...@intel.com;
jingjing...@intel.com; bernard.iremon...@intel.com;
olivier.m...@6wind.com; Adrien Mazarguil <adrien.mazarg...@6wind.com>;
Thomas Monjalon <tho...@monjalon.net>; ferruh.yi...@intel.com
*Cc:* Shahaf Shuler <shah...@mellanox.com>; dev@dpdk.org; Ori Kam
<or...@mellanox.com>; Nikhil Rao <nikhil....@intel.com>
*Subject:* Re: [dpdk-dev] [PATCH v4 1/3] ethdev: support metadata as
flow rule criteria
On 10/11/18 1:49 PM, Dekel Peled wrote:
As described in [1], a new rte_flow item is added to support metadata
to use as flow rule match pattern.
The metadata is an opaque item, fully controlled by the application.
The use of metadata is relevant for egress rules only.
It can be set in the flow rule using the RTE_FLOW_ITEM_META.
An additional item 'tx_metadata' is added in union with existing member
'hash' of struct 'rte_mbuf'.
It is used to carry the metadata item.
Currently this union is used only for ingress packets, so using it for
egress metadata will not cause conflicts.
Application should set the packet metadata in the mbuf dedicated field,
and set the PKT_TX_METADATA flag in the mbuf->ol_flags.
The NIC will use the packet metadata as match criteria for relevant
flow rules.
This patch introduces metadata item type for rte_flow RTE_FLOW_ITEM_META,
along with corresponding struct rte_flow_item_meta and ol_flag
PKT_TX_METADATA.
[1] "[RFC,v2] ethdev: support metadata as flow rule criteria"
Signed-off-by: Dekel Peled<dek...@mellanox.com>
<mailto:dek...@mellanox.com>
[...]
diff --git a/doc/guides/prog_guide/rte_flow.rst
b/doc/guides/prog_guide/rte_flow.rst
index b600b2d..8643722 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1191,6 +1191,27 @@ Normally preceded by any of:
- `Item: ICMP6_ND_NS`_
- `Item: ICMP6_ND_OPT`_
+Item: ``META``
+^^^^^^^^^^^^^^
+
+Matches an application specific 32 bit metadata item.
+
+- Default ``mask`` matches any 32 bit value.
+
+.. _table_rte_flow_item_meta:
+
+.. table:: META
+
+ +----------+----------+---------------------------+
+ | Field | Subfield | Value |
+ +==========+==========+===========================+
+ | ``spec`` | ``data`` | 32 bit metadata value |
+ +----------+--------------------------------------+
+ | ``last`` | ``data`` | upper range value |
+ +----------+----------+---------------------------+
+ | ``mask`` | ``data`` | zeroed to match any value |
+ +----------+----------+---------------------------+
+
Is there a difference between any metadata value and
no metadata value at all?
<DP> Value Zero is considered as no metadata value.
Not sure that I understand.
Is flow rule with no META item equivalent to flow rule with
META item and mask.data==0?
Flow rule with no META item matches packets with and
without metadata.
Flow rule with META item and mask.data==0 could match
packets with metadata provided and any value, or could
be equivalent to no META item at all.
(I'm asking since no IPv4 item and empty IPv4 item are
different things).