From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80084.outbound.protection.outlook.com [40.107.8.84]) by dpdk.org (Postfix) with ESMTP id 124E2293B for ; Thu, 23 Aug 2018 23:35:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uW+s71Fj33GWp49qdgP4a6tEOhjHb114D9OtYFmg4fs=; b=g0UCqFh2MP/qxnMri/MbULg1dKewwasrlb05aK+RoBiZDmKrWW+94qwHutKuMugo/7ZoCSd56K9I/lYs1qL7Lh0mrXv1KbMRsJF2p0PaOa3B6L3B4Udq+9Pc6mbOAEO1pj4FnroA90NXzann4FC8HSnR9AqOCVVStyDQJJ/tZFM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (209.116.155.178) by DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.20; Thu, 23 Aug 2018 21:35:11 +0000 Date: Thu, 23 Aug 2018 14:34:58 -0700 From: Yongseok Koh To: "Ananyev, Konstantin" Cc: Dekel Peled , "dev@dpdk.org" , Adrien Mazarguil , "olivier.matz@6wind.com" , Ori Kam , Shahaf Shuler Message-ID: <20180823213457.GC31847@yongseok-MBP.local> References: <1534146418-1060-1-git-send-email-dekelp@mellanox.com> <2601191342CEEE43887BDE71AB977258E9FA2D49@IRSMSX102.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258E9FA454D@IRSMSX102.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB977258E9FA454D@IRSMSX102.ger.corp.intel.com> User-Agent: Mutt/1.9.3 (2018-01-21) X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: DM5PR06CA0064.namprd06.prod.outlook.com (2603:10b6:3:37::26) To DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 00acbf11-5ec7-410d-d726-08d609404eea X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB3980; X-Microsoft-Exchange-Diagnostics: 1; DB3PR0502MB3980; 3:3W0UOA4ucSJuJ/a++kNf2JJHD/p5xnBGX8xnI4odD5rTccMuwNDbkWPOQo5pHC0TZiB+cMnd42algBoQ43MjIKXY2vzqHKzKi3wSEu4zXCc5tRo2vcNa1DAUOKfO6JINTX+AP2z48uXfot302f4B/EWDQA46e1OMZnKi4VEQUInQ7iYOoMGuMdJ9hPpXh4u/rksZjrPNDCOCKZVTLTOY6+c7Lrj8e9bq6x7LQoua+Kw/vJrhRNlWoUaRtZKxTfm7; 25:rU+1vsqMqh8kD7HX+Z2YQo7PA29AoJbtFBjyiVGZjj0rfr1GXrm1Yzi5Bvp1n7dNxYKRjWc5GokjTHqTPHlJyYcfWfU7qUescsUkvK4LPXbFkCJpP3/r4uwZuh27nlbzuTfdpp6ArCiPp0/Mxc3NwSyChBpMitojTGT3CTdcfoCN4+s8w3BceI5yX8gsFm9a9OQLfY4lVY2dSk7c0y4vyoiSyxU30aGnOfTb8GSCcnHbkJDMi//1a22iTn90/CZyA8+8cgBTnwI8JKvNHlL8ZHEPB5nI1FEI2e+9kClIj92lQL4JoY0jx/wNDkNfkh5M/HBp/c3UTylINWkbGkUK0w==; 31:FJr+G2bka0EeEINfnf6dR5bGmVzGTsJ7AcznUhYzGkSICq6zNW37g7Z2yyx+AnTWoYOT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3B6v5pMrJ1T+dEm+pnZ5G7RZcTpUK/X+SsCqfuayHWmb6sF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(3231311)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DB3PR0502MB3980; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3980; X-Forefront-PRVS: 0773BB46AC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(136003)(396003)(346002)(376002)(39860400002)(189003)(199004)(13464003)(25786009)(53936002)(97736004)(478600001)(6246003)(81166006)(11346002)(81156014)(52116002)(76176011)(8676002)(33896004)(446003)(53546011)(26005)(50466002)(476003)(956004)(4326008)(54906003)(7696005)(107886003)(58126008)(186003)(6116002)(16526019)(1076002)(3846002)(23726003)(106356001)(9686003)(16586007)(86362001)(8936002)(105586002)(93886005)(229853002)(316002)(6916009)(5660300001)(6666003)(486006)(55016002)(66066001)(6506007)(386003)(305945005)(7736002)(47776003)(98436002)(33656002)(2906002)(68736007)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3980; H:yongseok-MBP.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR0502MB3980; 23:aK8xemQfQBxkkj6vHj5m0KyYCF28Xp10Ad202BS?= =?us-ascii?Q?2iE7nNRjrgNgNyVn8ldnlFHdhjyacxwv2e8XB7t9DpmLHjkycGDNOq33f1wH?= =?us-ascii?Q?mjM/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3NsKvt4gLEqSWwuUmniQLxtNJXOC2U1iKEYVuKetKzWxJv7xXj8ZFGzG2b4gww2JV7Uc6Ax8/wGBp/xAUlYHLg63B61pHyHIV95GD46iTLcUwTdqOM1UpqB8yK12W9uNKH0akBhCji8B3QViDxTGHqdinnHOGIXZL+j/wXcM0SNVu5TCnNPVv1DdFlHCXFpZlDV1n7WW0FyMGjMtiisi29xrhSYe8udGPEB2q/+trqpZW4gFVmYL/zLHWfJbTXS7Nu1WEUZyARJWs0+FSvEe6Zf6EV96qzBVv9JIIONFWx99zT2EG5ko1Bw==; 5:Ise0yh8vblvCAflViU6ooKM+xZFUW60okhyO6ZtLaazT9rHbZ+ngHphXu/7ajoiPn9HPhrbGm3t5xXmMuceYLlOVoHxGAYH5gIde6Q3A1Tx4szyLnwU73Z6OR4A+Vsu32eId4DAGqxit/idQEwFFJqeQKwbUdLMgFO2spiO69mI=; 7:pPu1EwunFeUryJzxWmH2+8UQ8S8m2hd+ATFsfdzyCWsLfwRUq/b/itRmJCrxcsWUA8MmJbazViVTjkOToD5pYz5wE2OPxG67UvXGQz84ci3qBHYkdyW8VZfnn8C4Mpd9YcG17OBjMlFWHIscj5GCMeMKQSxHPekGDmQiMGjAwQxrqT1Oy2iP4TfMMotpBUE3blbNgVb12e9o1OG+Dzjj2piOPlOYy8OWVB1BdK3036FeDDcEN+nYwhd+iwseXdo4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2018 21:35:11.1855 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00acbf11-5ec7-410d-d726-08d609404eea X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3980 Subject: Re: [dpdk-dev] [RFC] ethdev: support metadata as flow rule criteria X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2018 21:35:14 -0000 On Wed, Aug 22, 2018 at 12:13:19PM +0000, Ananyev, Konstantin wrote: > Hi Dekel, > > > > > > > > > > > > > > > > -----Original Message----- > > > > > From: Dekel Peled [mailto:dekelp@mellanox.com] > > > > > Sent: Monday, August 13, 2018 10:47 AM > > > > > To: dev@dpdk.org > > > > > Cc: Ori Kam ; Shahaf Shuler > > > > > > > > > > Subject: [RFC] ethdev: support metadata as flow rule criteria > > > > > > > > > > Current implementation of rte_flow allows match pattern of flow > > > > > rule, based on packet data or header fields. > > > > > This limits the application use of match patterns. > > > > > > > > > > For example, consider a vswitch application which controls a set of > > > > > VMs, connected with virtio, in a fabric with overlay of VXLAN. > > > > > Several VMs can have the same inner tuple, while the outer tuple is > > > > > different and controlled by the vswitch (encap action). > > > > > For the vswtich to be able to offload the rule to the NIC, it must > > > > > use a unique match criteria, independent from the inner tuple, to > > > > > perform the encap action. > > > > > > > > > > This RFC adds support for additional metadata to use as 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. > > > > > > > > > > Application should set the packet metdata in the mbuf->metadata > > > > > 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. > > > > > > > > > > For example, to do an encap action depending on the VM id, the > > > > > application needs to configure 'match on metadata' rte_flow rule > > > > > with VM id as metadata, along with desired encap action. > > > > > When preparing an egress data packet, application will set VM id > > > > > data in mbuf metadata field and set PKT_TX_METADATA flag. > > > > > > > > > > PMD will send data packets to NIC, with VM id as metadata. > > > > > Egress flow on NIC will match metadata as done with other criteria. > > > > > Upon match on metadata (VM id) the appropriate encap action will be > > > > > performed. > > > > > > > > > > This RFC 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. > > > > > It also enhances struct rte_mbuf with new data item, uint64_t metadata. > > > > > > > > > > Comments are welcome. > > > > > > > > > > Signed-off-by: Dekel Peled > > > > > --- > > > > > doc/guides/prog_guide/rte_flow.rst | 21 +++++++++++++++++++++ > > > > > lib/librte_ethdev/rte_flow.c | 1 + > > > > > lib/librte_ethdev/rte_flow.h | 25 +++++++++++++++++++++++++ > > > > > lib/librte_mbuf/rte_mbuf.h | 11 +++++++++++ > > > > > 4 files changed, 58 insertions(+) > > > > > > > > > > diff --git a/doc/guides/prog_guide/rte_flow.rst > > > > > b/doc/guides/prog_guide/rte_flow.rst > > > > > index b305a72..b6e35f1 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 64 bit metadata item. > > > > > + > > > > > +- Default ``mask`` matches any 64 bit value. > > > > > + > > > > > +.. _table_rte_flow_item_meta: > > > > > + > > > > > +.. table:: META > > > > > + > > > > > + +----------+----------+---------------------------+ > > > > > + | Field | Subfield | Value | > > > > > + +==========+==========+===========================+ > > > > > + | ``spec`` | ``data`` | 64 bit metadata value | > > > > > + +----------+--------------------------------------+ > > > > > + | ``last`` | ``data`` | upper range value | > > > > > + +----------+----------+---------------------------+ > > > > > + | ``mask`` | ``data`` | zeroed to match any value | > > > > > + +----------+----------+---------------------------+ > > > > > + > > > > > Actions > > > > > ~~~~~~~ > > > > > > > > > > diff --git a/lib/librte_ethdev/rte_flow.c > > > > > b/lib/librte_ethdev/rte_flow.c index > > > > > cff4b52..54e5ef8 100644 > > > > > --- a/lib/librte_ethdev/rte_flow.c > > > > > +++ b/lib/librte_ethdev/rte_flow.c > > > > > @@ -66,6 +66,7 @@ struct rte_flow_desc_data { > > > > > sizeof(struct rte_flow_item_icmp6_nd_opt_sla_eth)), > > > > > MK_FLOW_ITEM(ICMP6_ND_OPT_TLA_ETH, > > > > > sizeof(struct rte_flow_item_icmp6_nd_opt_tla_eth)), > > > > > + MK_FLOW_ITEM(META, sizeof(struct rte_flow_item_meta)), > > > > > }; > > > > > > > > > > /** Generate flow_action[] entry. */ diff --git > > > > > a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index > > > > > f8ba71c..b81c816 100644 > > > > > --- a/lib/librte_ethdev/rte_flow.h > > > > > +++ b/lib/librte_ethdev/rte_flow.h > > > > > @@ -413,6 +413,15 @@ enum rte_flow_item_type { > > > > > * See struct rte_flow_item_mark. > > > > > */ > > > > > RTE_FLOW_ITEM_TYPE_MARK, > > > > > + > > > > > + /** > > > > > + * [META] > > > > > + * > > > > > + * Matches a metadata value specified in mbuf metadata field. > > > > > + * > > > > > + * See struct rte_flow_item_meta. > > > > > + */ > > > > > + RTE_FLOW_ITEM_TYPE_META, > > > > > }; > > > > > > > > > > /** > > > > > @@ -849,6 +858,22 @@ struct rte_flow_item_gre { #endif > > > > > > > > > > /** > > > > > + * RTE_FLOW_ITEM_TYPE_META. > > > > > + * > > > > > + * Matches a specified metadata value. > > > > > + */ > > > > > +struct rte_flow_item_meta { > > > > > + uint64_t data; > > > > > +}; > > > > > + > > > > > +/** Default mask for RTE_FLOW_ITEM_TYPE_META. */ #ifndef > > > > > +__cplusplus static const struct rte_flow_item_meta > > > rte_flow_item_meta_mask = { > > > > > + .data = RTE_BE64(UINT64_MAX), > > > > > +}; > > > > > +#endif > > > > > + > > > > > +/** > > > > > * RTE_FLOW_ITEM_TYPE_FUZZY > > > > > * > > > > > * Fuzzy pattern match, expect faster than default. > > > > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > > > > > index > > > > > 9ce5d76..8f06a78 100644 > > > > > --- a/lib/librte_mbuf/rte_mbuf.h > > > > > +++ b/lib/librte_mbuf/rte_mbuf.h > > > > > @@ -182,6 +182,11 @@ > > > > > /* add new TX flags here */ > > > > > > > > > > /** > > > > > + * This flag indicates that the metadata field in the mbuf is in use. > > > > > + */ > > > > > +#define PKT_TX_METADATA (1ULL << 41) > > > > > + > > > > > +/** > > > > > * UDP Fragmentation Offload flag. This flag is used for enabling UDP > > > > > * fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is > > > used > > > > > * to store the MSS of UDP fragments. > > > > > @@ -593,6 +598,12 @@ struct rte_mbuf { > > > > > */ > > > > > struct rte_mbuf_ext_shared_info *shinfo; > > > > > > > > > > + /** > > > > > + * Application specific metadata value for flow rule match. > > > > > + * Valid if PKT_TX_METADATA is set. > > > > > + */ > > > > > + uint64_t metadata; > > > > > + > > > > > > Just one thought - with that change we'll have only 8 free bytes left inside > > > rte_mbuf. > > > Wonder tan this metadata field be combined within tx_offload or probably > > > hash fields? > > > Konstantin > > > > The match on metadata feature is currently implemented for egress, but is planned to be extended for ingress use in the future. > > Hence the need for dedicated field, detached from Tx specific or Rx specific fields. > > Could you probably explain a bit more how it will be used for ingress? > As I understand it would be some user defined value associated with particular HW filter. > Right now mbuf's hash might be used for similar purposes - it can contain flow filter ID. > Do you expect HW to provide both rss/flow and this new metadata info simultaneously > for the same packet? Like I replied to Andrew, it would be possible. And metadata can even be used for flow match. Flow ID is the classification result but metadata has meaning by itself, could be coming from other entity. Yongseok > Konstantin > > > Dekel > > > > > > > > > > > > > } __rte_cache_aligned; > > > > > > > > > > /** > > > > > -- > > > > > 1.8.3.1 >