From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D1D8CA00BE; Wed, 30 Oct 2019 09:35:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2DEA12BF3; Wed, 30 Oct 2019 09:35:46 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140084.outbound.protection.outlook.com [40.107.14.84]) by dpdk.org (Postfix) with ESMTP id EC37A2BE9 for ; Wed, 30 Oct 2019 09:35:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F6kgM/Cady6zLKWRy/7jN42GzsVyNkvoqXbKhmwv7NsXsanyqZgA1i1WAHVjTuDdZ4nDMbvC5zkQRvjRgwNaZdV6VhiYV4bnTH0zSOCHhH6Cm+LO/EuL5k0QZmQW8GyhtaIWdtABHODnLmxBcyBzfr0+VLcH7bGrPX9gUiS7JRIApjKFzYA3pqhE48M9Rljz3UgNppPxWjjKl1DfPZFbdDcgg+Hmnf7OzgbeHSRRVdprroSbz+3o7/5RpHkawqIpXa3RhKymOq/tRYyYdXt1LMah3FylZ1D/dGsL8vofXEEIOB6r4tJWSgjW+J59KYkb7hip+kDtWqsXQCBWE5NiZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F7qZsEwZHlG5uSAg3gFMrMlYLhYaVSQID/cPkyZ8tx0=; b=jEC5qU4DaY4De4sqmwS5nQeTOFvoOwdJXtllSY4WRpChNSDeUU+0UKtRkw4HSDarhvRQ6FtD7WdDLuscYllmwAw2oxhajzNowQWp0881eZ+YJkzADWBgC3Zuah8a/K3bAfSEscra9hn1bkHuOduSeEQGRHPj+CrqCwopwKUbWOIKgukjhXDUJwHH4eIoXxErcmrRSYV81HIM+RE/QgXS6age4g9U26sppuJ/RoR1m3XIw1RSPJZkrWsBQzLIKHHQ8LaMSntuUA8kA6uMcCrGVgL6VuaF/QKJSQsGonezDj9OylGCuBkpU9Q1zLMM0lwHwBvjuQvIwFnKMWfNJdx5YA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F7qZsEwZHlG5uSAg3gFMrMlYLhYaVSQID/cPkyZ8tx0=; b=r+X5TiYzeUfjeEaprUGYcCm6OFM70BG6Ii4SXV/v739kqLUof0yJm07Hafr87vDWGMrLq99xAD+U7PJwQ3RIHbgpObbD3dKW5zurUTYDiXZaNtCNgza006EnJlWr0cf9SEJ0FUwL7elcP39TZLyEzTcMWpXUat9Q6b8YOJRPIak= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.190.15) by AM4PR05MB3378.eurprd05.prod.outlook.com (10.171.191.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.22; Wed, 30 Oct 2019 08:35:43 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::70a7:a312:cbc6:d178]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::70a7:a312:cbc6:d178%7]) with mapi id 15.20.2387.028; Wed, 30 Oct 2019 08:35:43 +0000 From: Ori Kam To: Slava Ovsiienko , "dev@dpdk.org" CC: Matan Azrad , Raslan Darawsheh , Thomas Monjalon , "olivier.matz@6wind.com" , "arybchenko@solarflare.com" , Yongseok Koh Thread-Topic: [dpdk-dev] [PATCH v5] ethdev: extend flow metadata Thread-Index: AQHVjo+GHnPpgXP/ekCmDpzpeSzmjqdy27Ew Date: Wed, 30 Oct 2019 08:35:43 +0000 Message-ID: References: <1572201636-16374-1-git-send-email-viacheslavo@mellanox.com> <1572377502-13620-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1572377502-13620-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d4e6d6bd-4193-4ba8-0b56-08d75d14276d x-ms-traffictypediagnostic: AM4PR05MB3378:|AM4PR05MB3378: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 02065A9E77 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(39860400002)(136003)(346002)(366004)(396003)(13464003)(199004)(189003)(74316002)(55016002)(316002)(81166006)(81156014)(8676002)(7736002)(25786009)(6436002)(71190400001)(305945005)(71200400001)(229853002)(8936002)(486006)(66066001)(9686003)(6306002)(76176011)(99286004)(76116006)(6116002)(6506007)(53546011)(110136005)(3846002)(11346002)(54906003)(256004)(14444005)(7696005)(26005)(102836004)(45080400002)(186003)(66446008)(478600001)(86362001)(33656002)(64756008)(66556008)(66476007)(66946007)(446003)(2906002)(5660300002)(2501003)(14454004)(52536014)(107886003)(476003)(6246003)(966005)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3378; H:AM4PR05MB3425.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dcSX74vXqEOp2rqqmvsuLXm2Y/wzkFwg4rDhCoOskrq9CiCXqk+AifbuWIHFFV2r93KWiTZh7WPO6WZdMoqf0vtIRf7xwFfpkdluNN2NxyW4ckAkJFNcNYXhloiqxVn5xqUeAqKmXjUnPAoyqixPhU/ATHdcjEySb70dtjuf6QLzMt0RM89xDLT/swUlN9BlUu5u3wv5I+t/RuBGdGLOPYtfwTZbWXkgghgmF/qU8x8uyFfHhm3En+c+70LMZdr0GEETiW2I1z2QWULDtV+OwGfOsVsAwHb/j6MGqLiaykp86vhBG53LT1TnZJfgAXCr5K5/uwFCb+D4IBcOOqEfq50S4KQtk+zjlVu6KDsaE2Eki+VZFv5D/6+tO6dEBVb3StzXC+to4gOhsS4WKnrTZ4FF+zguwj/GNLNRPoFQ9mzJe5fSgofSkhN5B0T1HRxfMLwKu3hQqKaGjS7ZRdz6t8V7waZGwhoVF7r6bbJfsCE= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4e6d6bd-4193-4ba8-0b56-08d75d14276d X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2019 08:35:43.7371 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gN4hegFFfbsqnDcGTW3FqeM1EsSC4AWPhcQ2YVI0wrzeD0EY/5IeQyVhsLpdjNi4782kg6sq+SFpvSBoCmTN9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3378 Subject: Re: [dpdk-dev] [PATCH v5] ethdev: extend flow metadata 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev On Behalf Of Viacheslav Ovsiienko > Sent: Tuesday, October 29, 2019 9:32 PM > To: dev@dpdk.org > Cc: Matan Azrad ; Raslan Darawsheh > ; Thomas Monjalon ; > olivier.matz@6wind.com; arybchenko@solarflare.com; Yongseok Koh > > Subject: [dpdk-dev] [PATCH v5] ethdev: extend flow metadata >=20 > Currently, metadata can be set on egress path via mbuf tx_metadata field > with PKT_TX_METADATA flag and RTE_FLOW_ITEM_TYPE_META matches > metadata. >=20 > This patch extends the metadata feature usability. >=20 > 1) RTE_FLOW_ACTION_TYPE_SET_META >=20 > When supporting multiple tables, Tx metadata can also be set by a rule an= d > matched by another rule. This new action allows metadata to be set as a > result of flow match. >=20 > 2) Metadata on ingress >=20 > There's also need to support metadata on ingress. Metadata can be set by > SET_META action and matched by META item like Tx. The final value set by > the action will be delivered to application via metadata dynamic field of > mbuf which can be accessed by RTE_FLOW_DYNF_METADATA() macro or with > rte_flow_dynf_metadata_set() and rte_flow_dynf_metadata_get() helper > routines. PKT_RX_DYNF_METADATA flag will be set along with the data. >=20 > The mbuf dynamic field must be registered by calling > rte_flow_dynf_metadata_register() prior to use SET_META action. >=20 > The availability of dynamic mbuf metadata field can be checked > with rte_flow_dynf_metadata_avail() routine. >=20 > If application is going to engage the metadata feature it registers > the metadata dynamic fields, then PMD checks the metadata field > availability and handles the appropriate fields in datapath. >=20 > For loopback/hairpin packet, metadata set on Rx/Tx may or may not be > propagated to the other path depending on hardware capability. >=20 > MARK and METADATA look similar and might operate in similar way, > but not interacting. >=20 > Initially, there were proposed two metadata related actions: >=20 > - RTE_FLOW_ACTION_TYPE_FLAG > - RTE_FLOW_ACTION_TYPE_MARK >=20 > These actions set the special flag in the packet metadata, MARK action > stores some specified value in the metadata storage, and, on the packet > receiving PMD puts the flag and value to the mbuf and applications can > see the packet was threated inside flow engine according to the appropria= te > RTE flow(s). MARK and FLAG are like some kind of gateway to transfer some > per-packet information from the flow engine to the application via > receiving datapath. Also, there is the item of type > RTE_FLOW_ITEM_TYPE_MARK > provided. It allows us to extend the flow match pattern with the capabili= ty > to match the metadata values set by MARK/FLAG actions on other flows. >=20 > From the datapath point of view, the MARK and FLAG are related to the > receiving side only. It would useful to have the same gateway on the > transmitting side and there was the feature of type > RTE_FLOW_ITEM_TYPE_META > was proposed. The application can fill the field in mbuf and this value > will be transferred to some field in the packet metadata inside the flow > engine. It did not matter whether these metadata fields are shared becaus= e > of MARK and META items belonged to different domains (receiving and > transmitting) and could be vendor-specific. >=20 > So far, so good, DPDK proposes some entities to control metadata inside > the flow engine and gateways to exchange these values on a per-packet bas= is > via datapaths. >=20 > As we can see, the MARK and META means are not symmetric, there is absent > action which would allow us to set META value on the transmitting path. > So, the action of type: >=20 > - RTE_FLOW_ACTION_TYPE_SET_META was proposed. >=20 > The next, applications raise the new requirements for packet metadata. > The flow ngines are getting more complex, internal switches are introduce= d, > multiple ports might be supported within the same flow engine namespace. > From the DPDK points of view, it means the packets might be sent on one > eth_dev port and received on the other one, and the packet path inside > the flow engine entirely belongs to the same hardware device. The simples= t > example is SR-IOV with PF, VFs and the representors. And there is a > brilliant opportunity to provide some out-of-band channel to transfer > some extra data from one port to another one, besides the packet data > itself. And applications would like to use this opportunity. >=20 > It is supposed for application to use trials (with rte_flow_validate) > to detect which metadata features (FLAG, MARK, META) actually supported > by PMD and underlying hardware. It might depend on PMD configuration, > system software, hardware settings, etc., and should be detected > in run time. >=20 > Signed-off-by: Yongseok Koh > Signed-off-by: Viacheslav Ovsiienko > --- > v5: - addressed code style issues from comments > - Tx metadata deprecation notice removed > (dedicated tx_metadata patch is coming) > - MBUF_DYNF_METADATA_NAME is splitted into FIELD and FLAG > dedicated ones, RTE suffix is added > - metadata historic retrospective is added to log message > - rebased >=20 > v4: - > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s.dp > dk.org%2Fpatch%2F62065%2F&data=3D02%7C01%7Corika%40mellanox.com > %7Cc179230aa76b4847b6d708d75ca6a727%7Ca652971c7d2e4d9ba6a4d14925 > 6f461b%7C0%7C0%7C637079743167838838&sdata=3DKEb4Vy%2Fr9Y%2BVh > FZHqeo7ZOzO5Tphrk5gwRiwLA%2BSPPc%3D&reserved=3D0 > - documentation comments addressed > - deprecation notice for Tx metadata offload flag > - rebased >=20 > v3: - > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s.dp > dk.org%2Fpatch%2F61902%2F&data=3D02%7C01%7Corika%40mellanox.com > %7Cc179230aa76b4847b6d708d75ca6a727%7Ca652971c7d2e4d9ba6a4d14925 > 6f461b%7C0%7C0%7C637079743167838838&sdata=3DIuMDbqwUdKhpkkJNy > aLsBEqtQnQIYLD%2BPUTKx%2BuBb6o%3D&reserved=3D0 > - rebased, neat updates >=20 > v2: - > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s.dp > dk.org%2Fpatch%2F60909%2F&data=3D02%7C01%7Corika%40mellanox.com > %7Cc179230aa76b4847b6d708d75ca6a727%7Ca652971c7d2e4d9ba6a4d14925 > 6f461b%7C0%7C0%7C637079743167838838&sdata=3DIRxJ5TA2b%2BLjw3ud > WUNweQbqzjELEtnr1tcAzUZrB94%3D&reserved=3D0 >=20 > v1: - > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s.dp > dk.org%2Fpatch%2F56104%2F&data=3D02%7C01%7Corika%40mellanox.com > %7Cc179230aa76b4847b6d708d75ca6a727%7Ca652971c7d2e4d9ba6a4d14925 > 6f461b%7C0%7C0%7C637079743167838838&sdata=3D3gmQwKhk0cZMUdy > NI9aQtQkxkzWZUpLDdt5rkPz9AzY%3D&reserved=3D0 > - rfc: > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s.dp > dk.org%2Fpatch%2F54271%2F&data=3D02%7C01%7Corika%40mellanox.com > %7Cc179230aa76b4847b6d708d75ca6a727%7Ca652971c7d2e4d9ba6a4d14925 > 6f461b%7C0%7C0%7C637079743167838838&sdata=3D20Bz7wbiDCYqccY0M > NQm0OFuM9KqX017l7KnXeWhWlQ%3D&reserved=3D0 >=20 >=20 Acked-by: Ori Kam Thanks, Ori