From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: Re: [PATCH v4 1/3] ethdev: support metadata as flow rule criteria Date: Wed, 17 Oct 2018 09:02:55 +0300 Message-ID: References: <1538056677-33846-1-git-send-email-dekelp@mellanox.com> <1539254998-8555-2-git-send-email-dekelp@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Cc: Shahaf Shuler , "dev@dpdk.org" , "Ori Kam" , Nikhil Rao To: Dekel Peled , "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" , "olivier.matz@6wind.com" , Adrien Mazarguil , Thomas Monjalon , "ferruh.yigit@intel.com" Return-path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id CEF895B3A for ; Wed, 17 Oct 2018 08:03:47 +0200 (CEST) In-Reply-To: Content-Language: en-GB List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/17/18 8:27 AM, Dekel Peled wrote: > > Thanks, PSB. > > *From:* Andrew Rybchenko > *Sent:* Tuesday, October 16, 2018 5:12 PM > *To:* Dekel Peled ; wenzhuo.lu@intel.com; > jingjing.wu@intel.com; bernard.iremonger@intel.com; > olivier.matz@6wind.com; Adrien Mazarguil ; > Thomas Monjalon ; ferruh.yigit@intel.com > *Cc:* Shahaf Shuler ; dev@dpdk.org; Ori Kam > ; Nikhil Rao > *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 > > > [...] > > > 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? > > 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).