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 8674741BA5; Thu, 2 Feb 2023 03:59:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 568B042D1D; Thu, 2 Feb 2023 03:59:29 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2046.outbound.protection.outlook.com [40.107.94.46]) by mails.dpdk.org (Postfix) with ESMTP id 972A54067B for ; Thu, 2 Feb 2023 03:59:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FLq5uU6SXyOmmbYJSndSzFP4yYwe/qLw/favmDql+zSRVK4qaNtQKNLe/LOQAEss5GxlNu816aMHUQoKhKp6c8bNkzA0m9K86KWyFGCONzMBn5pWbzs834xSM+qaVsO7WVDbxesYje8U0kLvqiOY67e2WaJJrhq9X1uFr/SviFAM3lqRTxBo11Ec8T9OmI7yXL3VQGawSu7j8fyv688Z2pkikxSm3YKH6PeEqJhz0fy8VBflZrIwADL9fgoK+1KQHUmdkwXiYueCKQcEm/Apz9SVEXaAMXcj9vm1kqxc1kKc1dC5msN9CPEiy7kq1RZXdXDQg5tZft/pi/cD5drjSg== 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=z+Db0Ci5EFcp/QAZMG3C0vXEVEN+hxgM7O/0joai3JY=; b=Lz7LgxgsGLsqXVEev2arAsMqWswQ3ZDgy9MGpXmuDLA/3QARQqG4scmw93S1cs7AChXpKHQEv/qCnFK1VyI/5Y/lu+UZk/nLbIvMQb3gqX/OYoF9s7PCGgavWkuYe4jmZvTgDni7e/R/AOSjHyrgAYq5dXKwR368Em29PdBPkOLig1pzm1HEvYjJwI8ktd7gMjeS0lrA79hGKQWWu9THqTAgaNTISjPJ9U9Nu0SdB63VsrE7ZPCWNdAx+dQnDNuI6DSJbPZDZzkmekGKtxbvXykclfVnknqRFhGNIhePE6oW5xqS6OmiayqvjCS6DsupVK7PEj+vQc4ZvjKnvxrpNg== 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=z+Db0Ci5EFcp/QAZMG3C0vXEVEN+hxgM7O/0joai3JY=; b=N3QZzNYWE1a9WrYrUSwJ7sd6UBjm8IUG/v2N/PVi99uP/TOr2ixgZEBPZ2f0ztIhDwaoiPh1ms0B0/AMwGrUAEL0yPwT/RBlbY1QVx2PipPMRE7IWb1YXXDaWWJZeBkqAACMOZpV+W+GEW+y7gG2DBpn+H7BfGpV/RvTcHUsKUxkXPF65JLD8S6uc5q+2XbsFBHUlBgMgWQ38YM7Tr7d5tPitfYTodtDeGQfjYObd5CZJEwWWAwt78e3WNpCcjBXvz0RhY4xESG7E+eWhjpKbtdTgFFgncj7ZVPBbGbat0O8Mpu+USBdd0t6JsUI1KJYJaBrNKcR+pd//KXnA/8nuw== Received: from BN9PR12MB5273.namprd12.prod.outlook.com (2603:10b6:408:11e::22) by IA1PR12MB6163.namprd12.prod.outlook.com (2603:10b6:208:3e9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 02:59:24 +0000 Received: from BN9PR12MB5273.namprd12.prod.outlook.com ([fe80::2296:10b9:2661:d795]) by BN9PR12MB5273.namprd12.prod.outlook.com ([fe80::2296:10b9:2661:d795%5]) with mapi id 15.20.6064.027; Thu, 2 Feb 2023 02:59:24 +0000 From: Rongwei Liu To: Rongwei Liu , Matan Azrad , Slava Ovsiienko , Ori Kam , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Aman Singh , Yuying Zhang , Ferruh Yigit , Andrew Rybchenko CC: "dev@dpdk.org" , Raslan Darawsheh Subject: RE: [PATCH v3 01/11] ethdev: add flex item modify field support Thread-Topic: [PATCH v3 01/11] ethdev: add flex item modify field support Thread-Index: AQHZNK2pi4IR2wrchkCwnxGrIIQhGq66+y9Q Date: Thu, 2 Feb 2023 02:59:24 +0000 Message-ID: References: <3ba49f25-52d0-fe07-02e6-22a71e0fbe13@oktetlabs.ru> <20230130132000.1715473-1-rongweil@nvidia.com> <20230130132000.1715473-2-rongweil@nvidia.com> In-Reply-To: <20230130132000.1715473-2-rongweil@nvidia.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR12MB5273:EE_|IA1PR12MB6163:EE_ x-ms-office365-filtering-correlation-id: 004d1f7d-8863-4ded-7c2b-08db04c97db8 x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FoBnhwwRrlq0AGj1msU+UbVrsq5b5eNmryU8+blLcTbod99QRFcSkAdYUlKi18Jqs2TtOymUACXaQEunPEL2pPIgI973KOu+IvwQafZNZO+32H3vJzWi3trKaj/doHx4J8jiJUD5k7xWWaCaLN9Zcn6Dvj0076UOusMqwCtk4Ou6F2w4e02l9LTU2K9KEDw/nUa+NCg9G4N/8d0IwQ88MO2iGoKsP2xY5VPrGq1nWN+ZoAyHP2NM0S6NNwjXsRyd7TXP0lBBvASHF/oag5E9StccDl+9S2a7/dVnm6wpp2/B35JifJdmovROhNo38maVsF7DbrYnxAsQ0M/M5U7QWhLuU/guX5nSYzT6ClIN/KXfShdf0o8hKjzL3bwntNN6RjLOR3fT0cDOYTLl8GtBp9D9LGUB3YAVdg0TgsJtYiFydisho04pjeoG5aviVSDtnmZA9/pdWReN6IhkWvYvC9gBh/DDwJ+A1ySSsuwTb7PhNtnJnOycPduyz1nEjfE3jZCFhu7Mfu2yXNGuq3JRdC6kSo8RuCQv7Br4e/1nGmBYPE284GjjK3mqs7ySKKZvWN5lMShHv46j3k3rewOiBWCW6oVwapVDKPnf3S9CVXaK21jxn+SOARu1UrIO+l8vyj6k+AIe+UkUWIiMRpSRIK37GuwOGfiYpVh/ecGMEbz/bGVfHBS3OlfGVjuk7rRuL/mXwVTpLi9sO9S098vDj4YkCPO2GrukWuk+H0zkogc= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR12MB5273.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(136003)(396003)(376002)(366004)(39860400002)(451199018)(38100700002)(122000001)(478600001)(107886003)(6506007)(53546011)(186003)(83380400001)(33656002)(9686003)(26005)(66446008)(64756008)(66556008)(66476007)(4326008)(76116006)(66946007)(316002)(110136005)(54906003)(8676002)(30864003)(2906002)(7696005)(41300700001)(8936002)(71200400001)(86362001)(5660300002)(52536014)(55016003)(38070700005)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?eBkkTTghnR4UzAiF6DIddi7jMqXvOfIaR/KWkfAjFYq95c6KFPWl9eN4KyG7?= =?us-ascii?Q?uw4n2pp30F4XO9PWevw4j04vSxGpjPoJALkIMq8neb0mfrgqSni8By+76OfD?= =?us-ascii?Q?sEFyMkiXeXEdTNpgUMYfDgjoAbHJGm4oAmqLGbaLYIKtugvzNBG0PPNLYvrF?= =?us-ascii?Q?xwH4usp4HADFVlZTifaynktdJI0Fiq9M6oLNp476arkJeBLqpe1r030PK4VK?= =?us-ascii?Q?0COwc7DYgkZ6K8ilyEzrS3qw7QfZ52gena0ZJQ/K3WnqlbmdW3G64kqSSgTk?= =?us-ascii?Q?GMhYThFKZ4WpSkB3isec6Ryg4y9H3Nv/4JQ/hzuB3W3qmwKhRpXhf0VUbwfu?= =?us-ascii?Q?ZV72LBT+N64uvrCcYMb1WcbtaggOJtF+rRyataHMeJbnCqI3zfjr3bKnupro?= =?us-ascii?Q?KCk4ipFuF4hZT8df/z4Hg0FSQAO3CSPFkB61N9EXIim7D6WBwh6wftrcw4t7?= =?us-ascii?Q?vfFvptfKlkbxWd1NWAcUi5iezdg+F3R5NqtduPlOeHA82etSvUcfmDGbyXfw?= =?us-ascii?Q?rYPJWoxoXtKSui5xqM7+BYRa/YtEICe/cj6jIW7t49tClYdz9rxBPUWD1nRg?= =?us-ascii?Q?TCbu2yH+R8JTg2zKY9oi8zqr+X8iQM6gf7cEr0pLfKjN5EpMlcnTwO/idaiz?= =?us-ascii?Q?QQjLa8X6R75C8yM3FHQDHhliG6/2WpfZ3TO31YRI5r/E8kezxTsafGQsoolU?= =?us-ascii?Q?R6UWJt0/zXE3s64ZnJ8ot+i8lFzUVnGTKLmB/rHVCxD8uZalMamiz4spWxhh?= =?us-ascii?Q?tFd7f8h1oOxVLqYPjuxd/g8z+An3PbpXur8YzEBu7UEPvMV5Hd4D0MFdvKcH?= =?us-ascii?Q?h6/ql2EFyKOg8o4EzPpaYdgR1fHblLfg7llCHAhCdTvEijj7yIRYFUVc6fS8?= =?us-ascii?Q?2mjD0znHXsLUNbHQPxDTK+h04KoH6wS8WoMy0YcrLlioNRYE/h0vifGRlCAd?= =?us-ascii?Q?lDXUktW15k1IFGfBEVJVdTGMYHdyfdunLGy3zgpxqODzgt+pInP1ImskEzRX?= =?us-ascii?Q?GTIucrs9DXqjyTvcQDVKpkCQYdAMEeBw0mDyzfJOsLz0Rvf3tWmVLaXWWPWL?= =?us-ascii?Q?cwaHqETz0YWtGrfY8e82j9OTDBo90Ts6p3lRfM7mwb16tp05vXEGD7+fblt8?= =?us-ascii?Q?VHoEgQW1hPv80fgGL7JECbdqxpQ3M3V/7Wz0CLBXgRmqISrsT5G/8A75Ic6m?= =?us-ascii?Q?2E3Mjj8QEG6SPxCrJLC34310220XUstocAHmhiv5n0xSW7nrvC/X5Ywe7/qQ?= =?us-ascii?Q?ZHFnMNySgyOmJjVt1SNbnmsTVXGNP0e6DhV9Xn2ZhM9pOTCE5fmrN1YiJA6e?= =?us-ascii?Q?NWsp7gcLkEmlTcPxIP9dxbQYnIYd8tHTWYozDRVYBtE58T9n9eJhQT9Qd/27?= =?us-ascii?Q?gxPJwYzj+wZgPvzw6SgGyFwPTpH8Rms3ZWHCTGG6rTpmogINwQ4NIqyXOPRF?= =?us-ascii?Q?EtEii+5KgLe9UY18SNg4ZXerd/9Y/L+qEa6uGm8aeiFxi/hEOoxVTiM6/3+w?= =?us-ascii?Q?5RGnLgZK2ChQAdac/0spKMVpvmxtVgss9YcPlwvYeH5uDe5Nc3vdOGn6/Ugt?= =?us-ascii?Q?UVrWMHVbVqAY6kxfqQw=3D?= 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: BN9PR12MB5273.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 004d1f7d-8863-4ded-7c2b-08db04c97db8 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2023 02:59:24.7081 (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: VGNxVPdROVlKjvUbSiP68FRErsGiERx+vxrhN4h/60MoKrgRyFh+u7ARzvUor6OVpeea2/R4zMFFTwYvtrEMOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6163 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 Hi Andrew, Can you share some comments on the modified version v3? BR Rongwei > -----Original Message----- > From: Rongwei Liu > Sent: Monday, January 30, 2023 21:20 > To: Matan Azrad ; Slava Ovsiienko > ; Ori Kam ; NBU-Contact- > Thomas Monjalon (EXTERNAL) ; Aman Singh > ; Yuying Zhang ; > Ferruh Yigit ; Andrew Rybchenko > > Cc: dev@dpdk.org; Raslan Darawsheh > Subject: [PATCH v3 01/11] ethdev: add flex item modify field support >=20 > External email: Use caution opening links or attachments >=20 >=20 > Add flex item as modify field destination. > Add "struct rte_flow_item_flex_handle *flex_handle" into "struct > rte_flow_action_modify_data" as union with existed "level" member. This n= ew > member is dedicated for modifying flex item. >=20 > Add flex item modify field cmdline support. Now user can use testpmd cli = to > specify which flex item to be modified, either source or destination. >=20 > Syntax is as below: > modify_field op set dst_type flex_item dst_level 0 dst_offset 16 src_type= value > src_value 0x123456781020 width 8 >=20 > Signed-off-by: Rongwei Liu > Acked-by: Ori Kam > --- > app/test-pmd/cmdline_flow.c | 89 ++++++++++++++++++++++++-- > doc/guides/prog_guide/rte_flow.rst | 41 +++++++----- > doc/guides/rel_notes/release_23_03.rst | 4 ++ > lib/ethdev/rte_flow.h | 8 ++- > 4 files changed, 116 insertions(+), 26 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 88108498e0..7c12d63cbc 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -601,10 +601,12 @@ enum index { > ACTION_MODIFY_FIELD_DST_TYPE, > ACTION_MODIFY_FIELD_DST_TYPE_VALUE, > ACTION_MODIFY_FIELD_DST_LEVEL, > + ACTION_MODIFY_FIELD_DST_LEVEL_VALUE, > ACTION_MODIFY_FIELD_DST_OFFSET, > ACTION_MODIFY_FIELD_SRC_TYPE, > ACTION_MODIFY_FIELD_SRC_TYPE_VALUE, > ACTION_MODIFY_FIELD_SRC_LEVEL, > + ACTION_MODIFY_FIELD_SRC_LEVEL_VALUE, > ACTION_MODIFY_FIELD_SRC_OFFSET, > ACTION_MODIFY_FIELD_SRC_VALUE, > ACTION_MODIFY_FIELD_SRC_POINTER, @@ -807,7 +809,8 @@ static > const char *const modify_field_ids[] =3D { > "udp_port_src", "udp_port_dst", > "vxlan_vni", "geneve_vni", "gtp_teid", > "tag", "mark", "meta", "pointer", "value", > - "ipv4_ecn", "ipv6_ecn", "gtp_psc_qfi", "meter_color", NULL > + "ipv4_ecn", "ipv6_ecn", "gtp_psc_qfi", "meter_color", > + "flex_item", NULL > }; >=20 > static const char *const meter_colors[] =3D { @@ -2282,6 +2285,10 @@ > parse_vc_modify_field_id(struct context *ctx, const struct token *token, > const char *str, unsigned int len, void *= buf, > unsigned int size); static int > +parse_vc_modify_field_level(struct context *ctx, const struct token *tok= en, > + const char *str, unsigned int len, void *= buf, > + unsigned int size); static int > parse_vc_action_conntrack_update(struct context *ctx, const struct token > *token, > const char *str, unsigned int len, void *buf, > unsigned int size); @@ -5976,11 +5983,15 @@ stat= ic const > struct token token_list[] =3D { > .name =3D "dst_level", > .help =3D "destination field level", > .next =3D NEXT(action_modify_field_dst, > - NEXT_ENTRY(COMMON_UNSIGNED)), > - .args =3D ARGS(ARGS_ENTRY(struct rte_flow_action_modify_f= ield, > - dst.level)), > + > + NEXT_ENTRY(ACTION_MODIFY_FIELD_DST_LEVEL_VALUE)), > .call =3D parse_vc_conf, > }, > + [ACTION_MODIFY_FIELD_DST_LEVEL_VALUE] =3D { > + .name =3D "{dst_level}", > + .help =3D "destination field level value", > + .call =3D parse_vc_modify_field_level, > + .comp =3D comp_none, > + }, > [ACTION_MODIFY_FIELD_DST_OFFSET] =3D { > .name =3D "dst_offset", > .help =3D "destination field bit offset", @@ -6007,11 +60= 18,15 @@ > static const struct token token_list[] =3D { > .name =3D "src_level", > .help =3D "source field level", > .next =3D NEXT(action_modify_field_src, > - NEXT_ENTRY(COMMON_UNSIGNED)), > - .args =3D ARGS(ARGS_ENTRY(struct rte_flow_action_modify_f= ield, > - src.level)), > + > + NEXT_ENTRY(ACTION_MODIFY_FIELD_SRC_LEVEL_VALUE)), > .call =3D parse_vc_conf, > }, > + [ACTION_MODIFY_FIELD_SRC_LEVEL_VALUE] =3D { > + .name =3D "{src_level}", > + .help =3D "source field level value", > + .call =3D parse_vc_modify_field_level, > + .comp =3D comp_none, > + }, > [ACTION_MODIFY_FIELD_SRC_OFFSET] =3D { > .name =3D "src_offset", > .help =3D "source field bit offset", @@ -8477,6 +8492,66 = @@ > parse_vc_modify_field_id(struct context *ctx, const struct token *token, > return len; > } >=20 > +/** Parse level for modify_field command. */ static int > +parse_vc_modify_field_level(struct context *ctx, const struct token *tok= en, > + const char *str, unsigned int len, void *buf, > + unsigned int size) { > + struct rte_flow_action_modify_field *action; > + struct flex_item *fp; > + uint32_t val; > + struct buffer *out =3D buf; > + char *end; > + > + (void)token; > + (void)size; > + if (ctx->curr !=3D ACTION_MODIFY_FIELD_DST_LEVEL_VALUE && > + ctx->curr !=3D ACTION_MODIFY_FIELD_SRC_LEVEL_VALUE) > + return -1; > + if (!ctx->object) > + return len; > + action =3D ctx->object; > + errno =3D 0; > + val =3D strtoumax(str, &end, 0); > + if (errno || (size_t)(end - str) !=3D len) > + return -1; > + /* No need to validate action template mask value */ > + if (out->args.vc.masks) { > + if (ctx->curr =3D=3D ACTION_MODIFY_FIELD_DST_LEVEL_VALUE) > + action->dst.level =3D val; > + else > + action->src.level =3D val; > + return len; > + } > + if ((ctx->curr =3D=3D ACTION_MODIFY_FIELD_DST_LEVEL_VALUE && > + action->dst.field =3D=3D RTE_FLOW_FIELD_FLEX_ITEM) || > + (ctx->curr =3D=3D ACTION_MODIFY_FIELD_SRC_LEVEL_VALUE && > + action->src.field =3D=3D RTE_FLOW_FIELD_FLEX_ITEM)) { > + if (val >=3D FLEX_MAX_PARSERS_NUM) { > + printf("Bad flex item handle\n"); > + return -1; > + } > + fp =3D flex_items[ctx->port][val]; > + if (!fp) { > + printf("Bad flex item handle\n"); > + return -1; > + } > + } > + if (ctx->curr =3D=3D ACTION_MODIFY_FIELD_DST_LEVEL_VALUE) { > + if (action->dst.field !=3D RTE_FLOW_FIELD_FLEX_ITEM) > + action->dst.level =3D val; > + else > + action->dst.flex_handle =3D fp->flex_handle; > + } else if (ctx->curr =3D=3D ACTION_MODIFY_FIELD_SRC_LEVEL_VALUE) = { > + if (action->src.field !=3D RTE_FLOW_FIELD_FLEX_ITEM) > + action->src.level =3D val; > + else > + action->src.flex_handle =3D fp->flex_handle; > + } > + return len; > +} > + > /** Parse the conntrack update, not a rte_flow_action. */ static int > parse_vc_action_conntrack_update(struct context *ctx, const struct token > *token, diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index 3e6242803d..9ffd7baa7a 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -2905,6 +2905,9 @@ encapsulation level, from outermost to innermost > (lower to higher values). > For the tag array (in case of multiple tags are supported and present) > ``level`` translates directly into the array index. >=20 > +``flex_handle`` is used to specify the flex item pointer which is being > +modified. ``flex_handle`` and ``level`` are mutually exclusive. > + > ``offset`` specifies the number of bits to skip from a field's start. > That allows performing a partial copy of the needed part or to divide a = big > packet field into multiple smaller fields. Alternatively, ``offset`` allo= ws @@ - > 2952,23 +2955,27 @@ value as sequence of bytes {xxx, xxx, 0x85, xxx, xxx, > xxx}. >=20 > .. table:: destination/source field definition >=20 > - +---------------+----------------------------------------------------= ------+ > - | 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=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > - | ``field`` | ID: packet field, mark, meta, tag, immediate, point= er | > - +---------------+----------------------------------------------------= ------+ > - | ``level`` | encapsulation level of a packet field or tag array = index | > - +---------------+----------------------------------------------------= ------+ > - | ``offset`` | number of bits to skip at the beginning = | > - +---------------+----------------------------------------------------= ------+ > - | ``value`` | immediate value buffer (source field only, not = | > - | | applicable to destination) for RTE_FLOW_FIELD_VALUE= | > - | | field type = | > - +---------------+----------------------------------------------------= ------+ > - | ``pvalue`` | pointer to immediate value data (source field only,= not | > - | | applicable to destination) for RTE_FLOW_FIELD_POINT= ER | > - | | field type = | > - +---------------+----------------------------------------------------= ------+ > + +-----------------+--------------------------------------------------= --------+ > + | 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=3D=3D=3D=3D=3D > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > + | ``field`` | ID: packet field, mark, meta, tag, immediate, poi= nter | > + +-----------------+--------------------------------------------------= --------+ > + | ``level`` | encapsulation level of a packet field or tag arra= y index | > + +-----------------+--------------------------------------------------= --------+ > + | ``flex_handle`` | flex item handle of a packet field = | > + +-----------------+--------------------------------------------------= --------+ > + | ``offset`` | number of bits to skip at the beginning = | > + +-----------------+--------------------------------------------------= --------+ > + | ``value`` | immediate value buffer (source field only, not = | > + | | applicable to destination) for RTE_FLOW_FIELD_VAL= UE | > + | | field type = | > + | | This field is only 16 bytes, maybe not big enough= for | > + | | all NICs' flex item = | > + +-----------------+--------------------------------------------------= --------+ > + | ``pvalue`` | pointer to immediate value data (source field onl= y, not | > + | | applicable to destination) for RTE_FLOW_FIELD_POI= NTER | > + | | field type = | > + > + +-----------------+--------------------------------------------------- > + -------+ >=20 > Action: ``CONNTRACK`` > ^^^^^^^^^^^^^^^^^^^^^ > diff --git a/doc/guides/rel_notes/release_23_03.rst > b/doc/guides/rel_notes/release_23_03.rst > index c15f6fbb9f..3fb6e738e2 100644 > --- a/doc/guides/rel_notes/release_23_03.rst > +++ b/doc/guides/rel_notes/release_23_03.rst > @@ -69,6 +69,10 @@ New Features > ``rte_event_dev_config::nb_single_link_event_port_queues`` parameter > required for eth_rx, eth_tx, crypto and timer eventdev adapters. >=20 > +* ethdev: added a new field: > + > + - modify flex item: ``rte_flow_action_modify_data.flex_handle``. > + >=20 > Removed Items > ------------- > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index > b60987db4b..ba9f3d50a3 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -3528,6 +3528,7 @@ enum rte_flow_field_id { > RTE_FLOW_FIELD_IPV6_ECN, /**< IPv6 ECN. */ > RTE_FLOW_FIELD_GTP_PSC_QFI, /**< GTP QFI. */ > RTE_FLOW_FIELD_METER_COLOR, /**< Meter color marker. */ > + RTE_FLOW_FIELD_FLEX_ITEM, /**< Flex item. */ > }; >=20 > /** > @@ -3541,8 +3542,11 @@ struct rte_flow_action_modify_data { > RTE_STD_C11 > union { > struct { > - /** Encapsulation level or tag index. */ > - uint32_t level; > + /** Encapsulation level or tag index or flex item= handle. */ > + union { > + uint32_t level; > + struct rte_flow_item_flex_handle *flex_ha= ndle; > + }; > /** Number of bits to skip from a field. */ > uint32_t offset; > }; > -- > 2.27.0