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 80AD5A0352; Tue, 5 Nov 2019 10:35:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 510562BE5; Tue, 5 Nov 2019 10:35:50 +0100 (CET) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10097.outbound.protection.outlook.com [40.107.1.97]) by dpdk.org (Postfix) with ESMTP id 72F3629D2 for ; Tue, 5 Nov 2019 10:35:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dQ64po7DtLOfiQ91Gnqk5n6I9ZJYyrKp13B/LiDYj1xT+BCaRE6y0QVAxc2c35JSrm4MUkKu7tSZ5Ts35ivDaqPdpTOYiSmLrODFJ5lphL/dvcwLjuDGhyyG67D/xdhbX8wmoAXt1zwBAzPGKWZLGEzE7xaQHV33uRjaTw5tYS/6+Fay3Lwlzk7aRjhzbyXOiXzGfBtjfWq3Dn443W1oHgmBHdzhgfx/Wl7FIDvDTOTfolWAlAhTxt9OmvWhWVoapbm6rAyt+qPHvzGe4qGCc9TJ7wCMgXax4Y4kCy+YD/3AGIjM2UPtZqEsQqdQmS11XzzKUqbrXg3ElNSfpwJ7vA== 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=XmxIOoei4gM/PAudrMByEJOmvBASgX6gtuj6tHeerCU=; b=ThjmaEtlnrxpDcuGkMdQ1Ii5LHIMvBOXgLudGNpqPQdr42vl8o2xrVSYHUhEu6f2/GLQcaLLIr0cmLPGD615MBFWOhEIJJFLGw+6S+48jS8qLN20nQ5QRm4zUPlMJrzTCvhSm8GnhB/6K/ScEr3rErzyXNaplDtBV84mHODgrtbA8D88xR6SkQmNK0DtHSOWGEb/BBvKuyfP9saTVqliTIl9S+5dckFBNraMHdNYk6ZBmSvAGrYJD6yu9a16VGrQqx2CqeCjmxhOw6Ro92YA9OrkdhFX2HG0td2rBnrZtPrQshMrtxLP7WTyYbzFTufeKUDUuFfM8TSP4/j0wyaGsQ== 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=XmxIOoei4gM/PAudrMByEJOmvBASgX6gtuj6tHeerCU=; b=r08LL8s2t20mX1jhpY415L1IJ7tftk2wUCtzTWOWB7FAMyWHQ3H/v6Wrqj9UHPhydQJUP8dw/nvFytxcfJTZpSzvJOmuW2RwhRar1LFE3WzfMTyxygZc25PVwoeAijTFbU/hT3pcXZGJaT4tX7rWqc63A1XrxSYC4bX1XOh0L1o= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.39.139) by AM0PR0502MB3874.eurprd05.prod.outlook.com (52.133.45.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.20; Tue, 5 Nov 2019 09:35:43 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::fd7a:e5a8:deec:c1b0]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::fd7a:e5a8:deec:c1b0%7]) with mapi id 15.20.2408.024; Tue, 5 Nov 2019 09:35:43 +0000 From: Matan Azrad To: Slava Ovsiienko , "dev@dpdk.org" CC: Raslan Darawsheh , Thomas Monjalon , Ori Kam , Yongseok Koh Thread-Topic: [PATCH 00/20] net/mlx5: implement extensive metadata feature Thread-Index: AQHVk69ZPqCIR9sv0kOMJMmGscyWW6d8UUoA Date: Tue, 5 Nov 2019 09:35:43 +0000 Message-ID: References: <1572940915-29416-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1572940915-29416-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@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: be139890-e713-40b7-241b-08d761d38791 x-ms-traffictypediagnostic: AM0PR0502MB3874:|AM0PR0502MB3874: 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: 0212BDE3BE x-forefront-antispam-report: SFV:NSPM; SFS:(10019001)(6009001)(428001)(51704005)(199002)(189002)(20776003)(69226001)(63696002)(74876001)(74706001)(54606006)(33656001)(77096001)(76786001)(76796001)(81542001)(54356001)(93136001)(92566001)(46102001)(64706001)(76576001)(81342001)(92726001)(15975445006)(77982001)(59766001)(56816005)(80022001)(66066001)(76482001)(74316001)(90146001)(65816001)(87936001)(56776001)(54316002)(74366001)(44376005)(87266001)(54206007)(2656002)(4396001)(47976001)(50986001)(95666003)(49866001)(47736001)(51856001)(85306002)(79102001)(85852003)(83072002)(21056001)(97336001)(94946001)(93516002)(95416001)(94316002)(86362001)(97186001)(80976001)(81686001)(83322001)(19580405001)(81816001)(31966008)(74662001)(19580395003)(53806001)(74502001)(47446002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR0502MB3874; H:AM0PR0502MB4019.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: fomveDlYdNg8z2HKbtEl6I5UXmVo0LLTrH+TzIy/pmeGdLlXRdIM61oPTZwOAGSQD6thii2uE120x+PZt35FIHoV9VpFCYTVwZ7uC7pcB+Cj/Dqeo4b4sRw4uJEcRxkCum4OnFN8iy0bZDAWMjCkDLf2U34GxhP1TP65HhB6xBoTpJwIZfGa3M+5Rk7azzuQFSfsFod43IOkg91sfuT1tvj21cAxIGct8eMN/MKkn0+weK6qQ9lZmVopNvmvO6jCKCHjqrINaB1QdaHrcCxvc3BwcH4M4pJPsiG7Y0oVYNbiCuPppSxGcb6+8Oo3NB+j1dxlhZ4NIh8QkkEkXwiFt49n3h76YWuEwcfpfoCe8KuV9CoGK93CeV2AcVIITThqRl9nctady1W+BVD1JfPN6JIoJJJfXo/oau+UBKr84XuOQtB/LBG0TEL4qL/cjs3r 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: be139890-e713-40b7-241b-08d761d38791 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2019 09:35:43.4745 (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: zKztGclvDPHmUq6+oAJqqFUH+1PDKuiEHfQ12zNAyz/39n1Hz2fXTTBGyFwQh+p7ju/mofh1skEpOkIJJYcOOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3874 Subject: Re: [dpdk-dev] [PATCH 00/20] net/mlx5: implement extensive metadata feature 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" From: Viacheslav Ovsiienko > The modern networks operate on the base of the packet switching > approach, and in-network environment data are transmitted as the packets. > Within the host besides the data, actually transmitted on the wire as pac= kets, > there might some out-of-band data helping to process packets. These data > are named as metadata, exist on a per-packet basis and are attached to ea= ch > packet as some extra dedicated storage (in meaning it besides the packet > data itself). >=20 > In the DPDK network data are represented as mbuf structure chains and go > along the application/DPDK datapath. From the other side, DPDK provides > Flow API to control the flow engine. Being precise, there are two kinds o= f > metadata in the DPDK, the one is purely software metadata (as fields of > mbuf - flags, packet types, data length, etc.), and the other is metadata > within flow engine. > In this scope, we cover the second type (flow engine metadata) only. >=20 > The flow engine metadata is some extra data, supported on the per-packet > basis and usually handled by hardware inside flow engine. >=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 st= ores > some specified value in the metadata storage, and, on the packet receivin= g > PMD puts the flag and value to the mbuf and applications can see the pack= et > was threated inside flow engine according to the appropriate 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 datapat= h. > Also, there is the item of type RTE_FLOW_ITEM_TYPE_MARK provided. It > allows us to extend the flow match pattern with the capability to match t= he > 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. >=20 > It did not matter whether these metadata fields are shared because 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 t= he > flow engine and gateways to exchange these values on a per-packet basis v= ia > datapath. >=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 is proposed. >=20 > The next, applications raise the new requirements for packet metadata. Th= e > flow engines are getting more complex, internal switches are introduced, > 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 th= e > flow engine entirely belongs to the same hardware device. The simplest > example is SR-IOV with PF, VFs and the representors. And there is a brill= iant > 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 > Improving the metadata definitions it is proposed to: > - suppose MARK and META metadata fields not shared, dedicated > - extend applying area for MARK and META items/actions for all > flow engine domains - transmitting and receiving > - allow MARK and META metadata to be preserved while crossing > the flow domains (from transmit origin through flow database > inside (E-)switch to receiving side domain), in simple words, > to allow metadata to convey the packet thought entire flow > engine space. >=20 > Another new proposed feature is transient per-packet storage inside the > flow engine. It might have a lot of use cases. > For example, if there is VXLAN tunneled traffic and some flow performs > VXLAN decapsulation and wishes to save information regarding the dropped > header it could use this temporary transient storage. The tools to mainta= in > this storage are traditional (for DPDK rte_flow API): >=20 > - RTE_FLOW_ACTION_TYPE_SET_TAG - to set value > - RTE_FLOW_ACTION_TYPE_SET_ITEM - to match on >=20 > There are primary properties of the proposed storage: > - the storage is presented as an array of 32-bit opaque values > - the size of array (or even bitmap of available indices) is > vendor specific and is subject to run-time trial > - it is transient, it means it exists only inside flow engine, > no gateways for interacting with datapath, applications have > way neither to specify these data on transmitting nor to get > these data on receiving >=20 > This patchset implements the abovementioned extensive metadata feature > in the mlx5 PMD. >=20 > The patchset must be applied after public RTE API updates: >=20 > [1] > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatch > es.dpdk.org%2Fpatch%2F62354%2F&data=3D02%7C01%7Cmatan%40mella > nox.com%7C3d761a21d7b24f6cc3f908d761c67b89%7Ca652971c7d2e4d9ba6a4 > d149256f461b%7C0%7C0%7C637085377412009134&sdata=3DJ4RsC9w8BNn > %2BawnLG%2F4UJPzeo%2BZ%2BTBfVxkZ6j4gheg0%3D&reserved=3D0 > [2] > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatch > es.dpdk.org%2Fpatch%2F62355%2F&data=3D02%7C01%7Cmatan%40mella > nox.com%7C3d761a21d7b24f6cc3f908d761c67b89%7Ca652971c7d2e4d9ba6a4 > d149256f461b%7C0%7C0%7C637085377412009134&sdata=3DAXgzWWkU8I > yr3zm5z%2FPW%2B9p%2Fein7d87Jdr2dclqe71s%3D&reserved=3D0 >=20 > Signed-off-by: Yongseok Koh > Signed-off-by: Viacheslav Ovsiienko For all the series: Acked-by: Matan Azrad > Viacheslav Ovsiienko (20): > net/mlx5: convert internal tag endianness > net/mlx5: update modify header action translator > net/mlx5: add metadata register copy > net/mlx5: refactor flow structure > net/mlx5: update flow functions > net/mlx5: update meta register matcher set > net/mlx5: rename structure and function > net/mlx5: check metadata registers availability > net/mlx5: add devarg for extensive metadata support > net/mlx5: adjust shared register according to mask > net/mlx5: check the maximal modify actions number > net/mlx5: update metadata register id query > net/mlx5: add flow tag support > net/mlx5: extend flow mark support > net/mlx5: extend flow meta data support > net/mlx5: add meta data support to Rx datapath > net/mlx5: add simple hash table > net/mlx5: introduce flow splitters chain > net/mlx5: split Rx flows to provide metadata copy > net/mlx5: add metadata register copy table >=20 > doc/guides/nics/mlx5.rst | 49 + > drivers/net/mlx5/mlx5.c | 135 ++- > drivers/net/mlx5/mlx5.h | 19 +- > drivers/net/mlx5/mlx5_defs.h | 7 + > drivers/net/mlx5/mlx5_ethdev.c | 8 +- > drivers/net/mlx5/mlx5_flow.c | 1178 ++++++++++++++++++++++- > drivers/net/mlx5/mlx5_flow.h | 108 ++- > drivers/net/mlx5/mlx5_flow_dv.c | 1544 > ++++++++++++++++++++++++------ > drivers/net/mlx5/mlx5_flow_verbs.c | 55 +- > drivers/net/mlx5/mlx5_prm.h | 45 +- > drivers/net/mlx5/mlx5_rxtx.c | 6 + > drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 25 +- > drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 23 + > drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 27 +- > drivers/net/mlx5/mlx5_utils.h | 115 ++- > 15 files changed, 2922 insertions(+), 422 deletions(-) >=20 > -- > 1.8.3.1