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 30D3043A39; Thu, 1 Feb 2024 13:30:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FE9B42E03; Thu, 1 Feb 2024 13:30:12 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2066.outbound.protection.outlook.com [40.107.96.66]) by mails.dpdk.org (Postfix) with ESMTP id 64EB64021D for ; Thu, 1 Feb 2024 13:30:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YcBO5nkq7HQbQ+0mvZJtF20yBo07ZeGwdzmFN3eCA1J0ao/CxXOWw0tAUyMIowpbIQ1AvTo5lU+rxXRnlIjKZ6fM+E8muVtziAgssznxVScW6nHs0rzukbH76mmlXS6ShyhVxgKPlc87pn32QPsO3iXSFbjnn6zBdRkw9Tm9NwtAr3Lz1pxDRuYgB3CNPRnOqXADiBdwiFepS2MxQsMIxFRG/okRrulKKzIob22AaRq3OjSPn72YnkGtTSrVMD17DdLUw9Edm0s63NSMnvh7McYVzXGo4UQU8FrbQYtPC5GSlaXPXQvu5GaeIR2JzMJzdczZ3/R2/DEHkEMaGpBFDQ== 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=OBXshfYT7pz8TB3gOJYd638ZlF2F99xWD+RinIjjIus=; b=Q2QjYwqxY/QA8jlwVzrF6pJ67emokxxRiejdhgbYoVghp3lmIgJaSmVotIyNV5wctkJFn0ltcrVUHtUUU2Pyj+H1/TBgbs4xdatFpSOFLTHh6CDHH8gMIq3qwlBNjt42izEfQEUPnTXe5IlNG2UcXiUZHJMyaCtyBEgRNcXQxxUGtxKFL5Ht+AsoYYNPTwT7XwjLYqi9ChPKtMevNf+mcEln5YMPjCQYGPCrmastSORpRYkAFITgAJ4BamSXi5klFlEKheXfQVfaa22tdlWoiwAgmgnD20QWp/5yhvGhsN087q7StyJlhcdhn/VnXWh8705OzfzDaBZTAt72Tjc/IQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=amd.com 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 (0) 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=OBXshfYT7pz8TB3gOJYd638ZlF2F99xWD+RinIjjIus=; b=sHn3kJvV1vrat0cEhLujTooInrSkcRyHxma8XMCX+jXMhhd5dWzD39ZxoVKilzjCRqZmVRm5kih5UVZS0lPt8UIAOPgw5pALekc2zTD+YAXk06VVlw7NTTao9g758CualM50OC4S+JlqCFRLRQDqM4RKZMLttM1dneSFtn1CsBJYqnQQlYenOuApPibE94QGNWuIVXD7vhDqdLi1seYpQKvNuJzKHRKN4Ps7mzXTKpKIbLVVU3jbl4BVo5Bo9APTTnozAlu170m4KczPI5aiOZOToCe8wdW1mzZvXmE7VtvVhlaixmdeSWdYCZYxiI9XPWzmLYF5wIXdOC6OhbiAFA== Received: from CH2PR07CA0065.namprd07.prod.outlook.com (2603:10b6:610:5b::39) by PH7PR12MB5686.namprd12.prod.outlook.com (2603:10b6:510:13d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Thu, 1 Feb 2024 12:30:07 +0000 Received: from CH2PEPF0000009A.namprd02.prod.outlook.com (2603:10b6:610:5b:cafe::63) by CH2PR07CA0065.outlook.office365.com (2603:10b6:610:5b::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23 via Frontend Transport; Thu, 1 Feb 2024 12:30:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CH2PEPF0000009A.mail.protection.outlook.com (10.167.244.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.19 via Frontend Transport; Thu, 1 Feb 2024 12:30:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 1 Feb 2024 04:29:55 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 1 Feb 2024 04:29:48 -0800 From: Suanming Mou To: , Ori Kam , Aman Singh , Yuying Zhang , "Dariusz Sosnowski" , Viacheslav Ovsiienko , Matan Azrad , Thomas Monjalon , Andrew Rybchenko CC: Subject: [PATCH v5 1/3] ethdev: rename action modify field data structure Date: Thu, 1 Feb 2024 20:29:20 +0800 Message-ID: <20240201122922.474250-2-suanmingm@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240201122922.474250-1-suanmingm@nvidia.com> References: <20231214031227.363911-1-suanmingm@nvidia.com> <20240201122922.474250-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000009A:EE_|PH7PR12MB5686:EE_ X-MS-Office365-Filtering-Correlation-Id: 94888964-ce91-4157-033c-08dc232185e4 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: F74QGSKTTc3EFJw58YB3xXgs0PX2smgoZ7bMJuWJ8Z23qM28uJqTalV5S+Y6YghRZj3H5UZSPrQpu+vPu++hhbMeN+EhYFNhU4bkoeAH0oDrlgceztAf516sktxCHza9c13m7d2oSPE792XA1NbGtjHw6JwhDHbWnbuGtEyiijkhz/tykw1oAHRlQXsdq6neaNQ9xSYuwfpIikWp8zMrtnUhhwJdXVPhAMxvuTJ2WiJ7hiTZZmy588CjSQQongaeBvRlYdr6ilPAVIuSz0ZYj0JdUnqmigsrOiybvH406/W05hajAXVnHmLhXf7ceauHvzVSKgrCYFd1f0zt9vPP26OJmZplu/GF6NZtEwXOu0hV2xNI65JlI+tTqqegx9M3CM7+IrKrJCFEOIE3ts/ySDPh31apiNFDNmHdZxKddr8JlwAb6limrG1LnXIiBzRAq74KrDIJD/2o0piluBHVLe8MCDjYp6TsJGb3iuTp8XG+nnRfhoRZSpX+pyNhi3/+NDwCMvguEej2FKhrH4ele+un5wBktPY6IXnVv9GuGXVWB1LbcMmVLF4+FDKnNHw/pdvZtdF8D9RyIdfSP85Jrh5NJY0gTiRdPnLAWe+r9rS4mRm6oN8Df+Y/IMV4UNdUshEjGUGjhjx2M3RgjCaU+GL6SowuIKlFXR8LKtAW5j1Hf/Y9mDkwj1DFAE3+vjbZthmLiaU/+94TJLqNoveF7pUUwxzd3AdZZ28bQeWiDq0Nk23P8z3tjU8eqM2ZU+7jm0eL+NEb6SILplySbRxh71cQF+XqclvDb4dAFsbnZWg= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(346002)(376002)(39860400002)(136003)(396003)(230922051799003)(230173577357003)(230273577357003)(451199024)(1800799012)(186009)(82310400011)(64100799003)(40470700004)(46966006)(36840700001)(426003)(26005)(16526019)(6286002)(336012)(2616005)(1076003)(83380400001)(478600001)(7696005)(41300700001)(6666004)(36756003)(8676002)(8936002)(4326008)(356005)(316002)(55016003)(36860700001)(40480700001)(40460700003)(2906002)(7636003)(5660300002)(70206006)(82740400003)(70586007)(47076005)(110136005)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 12:30:06.5410 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 94888964-ce91-4157-033c-08dc232185e4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000009A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5686 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 Current rte_flow_action_modify_data struct describes the pkt field perfectly and is used only in action. It is planned to be used for item as well. This commit renames it to "rte_flow_field_data" making it compatible to be used by item. Signed-off-by: Suanming Mou Acked-by: Ori Kam Acked-by: Andrew Rybchenko --- app/test-pmd/cmdline_flow.c | 22 +++++++++++----------- doc/guides/prog_guide/rte_flow.rst | 2 +- doc/guides/rel_notes/release_24_03.rst | 1 + drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow.h | 6 +++--- drivers/net/mlx5/mlx5_flow_dv.c | 10 +++++----- lib/ethdev/rte_flow.h | 12 ++++++++---- 7 files changed, 31 insertions(+), 26 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 359c187b3c..972c6ae490 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -742,13 +742,13 @@ enum index { #define ITEM_RAW_SIZE \ (sizeof(struct rte_flow_item_raw) + ITEM_RAW_PATTERN_SIZE) -/** Maximum size for external pattern in struct rte_flow_action_modify_data. */ -#define ACTION_MODIFY_PATTERN_SIZE 32 +/** Maximum size for external pattern in struct rte_flow_field_data. */ +#define FLOW_FIELD_PATTERN_SIZE 32 /** Storage size for struct rte_flow_action_modify_field including pattern. */ #define ACTION_MODIFY_SIZE \ (sizeof(struct rte_flow_action_modify_field) + \ - ACTION_MODIFY_PATTERN_SIZE) + FLOW_FIELD_PATTERN_SIZE) /** Maximum number of queue indices in struct rte_flow_action_rss. */ #define ACTION_RSS_QUEUE_NUM 128 @@ -942,7 +942,7 @@ static const char *const modify_field_ops[] = { "set", "add", "sub", NULL }; -static const char *const modify_field_ids[] = { +static const char *const flow_field_ids[] = { "start", "mac_dst", "mac_src", "vlan_type", "vlan_id", "mac_type", "ipv4_dscp", "ipv4_ttl", "ipv4_src", "ipv4_dst", @@ -6986,7 +6986,7 @@ static const struct token token_list[] = { ARGS_ENTRY_ARB(0, 0), ARGS_ENTRY_ARB (sizeof(struct rte_flow_action_modify_field), - ACTION_MODIFY_PATTERN_SIZE)), + FLOW_FIELD_PATTERN_SIZE)), .call = parse_vc_conf, }, [ACTION_MODIFY_FIELD_WIDTH] = { @@ -9798,10 +9798,10 @@ parse_vc_modify_field_id(struct context *ctx, const struct token *token, if (ctx->curr != ACTION_MODIFY_FIELD_DST_TYPE_VALUE && ctx->curr != ACTION_MODIFY_FIELD_SRC_TYPE_VALUE) return -1; - for (i = 0; modify_field_ids[i]; ++i) - if (!strcmp_partial(modify_field_ids[i], str, len)) + for (i = 0; flow_field_ids[i]; ++i) + if (!strcmp_partial(flow_field_ids[i], str, len)) break; - if (!modify_field_ids[i]) + if (!flow_field_ids[i]) return -1; if (!ctx->object) return len; @@ -12028,10 +12028,10 @@ comp_set_modify_field_id(struct context *ctx, const struct token *token, RTE_SET_USED(token); if (!buf) - return RTE_DIM(modify_field_ids); - if (ent >= RTE_DIM(modify_field_ids) - 1) + return RTE_DIM(flow_field_ids); + if (ent >= RTE_DIM(flow_field_ids) - 1) return -1; - name = modify_field_ids[ent]; + name = flow_field_ids[ent]; if (ctx->curr == ACTION_MODIFY_FIELD_SRC_TYPE || (strcmp(name, "pointer") && strcmp(name, "value"))) return strlcpy(buf, name, size); diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 900fdaefb6..f936a9ba19 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -3185,7 +3185,7 @@ destination offset as ``48``, and provide immediate value ``0xXXXX85XX``. | ``width`` | number of bits to use | +---------------+-------------------------+ -.. _table_rte_flow_action_modify_data: +.. _table_rte_flow_field_data: .. table:: destination/source field definition diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst index 84d3144215..efeda6ea97 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -124,6 +124,7 @@ ABI Changes * No ABI change that would break compatibility with 23.11. +* ethdev: Rename the experimental ``struct rte_flow_action_modify_data`` to be ``struct rte_flow_field_data`` Known Issues ------------ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 85e8c77c81..5788a7fb57 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2493,7 +2493,7 @@ mlx5_validate_action_ct(struct rte_eth_dev *dev, * Validate the level value for modify field action. * * @param[in] data - * Pointer to the rte_flow_action_modify_data structure either src or dst. + * Pointer to the rte_flow_field_data structure either src or dst. * @param[out] error * Pointer to error structure. * @@ -2501,7 +2501,7 @@ mlx5_validate_action_ct(struct rte_eth_dev *dev, * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -flow_validate_modify_field_level(const struct rte_flow_action_modify_data *data, +flow_validate_modify_field_level(const struct rte_flow_field_data *data, struct rte_flow_error *error) { if (data->level == 0) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 6dde9de688..ecfb04ead2 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1121,7 +1121,7 @@ flow_items_to_tunnel(const struct rte_flow_item items[]) * Tag array index. */ static inline uint8_t -flow_tag_index_get(const struct rte_flow_action_modify_data *data) +flow_tag_index_get(const struct rte_flow_field_data *data) { return data->tag_index ? data->tag_index : data->level; } @@ -2523,7 +2523,7 @@ int mlx5_flow_validate_action_default_miss(uint64_t action_flags, const struct rte_flow_attr *attr, struct rte_flow_error *error); int flow_validate_modify_field_level - (const struct rte_flow_action_modify_data *data, + (const struct rte_flow_field_data *data, struct rte_flow_error *error); int mlx5_flow_item_acceptable(const struct rte_flow_item *item, const uint8_t *mask, @@ -2828,7 +2828,7 @@ size_t flow_dv_get_item_hdr_len(const enum rte_flow_item_type item_type); int flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, size_t *size, struct rte_flow_error *error); void mlx5_flow_field_id_to_modify_info - (const struct rte_flow_action_modify_data *data, + (const struct rte_flow_field_data *data, struct field_modify_info *info, uint32_t *mask, uint32_t width, struct rte_eth_dev *dev, const struct rte_flow_attr *attr, struct rte_flow_error *error); diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 115d730317..52620be262 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1441,7 +1441,7 @@ flow_modify_info_mask_32_masked(uint32_t length, uint32_t off, uint32_t post_mas } static __rte_always_inline enum mlx5_modification_field -mlx5_mpls_modi_field_get(const struct rte_flow_action_modify_data *data) +mlx5_mpls_modi_field_get(const struct rte_flow_field_data *data) { return MLX5_MODI_IN_MPLS_LABEL_0 + data->tag_index; } @@ -1449,7 +1449,7 @@ mlx5_mpls_modi_field_get(const struct rte_flow_action_modify_data *data) static void mlx5_modify_flex_item(const struct rte_eth_dev *dev, const struct mlx5_flex_item *flex, - const struct rte_flow_action_modify_data *data, + const struct rte_flow_field_data *data, struct field_modify_info *info, uint32_t *mask, uint32_t width) { @@ -1573,7 +1573,7 @@ mlx5_modify_flex_item(const struct rte_eth_dev *dev, void mlx5_flow_field_id_to_modify_info - (const struct rte_flow_action_modify_data *data, + (const struct rte_flow_field_data *data, struct field_modify_info *info, uint32_t *mask, uint32_t width, struct rte_eth_dev *dev, const struct rte_flow_attr *attr, struct rte_flow_error *error) @@ -5284,8 +5284,8 @@ flow_dv_validate_action_modify_field(struct rte_eth_dev *dev, struct mlx5_sh_config *config = &priv->sh->config; struct mlx5_hca_attr *hca_attr = &priv->sh->cdev->config.hca_attr; const struct rte_flow_action_modify_field *conf = action->conf; - const struct rte_flow_action_modify_data *src_data = &conf->src; - const struct rte_flow_action_modify_data *dst_data = &conf->dst; + const struct rte_flow_field_data *src_data = &conf->src; + const struct rte_flow_field_data *dst_data = &conf->dst; uint32_t dst_width, src_width, width = conf->width; ret = flow_dv_validate_action_modify_hdr(action_flags, action, error); diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 1267c146e5..a143ecb194 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -3887,6 +3887,8 @@ struct rte_flow_action_ethdev { /** * Field IDs for MODIFY_FIELD action. + * e.g. the packet field IDs used in RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * and RTE_FLOW_ITEM_TYPE_COMPARE. */ enum rte_flow_field_id { RTE_FLOW_FIELD_START = 0, /**< Start of a packet. */ @@ -3940,9 +3942,11 @@ enum rte_flow_field_id { * @warning * @b EXPERIMENTAL: this structure may change without prior notice * - * Field description for MODIFY_FIELD action. + * Field description for packet field. + * e.g. the packet fields used in RTE_FLOW_ACTION_TYPE_MODIFY_FIELD + * and RTE_FLOW_ITEM_TYPE_COMPARE. */ -struct rte_flow_action_modify_data { +struct rte_flow_field_data { enum rte_flow_field_id field; /**< Field or memory type ID. */ union { struct { @@ -4051,8 +4055,8 @@ enum rte_flow_modify_op { */ struct rte_flow_action_modify_field { enum rte_flow_modify_op operation; /**< Operation to perform. */ - struct rte_flow_action_modify_data dst; /**< Destination field. */ - struct rte_flow_action_modify_data src; /**< Source field. */ + struct rte_flow_field_data dst; /**< Destination field. */ + struct rte_flow_field_data src; /**< Source field. */ uint32_t width; /**< Number of bits to use from a source field. */ }; -- 2.34.1