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 11DC5A0C4C; Mon, 4 Oct 2021 11:38:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88EAB412FF; Mon, 4 Oct 2021 11:38:54 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2048.outbound.protection.outlook.com [40.107.93.48]) by mails.dpdk.org (Postfix) with ESMTP id 67582412FB for ; Mon, 4 Oct 2021 11:38:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BQnLuvP7KoaWHSUANxWhoXtmoeGAAPhNdoNgDGMLjkIAZdRmtfxm7g5Bf1qFnz5HMJ4lZqBbCbtHLg9wbnsg4/DxVqQyIdSuoKeLWmZXE7p7Z2m/izWDMbWIm1e+0m9aNVoEhvhe49PfJtDIJxvWzIqTpVoeNfyK9xbJ6OxAWfGQA4vltykCdxiEaLi8BLzrrtQiM7AYxqzeqN2Mmn6iVN/N3SqZCLwuX1IWmkt+U9fOhMQldlKKVnoX5VUYcY61OymELrVlvwbBiIPY/9MhC26xYJAEslQR4kj171CxhcOZBQl/yu8Y0ieApwCEgZQgG08ZYOMvX3TQN6Usk6ASYQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MzcSnbVh+7hN9APQlPmUXyiHYNi7AoI0EKh3l2ZzqS8=; b=HBEVCMiw9+ke7wfHE0kn1WKqQmulzTrTUr/JRk3NyVnMsjZSVKcPLwu7AowIbhR9vfHXTrYPeXIUsJvF71RgpCkBFpJ3RtMzI0jYrQSu3xrp7KhMhYAvJTo9VZBi3peiuXukO1M003N0rpSLconpj9gmhGpyp9uHolFBxhdYMt2cSq1y+EFruwU3t/ar8vPOvOyLZcF8Yh84aV70Va1xY94Br3i6VzCqB5QV5HitlJFRlabdKZbQsvI4K8Pr/SlkrxFhSXo3cA32UwVRClWIAMpxgxWJJBkLEuKkW6qglNmSM1XQCzYDnK5yHPKiLJWr/vlVdJ/xYqij4e81ETwO2A== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MzcSnbVh+7hN9APQlPmUXyiHYNi7AoI0EKh3l2ZzqS8=; b=lJ1RyCb/yPKznQAfVhrIVgvFDmxEjAR3w4eRmDNMf+Wy2GCvvVny0HC+NnBsVsnpEnXLw/RHrEslaXwHTOXeSm9CV1P48q7QALH7PyRo0UHBJoTuqJNbhvRKETp60asp73cepPZBzDMC8NqhSV8FcBrNGlQ299HOZAKehu45semATtNhjNvWOdcqq5W/TuihsxzTpLWHo6IcbzxT7f2FXLYLMXYM9iYgjhcLrv3t68uCfuHkDEhpv1FxmHZH2AuF4DJ8LyFOMlw5VFNWvQfj1+aYA6e7UJunErajrZAY1CYKQaO4Wa7FUNgjsq2nV1MgcYNS0X+sPPtDjTt8m6wWzw== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM4PR12MB5389.namprd12.prod.outlook.com (2603:10b6:5:39a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Mon, 4 Oct 2021 09:38:52 +0000 Received: from DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32]) by DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32%5]) with mapi id 15.20.4566.022; Mon, 4 Oct 2021 09:38:52 +0000 From: Ori Kam To: Slava Ovsiienko , "dev@dpdk.org" CC: Raslan Darawsheh , Matan Azrad , Shahaf Shuler , Gregory Etelson , NBU-Contact-Thomas Monjalon Thread-Topic: [PATCH 1/3] ethdev: update modify field flow action Thread-Index: AQHXtv3vNz/ogEUy0UufBOn8p/OVY6vClk4w Date: Mon, 4 Oct 2021 09:38:51 +0000 Message-ID: References: <20210910141609.8410-1-viacheslavo@nvidia.com> <20211001195223.31909-1-viacheslavo@nvidia.com> <20211001195223.31909-2-viacheslavo@nvidia.com> In-Reply-To: <20211001195223.31909-2-viacheslavo@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 117b45b4-2367-4af2-d05a-08d9871ac692 x-ms-traffictypediagnostic: DM4PR12MB5389: 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:4125; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: i5A8Xh60Eqxd2k9lYL/jzOpXH9tTmH0BYx0JB79uwAXNVBoERu3hWkp8Ie6DeSBTB5qsiihk1BtTHusZtQT8Jx4UEq4y9Obzw9WvB6wuYLkRFejtENmiYYKZEEOvGR/AtSC07KQEqbmF6zuI3jQ0Gp6sni+3hKq0+LNcNDQz5Lw3PfX7qImmNiJg+tjzRKELlWEWQoiZWZ+k5AY8Nb+UR0HRR/TQfH1SZDgUTI/MUkLmxwILbmtWq1TwyahO8vqI6bj5/OjRM0IbcgiSPDDWYD+LUEKFcsDdduVX7qQl7lTEhfpVKNxe1+O9Cs7331UEMCBVG57aAar4Qi4np2h/hAmO8+Rdrs+WXNI3zcpkljK6rZ9DmIMpPL6VEiOsc95eUv5p3SL46kwuO/fcn9R1QrnvETvs6o4Wchw2GgdYinaGgftX71fZNLnDOoxfSZkmvyDp+F4q62EnkDMjrEtBp7HM9vl2MDti9DoeH0fDdljZ5R0CrjsQCXsvVxk5wtt1h+5xoAU2DVycckziruWLJZabqxn/SLpM+yHrAPNScloKUj2ZqELn2OrrXJ6ihw4OCusI6g6HgIoIMcLTj5fF/VFq4wZ/5bd2NRFKDRHfTwXiinymtVi/0wXmQgJUR/WdcE1aERwwJ16RsrnUZTogg4Vx1K4l3wZ5ybAlel/Twk1/5UnthNRvVngVZs8RI4xPTRIhzdeJxVP+CwISRf8uI2FtJtZRFmIfMcDe2X/UFc0= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR12MB5400.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8676002)(6506007)(76116006)(15650500001)(64756008)(316002)(186003)(66476007)(66446008)(66556008)(7696005)(33656002)(53546011)(5660300002)(66946007)(9686003)(52536014)(55016002)(83380400001)(71200400001)(38070700005)(86362001)(122000001)(110136005)(4326008)(38100700002)(54906003)(8936002)(2906002)(508600001)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?t1HDyco7vnH1SOHC5DYvsZAXslrCDu/FhIoAAC/3TAqR9suf5zsE831QM4RP?= =?us-ascii?Q?wlYkGwD6KALGQgjWpynArJeYmhTckLmqg6v63VMPFRxCckGO9i/uITx2yBAZ?= =?us-ascii?Q?hLgOn8029HuETxE4rOhrkuNvXDwbILAGnVF9zC+asu8KPxo5xZl+IzHl1Gzl?= =?us-ascii?Q?jvTpEMHUFs8n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us-ascii?Q?i9VXlnGHhfUn2/Kg3OR4UpL/LGJGY1/jJuKHv6/fZnr3ODjL1VmLzFZRTr/Y?= =?us-ascii?Q?e3jzDLmFuIhH3Sgr1OuporHDh37odjWOm2WpQSPNR8Y6V6FnfoOffgf5snxh?= =?us-ascii?Q?NPFlN0haB5SDZQo4wzoqW2QzW9TRbinWbe9rYhPsNCykyd5VPrO9R136gjN4?= =?us-ascii?Q?zYc3wRJY0xYm8VbPnvytSEh9DIZwV8azChdAhhxyypkWEoSSVd/Ka8K4cq4W?= =?us-ascii?Q?nL2UvIrDTtjZ38I2iQeXmo9QaGDGo6ccxkF1lj4XTQUuhdoeR+CVqQETyVy/?= =?us-ascii?Q?Qta5t/Z8PCIA61wBnvRgXhNmMoyb?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR12MB5400.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 117b45b4-2367-4af2-d05a-08d9871ac692 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2021 09:38:51.8751 (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: p9KBrLFwnpHO4slPtacXYzob2wWQtALOPgwxzHlOQ0tpTwxlpFNREj56dyxY5CzdxdCdgzgJSSUFmchfYIC2pg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5389 Subject: Re: [dpdk-dev] [PATCH 1/3] ethdev: update modify field 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 Slava, > -----Original Message----- > From: Slava Ovsiienko > Sent: Friday, October 1, 2021 10:52 PM > Subject: [PATCH 1/3] ethdev: update modify field flow action >=20 > The generic modify field flow action introduced in [1] has some issues re= lated > to the immediate source operand: >=20 > - immediate source can be presented either as an unsigned > 64-bit integer or pointer to data pattern in memory. > There was no explicit pointer field defined in the union >=20 > - the byte ordering for 64-bit integer was not specified. > Many fields have lesser lengths and byte ordering > is crucial. >=20 > - how the bit offset is applied to the immediate source > field was not defined and documented >=20 > - 64-bit integer size is not enough to provide MAC and I think for mac it is enough. > IPv6 addresses >=20 > In order to cover the issues and exclude any ambiguities the following is > done: >=20 > - introduce the explicit pointer field > in rte_flow_action_modify_data structure >=20 > - replace the 64-bit unsigned integer with 16-byte array >=20 > - update the modify field flow action documentation >=20 > [1] commit 73b68f4c54a0 ("ethdev: introduce generic modify flow action") >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > doc/guides/prog_guide/rte_flow.rst | 8 ++++++++ > doc/guides/rel_notes/release_21_11.rst | 7 +++++++ > lib/ethdev/rte_flow.h | 15 ++++++++++++--- > 3 files changed, 27 insertions(+), 3 deletions(-) >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index 2b42d5ec8c..a54760a7b4 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -2835,6 +2835,14 @@ a packet to any other part of it. > ``value`` sets an immediate value to be used as a source or points to a > location of the value in memory. It is used instead of ``level`` and ``of= fset`` > for ``RTE_FLOW_FIELD_VALUE`` and ``RTE_FLOW_FIELD_POINTER`` > respectively. > +The data in memory should be presented exactly in the same byte order > +and length as in the relevant flow item, i.e. data for field with type > +RTE_FLOW_FIELD_MAC_DST should follow the conventions of dst field in > +rte_flow_item_eth structure, with type RTE_FLOW_FIELD_IPV6_SRC - > +rte_flow_item_ipv6 conventions, and so on. The bitfield exatracted from > +the memory being applied as second operation parameter is defined by > +width and the destination field offset. If the field size is large than > +16 bytes the pattern can be provided as pointer only. >=20 You should specify where is the offset of the src is taken from. Per your example if the application wants to change the 2 byte of source ma= c it should giveas an imidate value 6 bytes, with the second byte as the new = value to set so from where do it takes the offset? Since offset is not valid in case of = immediate value. I assume it is based on the offset of the destination. > .. _table_rte_flow_action_modify_field: >=20 > diff --git a/doc/guides/rel_notes/release_21_11.rst > b/doc/guides/rel_notes/release_21_11.rst > index 73e377a007..7db6cccab0 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -170,6 +170,10 @@ API Changes > the crypto/security operation. This field will be used to communicate > events such as soft expiry with IPsec in lookaside mode. >=20 > +* ethdev: ``rte_flow_action_modify_data`` structure udpdated, immediate > +data > + array is extended, data pointer field is explicitly added to union, > +the > + action behavior is defined in more strict fashion and documentation > uddated. > + Uddated ->updated? I think it is important to document here that the behavior has changed, from seting only the relevant value to update to setting all the field and the mask is done internally. >=20 > ABI Changes > ----------- > @@ -206,6 +210,9 @@ ABI Changes > and hard expiry limits. Limits can be either in number of packets or b= ytes. >=20 >=20 > +* ethdev: ``rte_flow_action_modify_data`` structure udpdated. > + > + > Known Issues > ------------ >=20 > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index > 7b1ed7f110..af4c693ead 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -3204,6 +3204,9 @@ enum rte_flow_field_id { }; >=20 > /** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > * Field description for MODIFY_FIELD action. > */ > struct rte_flow_action_modify_data { > @@ -3217,10 +3220,16 @@ struct rte_flow_action_modify_data { > uint32_t offset; > }; > /** > - * Immediate value for RTE_FLOW_FIELD_VALUE or > - * memory address for RTE_FLOW_FIELD_POINTER. > + * Immediate value for RTE_FLOW_FIELD_VALUE, presented > in the > + * same byte order and length as in relevant > rte_flow_item_xxx. Please see my comment about how to get the offset. > */ > - uint64_t value; > + uint8_t value[16]; > + /* > + * Memory address for RTE_FLOW_FIELD_POINTER, memory > layout > + * should be the same as for relevant field in the > + * rte_flow_item_xxx structure. I assume also in this case the offset comes from the dest right? > + */ > + void *pvalue; > }; > }; >=20 > -- > 2.18.1 Thanks, Ori