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 A2257A04AD; Thu, 7 Nov 2019 23:46:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 775691BFCD; Thu, 7 Nov 2019 23:46:48 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150048.outbound.protection.outlook.com [40.107.15.48]) by dpdk.org (Postfix) with ESMTP id 5D10D1BF00 for ; Thu, 7 Nov 2019 23:46:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NVVNWepSwVZ3pFCZK+oj5UWVCpgwQ9gj0012WR0DupYLbOFayz6R0nkL9+qqqXRglZnxUGSpEZts3ulfgMgF+UJUbNM0WLPASt3XR+Ad2FH4OCuLWDc9AtRqCChlLOjfRTolO+EityV2/MDDi6HDM6BSvrbbJUz3e48c6kWy8IC5hiC5AZhO4+/7sIN348DrBz1cKRvxToxlzRRhvq2r5C/L3IB+IHLUSy/6dcqJT7YT9unFbLY9ruefpLdSCCZ4sZQh0/1Qge4lgImWIDoN4mym1UuyIi+MUsrXn2KaLsgRK4eTzd0rOHhggulGIVS8mgKW+rqkHJ8t1L/N1fgorg== 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=bks9z55ew97qd4R4Ew7UiJl3h5UvAislJwJzdGv7xmQ=; b=Qn8vUmI1KC8thN+4k2gtQar9OlH768PL9f3KujfUQFB3z01Mmbh2lIwASk0/5HidOvfdWXmEp26WHyr8/Rursgkea22pPu3Xf1M5EwCGO/p5vXQVOE0+K4uJZOtG+58Hu1jd/gd+34Jus8XLyMixiJQ2qRI+GET6mGJfqTX9mzc4NQC2pmiqCajKjNTBJpazty+D9NZ5BWujVmZ/vI9Q86FpkByL2S77jVdHMJ04eU9GEmLlEQ2J95qQOXf5wIAg+jKNfXAATcJHDL8BOn0ARcdkawyP7sXA+W8q4XdFefsxm/XQ+nyDMZu+AgxITSa+Aygvr1N7ljGv9kXE5Mf4hw== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bks9z55ew97qd4R4Ew7UiJl3h5UvAislJwJzdGv7xmQ=; b=FFHfnVxXs0ptEux4UIIa1zu8sEgDcFFogZgksKPSG5W1Q6ruLY1dy+4ijLCo7hLFxraRv7xA/ffSU1p3qVCnKvc4HpBAZhhkKs/YQrx98uR/qAPsvDLsC0z2JH9IautQBh2rU+Bwo+6wQabKuKZuUgBhawB8CNvL5gbQ1wXL//M= Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com (52.134.65.161) by DB3PR0502MB4076.eurprd05.prod.outlook.com (52.134.66.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.23; Thu, 7 Nov 2019 22:46:45 +0000 Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::a850:bac9:c90f:f2f5]) by DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::a850:bac9:c90f:f2f5%6]) with mapi id 15.20.2408.028; Thu, 7 Nov 2019 22:46:45 +0000 From: Raslan Darawsheh To: Slava Ovsiienko , "dev@dpdk.org" CC: Matan Azrad , Thomas Monjalon , Ori Kam , Yongseok Koh Thread-Topic: [PATCH v3 00/19] net/mlx5: implement extensive metadata feature Thread-Index: AQHVlY49qq5BNvmp70CyeHg2QNRYj6eATz+A Date: Thu, 7 Nov 2019 22:46:45 +0000 Message-ID: References: <1572940915-29416-1-git-send-email-viacheslavo@mellanox.com> <1573146604-17803-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1573146604-17803-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=rasland@mellanox.com; x-originating-ip: [188.161.230.21] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b1f0ad90-b758-451b-b514-08d763d45e1f x-ms-traffictypediagnostic: DB3PR0502MB4076:|DB3PR0502MB4076: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0214EB3F68 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(39850400004)(136003)(346002)(376002)(396003)(13464003)(199004)(189003)(64756008)(14454004)(110136005)(54906003)(229853002)(5024004)(14444005)(256004)(25786009)(6116002)(26005)(966005)(102836004)(5660300002)(4326008)(6306002)(6246003)(3846002)(186003)(107886003)(52536014)(71190400001)(71200400001)(9686003)(66066001)(8676002)(81156014)(81166006)(478600001)(11346002)(76176011)(446003)(2906002)(74316002)(76116006)(53546011)(33656002)(2501003)(86362001)(305945005)(7736002)(45080400002)(66946007)(6506007)(8936002)(486006)(316002)(99286004)(7696005)(66476007)(55016002)(6436002)(476003)(66446008)(66556008); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4076; H:DB3PR0502MB3964.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: lp9o+XAyoQyK8KoM7Led8UCDop+4aTcI1OJfIDyz9xWy2rEYEGDQPu4Ifft3i/uyxg2Dw4AO4SY2L5IS0FBMT0sQJ3vOLxt5aA1hf0SB2CYO9vdWRJ9lyFzXGhRLGcTs8bswUGZOGHpz0wNZqUocSylr9zAp3MsEZq1fPSGTgciMuuU94+cupyFHQH8VybDTKq2Gpc9PYy5thEKsWZFArlldp2j5mZT79c/z9bF3LB+yXlRaJD36FFbFwWgj+bzcolGVgExpEny8EYUEquxu0zMl02V+eaSgIxMQ73YMj8KxvE+v1doJbuqeqQ41w1Q9DK8LwWFZxCuwNdfFNu0LdZj/HQjpfwOYxCgZahT+kD+pjAwAiq8q7DQ0Iwygus+DcB428u14+QkMxSh3hdBdSrRy4WAdh5qMgQ9f/RZf7+vqqTYF3rMDwXGv/FmGjWvz 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: b1f0ad90-b758-451b-b514-08d763d45e1f X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2019 22:46:45.7958 (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: WHVnELp270G8N1cPIWxYQjfA1pvqcKe3V9+ygtE6H+LRXE9pT6FXJ26blda93eGrzAfRlluMZpiyrRqs/JZSiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4076 Subject: Re: [dpdk-dev] [PATCH v3 00/19] 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" Hi, > -----Original Message----- > From: Viacheslav Ovsiienko > Sent: Thursday, November 7, 2019 7:10 PM > To: dev@dpdk.org > Cc: Matan Azrad ; Raslan Darawsheh > ; Thomas Monjalon ; Ori > Kam ; Yongseok Koh > Subject: [PATCH v3 00/19] net/mlx5: implement extensive metadata feature >=20 > 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 hashed list patch: >=20 > [1] > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatch > es.dpdk.org%2Fpatch%2F62539%2F&data=3D02%7C01%7Crasland%40mell > anox.com%7C104e9a22f43a4faace5108d763a55e70%7Ca652971c7d2e4d9ba6 > a4d149256f461b%7C0%7C0%7C637087434230552807&sdata=3D7xYZEaSke > MCeBXDz8NRXKw7iMnBFzzf4Fb7%2FjYRJm3g%3D&reserved=3D0 >=20 > Signed-off-by: Yongseok Koh > Signed-off-by: Viacheslav Ovsiienko > Acked-by: Matan Azrad >=20 > --- > v3: - moved missed part from isolated debug commit > - rebased >=20 > v2: - > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatch > es.dpdk.org%2Fcover%2F62579%2F&data=3D02%7C01%7Crasland%40mell > anox.com%7C104e9a22f43a4faace5108d763a55e70%7Ca652971c7d2e4d9ba6 > a4d149256f461b%7C0%7C0%7C637087434230552807&sdata=3D2f9iQrJtTp9 > HqVAy%2BHANBfco%2BZsCAgd5Y8pI4iLPndE%3D&reserved=3D0 > - fix: metadata endianess > - fix: infinite loop in header modify update routine > - fix: reg_c_3 is reserved for split shared tag > - fix: vport mask and value endianess > - hash list implementation removed > - rebased >=20 > v1: > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatch > es.dpdk.org%2Fcover%2F62419%2F&data=3D02%7C01%7Crasland%40mell > anox.com%7C104e9a22f43a4faace5108d763a55e70%7Ca652971c7d2e4d9ba6 > a4d149256f461b%7C0%7C0%7C637087434230552807&sdata=3DcV5lXlXExtZ > CUPloJESwjqBlqrNyN4OI6OMUURKP2XI%3D&reserved=3D0 >=20 > Viacheslav Ovsiienko (19): > 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: 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 | 150 ++- > drivers/net/mlx5/mlx5.h | 19 +- > drivers/net/mlx5/mlx5_defs.h | 8 + > drivers/net/mlx5/mlx5_ethdev.c | 8 +- > drivers/net/mlx5/mlx5_flow.c | 1201 ++++++++++++++++++++++- > drivers/net/mlx5/mlx5_flow.h | 108 ++- > drivers/net/mlx5/mlx5_flow_dv.c | 1566 > ++++++++++++++++++++++++------ > drivers/net/mlx5/mlx5_flow_verbs.c | 55 +- > drivers/net/mlx5/mlx5_prm.h | 45 +- > drivers/net/mlx5/mlx5_rxtx.c | 5 + > 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 +- > 14 files changed, 2866 insertions(+), 423 deletions(-) >=20 > -- > 1.8.3.1 Series applied to next-net-mlx, Kindest regards, Raslan Darawsheh