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 0FD3742B76; Mon, 22 May 2023 21:28:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E56F42D3D; Mon, 22 May 2023 21:28:33 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2086.outbound.protection.outlook.com [40.107.237.86]) by mails.dpdk.org (Postfix) with ESMTP id B709942D49 for ; Mon, 22 May 2023 21:28:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LRRwos0dDhUBvox5qorps55AqLGKBV/2sujLTIACYwV20oebwbBkWMVwWxB7usgf12m12TgxMmg0Gu/zMm+T5vljn9GpKqoCXc+n2tfK5PbdxeAOH10NzxlqySok4OGcWeOoVcInwEsrDpjpp2qob59BBD9g/qoXMhfDY9Y4g97POC31XqjLvHKAGgCedHQxvQ4mMGuL3mgfwYkko74vI87btnJM43vLCnojMK7LTBfqHa4ldpOhWBXqvUV1JT08n9ArhmV874pO9iVUPtOdyuKfa/NDixUGcgnd+5pkrZFj+V4e0JOmmKT6hzwHQS5pfIBGSEH11MHA7N5Iek4xvQ== 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=LWS9IO7WHisZss7AIB/mr8T8g6Rq4kRuMOyZRa+cgng=; b=d8wm4nn9dEglvew9fe7NGNm2cIRVVtJTM9WZTsXkAfB6ToyXKNmyEfajDTyJZRAY+2qIX3eA5SynS3I9tRLFNswfib3q7OjicyhLFJj26f2KEYZ22f8+CYQPFoK2OzKi7hj3JhfHyeTVjMvGyNWb4A0ZIVdFfGLEaWG4nlc3ag2YxJgnuzua2tUE6aHCOH168yb547qb/i2nGr+DbsMj0SvL+8odcJNrLIycscSQb1zD2Gs+NXUsj82E9jCbJKgYLW8D7JGQr9l1CvsbetEmpOMKBBQS2frRGuJD9e2QsKF6Nf+GuotkZI/h+AFYx9XrPKHj28uEX8Ztd0EMhaECaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=LWS9IO7WHisZss7AIB/mr8T8g6Rq4kRuMOyZRa+cgng=; b=r976sf1UJmy4Vwsqxxo+b6U1tz2JydYorQyQbAUZF9E5aLnffbVQPyoo91x1rg46eNra/hT+yWCWPHJlkHhphv7ulaNLTUFaIxWDUYR9fiZ2uSoVOqKFqkOJobLtofTD5E0cQ1s0RRk/KUHxkKlitwJmo0MO5v17gZOu4sPn26DcJHrBWVjYvM040ERrZDwRA+/JEz/1+oHTt9oftW37Qe8pNOTw52QUb7NuJ5f1D6Rc/3mICESO6Jj0FOue7JaVacNWww4pvBCVmM/A2ZwFF9HadaqpVC/1cUTky8ohlCWaRdLncJsreiorsHgAxkXU+m7SMmji//ez0sOeYH3uiA== Received: from DM6PR07CA0083.namprd07.prod.outlook.com (2603:10b6:5:337::16) by MW4PR12MB5626.namprd12.prod.outlook.com (2603:10b6:303:169::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 19:28:29 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:5:337:cafe::c5) by DM6PR07CA0083.outlook.office365.com (2603:10b6:5:337::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 19:28:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 19:28:29 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Mon, 22 May 2023 12:28:20 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Mon, 22 May 2023 12:28:19 -0700 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Mon, 22 May 2023 12:28:18 -0700 From: Michael Baum To: CC: Ori Kam , Aman Singh , "Yuying Zhang" , Ferruh Yigit , "Thomas Monjalon" Subject: [PATCH v3 4/5] ethdev: add GENEVE TLV option modification support Date: Mon, 22 May 2023 22:28:03 +0300 Message-ID: <20230522192804.3759072-5-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230522192804.3759072-1-michaelba@nvidia.com> References: <20230518174015.3373185-1-michaelba@nvidia.com> <20230522192804.3759072-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT010:EE_|MW4PR12MB5626:EE_ X-MS-Office365-Filtering-Correlation-Id: a4996020-05eb-4df9-a9e1-08db5afab8ec 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: iw7ZFfqNVH8qLSj9xwwzVdj6IVQANcGShLCBBqlRW39iS3zAHLAWv/di+bPvrb17ehtY+cQ+kq9t3s893t4t4/4XIBEPiKOt9+13gDosVMrZM8vsgd34cUtxjpTGyBSBnYMA+NmomATsrB2LW0zuB7rQiukAuZlWCQbMTKeG2PgjnRI1YrBR47lrWYybYNkRw4hUOXe/NZO5tkBTpWC1rSbF2pR95tgo07hKUd5/l3uhwuJnCaQeOJlUYDM+bDXSMO6G7H1cZ9mZUF6QIRjpf4cUS3pCPCpAJzFKA5qYzipI+vp7wRf8x7Vc1bDAnQxq5amkUZlg1qJIfRf6uwBZvN0vIKtsccVIzoA7ss0deHPuYxMjs1AidsUIaL1+D3mucnSMFye7ChWgdJD18cpp+uon8gqOC+AOW/QkwaBkPI5P382teOkIawi6/HXX/WnLfDzRGMZhhlIcbbDjldoIUUOwurVV7+E4kKZ2FMX/rTuqd/o+SiVlDZNKjImeArvfqudz4/xlglsObTtm1E42YyZiB6g2RBsCGWWasxLEWsgDNHutyzPBm4juxRFFKd+oPGv1HV08ZoxZk5YGsneM7q1CkSIZuMOIqGi0FwF5nQduxGPyqTLmqgKHzv9KOkxGZC9OMYDtbRPj5d026y3lDOA8rIB4LmApyAJbZmykUZkEUyul6sS7z+W41h1ZfyHRcatkehXOu7buF+kAvf2nBOSR64OWBl0mpo8qBZqg2QZRK2kuv7KuPqzec32LIwF4NtbjqYGPFIsi2SJI8/22dg== X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199021)(40470700004)(36840700001)(46966006)(7636003)(356005)(8936002)(8676002)(82740400003)(40460700003)(5660300002)(47076005)(40480700001)(55016003)(26005)(1076003)(186003)(2906002)(6286002)(30864003)(2616005)(36756003)(336012)(426003)(83380400001)(82310400005)(36860700001)(86362001)(54906003)(316002)(6666004)(6916009)(4326008)(478600001)(70206006)(70586007)(41300700001)(7696005)(21314003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 19:28:29.2648 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4996020-05eb-4df9-a9e1-08db5afab8ec X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5626 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 Add modify field support for GENEVE option fields: - "RTE_FLOW_FIELD_GENEVE_OPT_TYPE" - "RTE_FLOW_FIELD_GENEVE_OPT_CLASS" - "RTE_FLOW_FIELD_GENEVE_OPT_DATA" Each GENEVE TLV option is identified by both its "class" and "type", so 2 new fields were added to "rte_flow_action_modify_data" structure to help specify which option to modify. To get room for those 2 new fields, the "level" field move to use "uint8_t" which is more than enough for encapsulation level. This patch also reduces all modify field encapsulation level "fully masked" initializations to use UINT8_MAX instead of UINT32_MAX. This change avoids compilation warning caused by this API changing. Signed-off-by: Michael Baum --- app/test-pmd/cmdline_flow.c | 48 +++++++++++++++++++++++++- doc/guides/prog_guide/rte_flow.rst | 23 ++++++++++++ doc/guides/rel_notes/release_23_07.rst | 3 ++ drivers/net/mlx5/mlx5_flow_hw.c | 22 ++++++------ lib/ethdev/rte_flow.h | 48 +++++++++++++++++++++++++- 5 files changed, 131 insertions(+), 13 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 58939ec321..8c1dea53c0 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -636,11 +636,15 @@ enum index { ACTION_MODIFY_FIELD_DST_TYPE_VALUE, ACTION_MODIFY_FIELD_DST_LEVEL, ACTION_MODIFY_FIELD_DST_LEVEL_VALUE, + ACTION_MODIFY_FIELD_DST_TYPE_ID, + ACTION_MODIFY_FIELD_DST_CLASS_ID, 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_TYPE_ID, + ACTION_MODIFY_FIELD_SRC_CLASS_ID, ACTION_MODIFY_FIELD_SRC_OFFSET, ACTION_MODIFY_FIELD_SRC_VALUE, ACTION_MODIFY_FIELD_SRC_POINTER, @@ -854,7 +858,9 @@ static const char *const modify_field_ids[] = { "ipv4_ecn", "ipv6_ecn", "gtp_psc_qfi", "meter_color", "ipv6_proto", "flex_item", - "hash_result", NULL + "hash_result", + "geneve_opt_type", "geneve_opt_class", "geneve_opt_data", + NULL }; static const char *const meter_colors[] = { @@ -2295,6 +2301,8 @@ static const enum index next_action_sample[] = { static const enum index action_modify_field_dst[] = { ACTION_MODIFY_FIELD_DST_LEVEL, + ACTION_MODIFY_FIELD_DST_TYPE_ID, + ACTION_MODIFY_FIELD_DST_CLASS_ID, ACTION_MODIFY_FIELD_DST_OFFSET, ACTION_MODIFY_FIELD_SRC_TYPE, ZERO, @@ -2302,6 +2310,8 @@ static const enum index action_modify_field_dst[] = { static const enum index action_modify_field_src[] = { ACTION_MODIFY_FIELD_SRC_LEVEL, + ACTION_MODIFY_FIELD_SRC_TYPE_ID, + ACTION_MODIFY_FIELD_SRC_CLASS_ID, ACTION_MODIFY_FIELD_SRC_OFFSET, ACTION_MODIFY_FIELD_SRC_VALUE, ACTION_MODIFY_FIELD_SRC_POINTER, @@ -6388,6 +6398,24 @@ static const struct token token_list[] = { .call = parse_vc_modify_field_level, .comp = comp_none, }, + [ACTION_MODIFY_FIELD_DST_TYPE_ID] = { + .name = "dst_type_id", + .help = "destination field type ID", + .next = NEXT(action_modify_field_dst, + NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY(struct rte_flow_action_modify_field, + dst.type)), + .call = parse_vc_conf, + }, + [ACTION_MODIFY_FIELD_DST_CLASS_ID] = { + .name = "dst_class", + .help = "destination field class ID", + .next = NEXT(action_modify_field_dst, + NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_action_modify_field, + dst.class_id)), + .call = parse_vc_conf, + }, [ACTION_MODIFY_FIELD_DST_OFFSET] = { .name = "dst_offset", .help = "destination field bit offset", @@ -6423,6 +6451,24 @@ static const struct token token_list[] = { .call = parse_vc_modify_field_level, .comp = comp_none, }, + [ACTION_MODIFY_FIELD_SRC_TYPE_ID] = { + .name = "src_type_id", + .help = "source field type ID", + .next = NEXT(action_modify_field_src, + NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY(struct rte_flow_action_modify_field, + src.type)), + .call = parse_vc_conf, + }, + [ACTION_MODIFY_FIELD_SRC_CLASS_ID] = { + .name = "src_class", + .help = "source field class ID", + .next = NEXT(action_modify_field_src, + NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_action_modify_field, + src.class_id)), + .call = parse_vc_conf, + }, [ACTION_MODIFY_FIELD_SRC_OFFSET] = { .name = "src_offset", .help = "source field bit offset", diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 25b57bf86d..ec812de335 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2937,6 +2937,14 @@ as well as any tag element in the tag array: For the tag array (in case of multiple tags are supported and present) ``level`` translates directly into the array index. +``type`` is used to specify (along with ``class_id``) the Geneve option which +is being modified. +This field is relevant only for ``RTE_FLOW_FIELD_GENEVE_OPT_XXXX`` type. + +``class_id`` is used to specify (along with ``type``) the Geneve option which +is being modified. +This field is relevant only for ``RTE_FLOW_FIELD_GENEVE_OPT_XXXX`` type. + ``flex_handle`` is used to specify the flex item pointer which is being modified. ``flex_handle`` and ``level`` are mutually exclusive. @@ -2967,6 +2975,17 @@ to replace the third byte of MAC address with value 0x85, application should specify destination width as 8, destination offset as 16, and provide immediate value as sequence of bytes {xxx, xxx, 0x85, xxx, xxx, xxx}. +The ``RTE_FLOW_FIELD_GENEVE_OPT_DATA`` type supports modifying only one DW in +single action and align to 32 bits. For example, for modifying 16 bits start +from offset 24, 2 different actions should be prepared. The first one includs +``offset=24`` and ``width=8``, and the seconde one includs ``offset=32`` and +``width=8``. +Application should provide the data in immediate value memory only for the +single DW even though the offset is related to start of first DW. For example, +to replace the third byte of second DW in Geneve option data with value 0x85, +application should specify destination width as 8, destination offset as 48, +and provide immediate value 0xXXXX85XX. + .. _table_rte_flow_action_modify_field: .. table:: MODIFY_FIELD @@ -2994,6 +3013,10 @@ value as sequence of bytes {xxx, xxx, 0x85, xxx, xxx, xxx}. +-----------------+----------------------------------------------------------+ | ``level`` | encapsulation level of a packet field or tag array index | +-----------------+----------------------------------------------------------+ + | ``type`` | geneve option type | + +-----------------+----------------------------------------------------------+ + | ``class_id`` | geneve option class ID | + +-----------------+----------------------------------------------------------+ | ``flex_handle`` | flex item handle of a packet field | +-----------------+----------------------------------------------------------+ | ``offset`` | number of bits to skip at the beginning | diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst index a9b1293689..ce1755096f 100644 --- a/doc/guides/rel_notes/release_23_07.rst +++ b/doc/guides/rel_notes/release_23_07.rst @@ -84,6 +84,9 @@ API Changes Also, make sure to start the actual text at the margin. ======================================================= +* The ``level`` field in experimental structure + ``struct rte_flow_action_modify_data`` was reduced to 8 bits. + ABI Changes ----------- diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 7e0ee8d883..1b68a19900 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -3565,7 +3565,7 @@ flow_hw_validate_action_modify_field(const struct rte_flow_action *action, return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, "immediate value, pointer and hash result cannot be used as destination"); - if (mask_conf->dst.level != UINT32_MAX) + if (mask_conf->dst.level != UINT8_MAX) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, "destination encapsulation level must be fully masked"); @@ -3579,7 +3579,7 @@ flow_hw_validate_action_modify_field(const struct rte_flow_action *action, "destination field mask and template are not equal"); if (action_conf->src.field != RTE_FLOW_FIELD_POINTER && action_conf->src.field != RTE_FLOW_FIELD_VALUE) { - if (mask_conf->src.level != UINT32_MAX) + if (mask_conf->src.level != UINT8_MAX) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, "source encapsulation level must be fully masked"); @@ -4450,7 +4450,7 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, .operation = RTE_FLOW_MODIFY_SET, .dst = { .field = RTE_FLOW_FIELD_VLAN_ID, - .level = 0xffffffff, .offset = 0xffffffff, + .level = 0xff, .offset = 0xffffffff, }, .src = { .field = RTE_FLOW_FIELD_VALUE, @@ -4583,12 +4583,12 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev, .operation = RTE_FLOW_MODIFY_SET, .dst = { .field = (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG, - .level = UINT32_MAX, + .level = UINT8_MAX, .offset = UINT32_MAX, }, .src = { .field = (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG, - .level = UINT32_MAX, + .level = UINT8_MAX, .offset = UINT32_MAX, }, .width = UINT32_MAX, @@ -5653,7 +5653,7 @@ flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev) .operation = RTE_FLOW_MODIFY_SET, .dst = { .field = (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG, - .level = UINT32_MAX, + .level = UINT8_MAX, .offset = UINT32_MAX, }, .src = { @@ -5677,12 +5677,12 @@ flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev) .operation = RTE_FLOW_MODIFY_SET, .dst = { .field = (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG, - .level = UINT32_MAX, + .level = UINT8_MAX, .offset = UINT32_MAX, }, .src = { .field = (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG, - .level = UINT32_MAX, + .level = UINT8_MAX, .offset = UINT32_MAX, }, .width = UINT32_MAX, @@ -6009,7 +6009,7 @@ flow_hw_create_ctrl_regc_jump_actions_template(struct rte_eth_dev *dev) .operation = RTE_FLOW_MODIFY_SET, .dst = { .field = (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG, - .level = UINT32_MAX, + .level = UINT8_MAX, .offset = UINT32_MAX, }, .src = { @@ -6182,12 +6182,12 @@ flow_hw_create_tx_default_mreg_copy_actions_template(struct rte_eth_dev *dev) .operation = RTE_FLOW_MODIFY_SET, .dst = { .field = (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG, - .level = UINT32_MAX, + .level = UINT8_MAX, .offset = UINT32_MAX, }, .src = { .field = (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG, - .level = UINT32_MAX, + .level = UINT8_MAX, .offset = UINT32_MAX, }, .width = UINT32_MAX, diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 713ba8b65c..f30d4b033f 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -3773,6 +3773,9 @@ enum rte_flow_field_id { RTE_FLOW_FIELD_IPV6_PROTO, /**< IPv6 next header. */ RTE_FLOW_FIELD_FLEX_ITEM, /**< Flex item. */ RTE_FLOW_FIELD_HASH_RESULT, /**< Hash result. */ + RTE_FLOW_FIELD_GENEVE_OPT_TYPE, /**< GENEVE option type */ + RTE_FLOW_FIELD_GENEVE_OPT_CLASS,/**< GENEVE option class */ + RTE_FLOW_FIELD_GENEVE_OPT_DATA /**< GENEVE option data */ }; /** @@ -3788,7 +3791,50 @@ struct rte_flow_action_modify_data { struct { /** Encapsulation level or tag index or flex item handle. */ union { - uint32_t level; + struct { + /** + * Packet encapsulation level containing + * the field modify to. + * + * - @p 0 requests the default behavior. + * Depending on the packet type, it + * can mean outermost, innermost or + * anything in between. + * + * It basically stands for the + * innermost encapsulation level + * modification can be performed on + * according to PMD and device + * capabilities. + * + * - @p 1 requests modification to be + * performed on the outermost packet + * encapsulation level. + * + * - @p 2 and subsequent values request + * modification to be performed on + * the specified inner packet + * encapsulation level, from + * outermost to innermost (lower to + * higher values). + * + * Values other than @p 0 are not + * necessarily supported. + */ + uint8_t level; + /** + * Geneve option type. relevant only + * for RTE_FLOW_FIELD_GENEVE_OPT_XXXX + * modification type. + */ + uint8_t type; + /** + * Geneve option class. relevant only + * for RTE_FLOW_FIELD_GENEVE_OPT_XXXX + * modification type. + */ + rte_be16_t class_id; + }; struct rte_flow_item_flex_handle *flex_handle; }; /** Number of bits to skip from a field. */ -- 2.25.1