From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 63CF2A0A02; Thu, 14 Jan 2021 16:02:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1BD8B14134D; Thu, 14 Jan 2021 16:02:23 +0100 (CET) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by mails.dpdk.org (Postfix) with ESMTP id 56A1214134C for ; Thu, 14 Jan 2021 16:02:21 +0100 (CET) Received: from HKMAIL101.nvidia.com (Not Verified[10.18.92.100]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 14 Jan 2021 23:02:19 +0800 Received: from HKMAIL104.nvidia.com (10.18.16.13) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 14 Jan 2021 15:02:15 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 14 Jan 2021 15:02:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BFkADdhuhLar1jS3JA7+V0W7Gx4nspbzYOxo0tTHLxSqn9UUIcSssOlXkcZ6HnYZWObGHfe5dQLafNWsQNeUbCx501lpj4uIzq7xh9GzntUY4j+Z4LB9FMrcCDeQgMi/bzqvDpjLvFZQS416kC/e01vC7HFa1cuZA0jrsF4t3nXM4p4yPk3LH8AKCn2FPPQ+GZP1STDGkc95/P8cDC9bZGRmA0K56ZomH4UcPpjqj2w7aVGlnShTr9p8Ah3NfYYYkv+hqZw89LOXjPe1AsHhIypaVyq0BCSxF6IzbWmR9NLczcKiXTl5ZSEZ5DQjt8ojXV02VKit5zXli5aXVGkDaw== 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=SglDdTMjsOeNT82t9kz8xN/zMywx130W+NP0vfGUN4s=; b=hGHikNtYhQrMcEYkVi5QuJ+QJf8OtNK9X2EbjzLCtFZ8GAFKTciTO2CYXKAnD3sD982+4cP0/tr/cMvvm7fXhC7mnBGL6+5Tn/eL5us5sQd3lZtOYQZItTwuAnksjXzl5HEwVS5zfFqe4OLRbpXi2xX/tFbD7RuUr0T5F/4QufTVLC1DYMxQfuu1TAoOux5gbDGt8IaCOE4W4FWCLbpi1a4+6dpvOms47zY1KslIQGve1QVcjZYFTjli0LXI88/TPPdEtkVCPwO1W4Nq4lEQYGA5iyXeGPVbAHWLCLLdX17EQOFYnoSQR4fJcENCBsJ4wwi5FiZRoK+FQBBpwtCQ3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB4987.namprd12.prod.outlook.com (2603:10b6:5:163::31) by DM6PR12MB2889.namprd12.prod.outlook.com (2603:10b6:5:18a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Thu, 14 Jan 2021 15:02:12 +0000 Received: from DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::e1e4:bf73:a753:2665]) by DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::e1e4:bf73:a753:2665%4]) with mapi id 15.20.3763.010; Thu, 14 Jan 2021 15:02:12 +0000 From: Ori Kam To: Jerin Jacob , Alexander Kozyrev , Cristian Dumitrescu , "aboyer@pensando.io" CC: dpdk-dev , Slava Ovsiienko , NBU-Contact-Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Thread-Topic: [dpdk-dev] [PATCH] ethdev: introduce generic copy rte flow action Thread-Index: AQHW5YgR+7Ov3GfAIkW0PNLie6o6JqonL/GAgAAQlDA= Date: Thu, 14 Jan 2021 15:02:12 +0000 Message-ID: References: <20210108063234.7679-1-akozyrev@nvidia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [147.236.145.126] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f4381cc8-7938-49cb-5e9c-08d8b89d5fa2 x-ms-traffictypediagnostic: DM6PR12MB2889: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Low/6w2MN5KDV7IMfKY6lbduf/ewYtZ3EQHbHqwGO5iX75leGFyEfbBXYcmL5KK5XIzG2i8K/3S/hmsU8HZCPZqEXRDWG3PCzTjcObfGCRxjvMH9ZwKJtwRwTRyUOZNGKIehE5Pf1tfNNdtO9U1zBmk4jmyBfNtLuiEFaedOfKaFGFkEZPJtG/u73fcrqz7INW0gwyqOvRe/qRF42028kza//V9xgW+gGUpjf02h1l+trjD8m6vIzkDzDwyRdRYWNCOVaW4Euh3VNe0NtpWR4GRtH/ZstwtYAr9gjAHw/jwGPraOX66jR2QXRjfHWwCgP2No/P0LmINvSe0uUPPONZ27m5mwjfvMASx0Y7EKb6Bbb7Xxo3KJzDEwvH216gLJB4um/M6XQTX3aQW0h72Ukt43EBG4eJv1owJsI7m43aMlj0pp4xf7OzGzYeL49j4x8OWY3NRyLmJuevUGQ/B+Or0+mUV4Y8+w9YyYUtXgCqz4dLBDK+H98NuFPLYShffOj7XWwO4FO874erShf7G8cA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4987.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(136003)(366004)(396003)(346002)(9686003)(53546011)(186003)(2906002)(33656002)(5660300002)(52536014)(316002)(55016002)(66476007)(8676002)(66946007)(54906003)(8936002)(71200400001)(64756008)(66556008)(45080400002)(7696005)(86362001)(478600001)(4326008)(83380400001)(76116006)(26005)(6506007)(66446008)(110136005)(966005)(41533002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?49UO/ojoY49h/TTTmqMhpXTJvKBRDC3g7/9NJk36jc3Pmn5f9aWcIC/Ed8tV?= =?us-ascii?Q?cV/BUQQIG/FteLhqev9s84bQ/SlyUWuUTigbSikvZpnP/MWjX78A+OKBEedn?= =?us-ascii?Q?zJGzhnBOQVgSF6McMrLvoTxzExSU7Nwp1gYvMoZLJa4NfG2FPLt68kTsI+jT?= =?us-ascii?Q?IKW3k5R6NlbMtaRJLx7HjgndUJwZNh2ImphL3TuXcca8dnG5t5AEak4SVC27?= =?us-ascii?Q?KGiOquvCAiQE+vbb5g9lfCBizLWcXMOzlTjZEZ6D9F51wUy5cC3/u3wlb0vC?= =?us-ascii?Q?43ZgSJ7p+EvnHifiTCgGohARjaPBik0MZInQNVxZJu15dkD5VxEhuotoPDjO?= =?us-ascii?Q?Ft7WKZnRpT93XswbVTudzVJ0na5i9u7ibJoIDqPOG+bT8QpX52YWy2KCsrxq?= =?us-ascii?Q?Rt+xm7ziGMfiSwCYz9/d8KL5NdpSDxmvomLXUr0/6bZatv0objUj0lka2p5F?= =?us-ascii?Q?TVJjM49YSj8p3i/+Q1dinuTMIBmv8Dt2cAJ5cJm25wQp5hDa9Lq5jOKIIkpc?= =?us-ascii?Q?ndmzV5oyUrjL3/+6ZiW3YFLFwL3rfPsQFmYoC4fKdQYsHL7vVqN7Ed06dEKZ?= =?us-ascii?Q?6jlL8AWtSzP7vNn4uzm3QMCNPMFNReKDGSWtmV0txQOYaNCq4BrMGlbnlHXO?= =?us-ascii?Q?D/VbDGwhf5JK1aklVZsefzdbcXC6s14gfyQUDSxWjnfCrWJosUPUpL+LxOXI?= =?us-ascii?Q?JJdiPt4+xUfJbCxZvGD70Ajx6iuVlKDq16sUQUP9LFrJIRdWMDzbvk6Ec2Ov?= =?us-ascii?Q?oP8Pj2HgGJhwt/AVygViGI4WciOfIzoTRwadf2dLsk+y/8qPu/hE6gmbLJoH?= =?us-ascii?Q?3r/W7v1V3XDa5GsxOMiFiBZUsu9kH1hvk5p44KGjaPUAe3QHyd45d5g/tVw5?= =?us-ascii?Q?b2GCoJjh3KhyyBJzaay3oUlTwIN7SYj4Ms291LJoA9FZkrIUkcnEdXiRRYNZ?= =?us-ascii?Q?vN/SWc1baKV+hRWXjNlFs9Q/AIk5jSjiNCOTKkkiW/M=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4987.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4381cc8-7938-49cb-5e9c-08d8b89d5fa2 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2021 15:02:12.5778 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bePkNFujadj3LCtR4fYaatU4smv2ynVvkWNEjpkgaCjEjwcMJYSG6evr4WA7thNAwfGkgYjO1u2+djijvJZn6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2889 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1610636539; bh=SglDdTMjsOeNT82t9kz8xN/zMywx130W+NP0vfGUN4s=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=CQaqOsCR1FRR1xJj7FNy/vkITqftTWRwpC8Ddd6y6rhDnXjaIM2TOnb4CbNvhBAkO rfWHN4qV9DvdtS6eDw64J6PgvWSwwe/6KAkLLIYDta9X1L3LKe/0KmxkYo1Nxltfby DrGkMPzF3V//E0/ll+Q9htGC1TrGbEMSMDM8oTdl1l5iEcWOI3+dZr9OUccSOvkGqX cFCxDIVnBfpiGtS8He5C/COirtDgTw+B2/Y+mrPszzNJ4oEYfKxMdYmCCwiKxP7CIc QNvZc5C+6WG+pZ8hUL3vkP4YWVukWURvLhxHi2clg2oQQZxEkTNubYUgsS4p5x6CWO o9e8WZZWZu2kg== Subject: Re: [dpdk-dev] [PATCH] ethdev: introduce generic copy rte flow action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 Jerin, > -----Original Message----- > From: Jerin Jacob > Sent: Thursday, January 14, 2021 4:00 PM > Subject: Re: [dpdk-dev] [PATCH] ethdev: introduce generic copy rte flow a= ction >=20 > On Fri, Jan 8, 2021 at 12:02 PM Alexander Kozyrev > wrote: > > > > Implement a generic copy flow API to allow copying of an arbitrary > > header field (as well as mark, metadata or tag) to another item. > > > > This generic copy mechanism removes the necessity to implement a > > separate RTE Flow action every time we need to modify a new packet > > field in the future. A user-provided value can be used from a > > specified tag/metadata or directly copied from other packet field. > > > > The number of bits to copy as well as the offset to start from can > > be specified to allow a partial copy or copy into an arbitrary > > place in a packet for greater flexibility. > > > > RFC: > https://nam11.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s.d > pdk.org%2Fpatch%2F85384%2F&data=3D04%7C01%7Corika%40nvidia.com% > 7C62ab41b9ed5948d056c308d8b894af02%7C43083d15727340c1b7db39efd9cc > c17a%7C0%7C0%7C637462296023413253%7CUnknown%7CTWFpbGZsb3d8eyJ > WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C > 1000&sdata=3DovpEss3%2B7TgZRYFiDkrvuMFW52747Gno5oOIeDLwrBQ%3D > &reserved=3D0 > > > > Signed-off-by: Alexander Kozyrev > > --- >=20 > > > > +Action: ``COPY_ITEM`` > > +^^^^^^^^^^^^^^^^^^^^^ > > + > > +Copy ``width`` bits from ``src`` item to ``dst`` item. > > + > > +An arbitrary header field (as well as mark, metadata or tag values) > > +can be used as both source and destination items as set by ``item``. > > + > > +Inner packet header fields can be accessed using the ``index`` and > > +it is possible to start the copy from the ``offset`` bits in an item. > > + > > +.. _table_rte_flow_action_copy_item: > > + > > +.. table:: COPY_ITEM > > + > > + +-----------------------------------------+ > > + | Field | Value | > > + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > > + | ``dst`` | destination item | > > + | ``src`` | source item | > > + | ``width`` | number of bits to copy | >=20 >=20 >=20 > Overall it is a good improvement. >=20 > I think, if we add transform "op" here then it can be more generic. In > other words, A generic packet transform and copy operation is just one > of the operations. > ie.. making it as rte_flow_action_xform_item and introduce COPY, ADD, > SUB, etc transform along with existing rte_flow_action_copy_item > fields. >=20 > It may useful for expressing P4 packet transforms to rte_flow. >=20 > The current generation of Marvell HW does not have COPY transform so I > am leaving suggestions to vendors with this HW capablity. >=20 >=20 +1=20 Lest have dst, src, width, op members, and change the action name to rte_flow_action_modify_field() also lest add new field name immediate so the copy can be used as set. (copy of an immediate value is a set) Possible op =3D copy / add / sub > > + +---------------+-------------------------+ >=20 >=20 >=20 >=20 > > + > > +.. _table_rte_flow_action_copy_data: > > + > > +.. table:: destination/source item definition > > + > > + +----------------------------------------------------------+ > > + | Field | Value | > > + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > > + | ``item`` | ID of a packet field/mark/metadata/tag | > > + | ``index`` | index of outer/inner header or tag array | > > + | ``offset`` | number of bits to skip during the copy | > > + +---------------+------------------------------------------+ > > +