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 7EDDB42D67; Fri, 30 Jun 2023 07:43:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06504406B5; Fri, 30 Jun 2023 07:43:48 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2067.outbound.protection.outlook.com [40.107.237.67]) by mails.dpdk.org (Postfix) with ESMTP id 5A9A14021F for ; Fri, 30 Jun 2023 07:43:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lNLaL8bSJduX4IlgLMLSHTy+r5drMosMc3jESRtzOxjfUr//UKZxL8+etdCnsjW7juVD4U+yhnoR3Fvvyw7gWcV6Wo/IPEMZw4vmYBK6OQbhKkJCWecOzJMKF++sSoQVtLKgmVclA9BDTbIXHUYVb1VC/NBVz5HaFRawhsqgZ9qoEXxObOZ8qSKqz2sz2VP+JTRdAp+Qu9VJx02cxeEawNTK3YSYgzLvtgfZeN7OAvxwoZOlSDWMaM2z8xq+AbQxSDVrsK7/LpQ++Sa+xYoyNvpo5CRzXRAqQ3A3VL49BXqqW8z31tvFU9r3myTdDBruOvwwG7Ryg0pxcv4hWPxJGA== 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=R07kuFYIvN8f56tmkKQTG++ZZOHSrepK28Mp+e13/4c=; b=ciWifHmb29dwOwbL2qjcMfFMI33u5CoMAnc8/forFa/XQlVq1/BbC6GOQlf2yDA5mUdGEwD6QspMXclp41mGsCh0xTQ43pXFMByuxL1P/PqcKgcOIKfica6cHwia59IF1y/ldqZBYqJPN9GBbg3RPmjXyf0xNvG2aJZQiRZEm0qT7nuBbTZ9EPuUPNqA3nviCVG6Ww1tkG3/9mndXCm5aqkcNifdLE4EJsdmKmcbK5nCbDsp2X3Vc2INfzThDqWThoQM8KlR2azDakTcTUr2+IldNTaEe14xyrms7qnzQKKDOy4HpThIE2RQx75/ClBBxeMoZvyjAJfoUkPGeuxRsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=R07kuFYIvN8f56tmkKQTG++ZZOHSrepK28Mp+e13/4c=; b=oBWv6yn/8HTR5WtTykFRrUp+DWOBoLt12IDwq0/V3EtSvF7zMO6uKpMOfUmtZNooy5Wcbs152CoK3K1aRDuf5DEqUN9JOdn+TZWSaWnb2m4QyJj7gfhWs2eMOYtDs3sBXADS4v1iIk5rtK/GpNo5x7yK+dhhC7OiOsf+5AOv0E406hKeLWQI4MK1VjfJNVT7bqBkazK8s7EviHDVQOIY75uAChM/sMbASej6A9Qb2+ZTn49G2ePQ/ZIh1RYkir/s+9ZC20lKKjNwzLP32auRjE2EFB9JglkKzqppVNPEfl+tlWogJdOUGbbN96zWvGBfAGGQxQT1omu847jvQpsm9Q== Received: from MW4PR04CA0368.namprd04.prod.outlook.com (2603:10b6:303:81::13) by DM4PR12MB7670.namprd12.prod.outlook.com (2603:10b6:8:105::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Fri, 30 Jun 2023 05:43:44 +0000 Received: from CO1NAM11FT098.eop-nam11.prod.protection.outlook.com (2603:10b6:303:81:cafe::89) by MW4PR04CA0368.outlook.office365.com (2603:10b6:303:81::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.22 via Frontend Transport; Fri, 30 Jun 2023 05:43:43 +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 CO1NAM11FT098.mail.protection.outlook.com (10.13.174.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.50 via Frontend Transport; Fri, 30 Jun 2023 05:43:43 +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.5; Thu, 29 Jun 2023 22:43:35 -0700 Received: from nvidia.com (10.126.230.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.37; Thu, 29 Jun 2023 22:43:33 -0700 From: Bing Zhao To: , , , , CC: , Subject: [PATCH 1/7] net/mlx5: fix the modify field check of tag Date: Fri, 30 Jun 2023 08:43:03 +0300 Message-ID: <20230630054303.432238-1-bingz@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: CO1NAM11FT098:EE_|DM4PR12MB7670:EE_ X-MS-Office365-Filtering-Correlation-Id: 56e47e78-66a8-490a-634b-08db792cf730 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vXOJqlB0xasfIxtt0v2leq1NQuzo71PweDaR4qNEl4kZ6NEBoVaj0jM05amucf9uurExiv1E9Uc1+5BtRJP36Gib93JDJ9yBdAWhBSe5zg2a5bCpb7OMVf6olFr8dFW4pivYn9qWHVLNe0H7jjp8gu0lOxapCIJ3z6cd+EZ4Xxc0RUYrcWfHUG8RnzbRkU+yr/hR5tRvZ0icnG6jmtiTNH7XpGM+KmLtW7oA9V83lckpbB7S1YDRUVUEKi5h754K528E0nEoaKCm8GQa+nV+wI+yB1J0UrCG2IJx8JRECK0dXBV3ALQ1ZWE7o4a37Nmzs3enYh1PRQNmdnCfZ8+/WLjltrBH34kMilDcsTenhOiTFkNOcJFlFyVuYLZF2ctLTbq7Y/lQXmK/UDzIPlIhRI164H/WSsBJU8DD/Ikv84eUqwsJ9Q5nAXHn4KiVB77tkvMzJ1fZyHTyqVvDW3OlTQtXEGZQ2Kl0GTz0fjW5TEaeeu6TgyxB3B8BjweFa1YaULCNNpK+BUieB3Dx1b3frVynAuvEMf8WbuKeQXismfOhFxeth3vbiY83zG9jxeoV2pqm0gEyc4HgrYeodf8x3jAL/Dg05LrZl4JHrd9VmCaRiW4Abiuin39c/sKVYHOyiZ1lVjzQ+D/qfMgu0i2wOvWObmrj9is9SlPfs3Jb6J9zbDQZuBqHW3gz0AInOkepY9+a9utZBjkxgqc1f+waTwkanO1Bc4+W+LoLWyFFCHalL5mBCHu9vVe9cZKQF3S7 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:(13230028)(4636009)(396003)(39860400002)(376002)(346002)(136003)(451199021)(46966006)(36840700001)(40470700004)(40460700003)(41300700001)(316002)(83380400001)(82310400005)(426003)(36860700001)(86362001)(336012)(16526019)(6286002)(186003)(1076003)(26005)(2616005)(2906002)(82740400003)(7636003)(356005)(40480700001)(55016003)(47076005)(5660300002)(36756003)(8676002)(8936002)(107886003)(478600001)(110136005)(54906003)(70206006)(70586007)(6636002)(4326008)(6666004)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2023 05:43:43.4628 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56e47e78-66a8-490a-634b-08db792cf730 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: CO1NAM11FT098.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7670 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 The new member "tag_index" was added into the structure "rte_flow_action_modify_data". It is the index of the header inside encapsulation level. Both the "RTE_FLOW_FIELD_TAG" and "MLX5_RTE_FLOW_FIELD_META_REG" types will use this member instead of the "level", but the "level" will still be supported for the compatibility. In the validation stage, not only the "RTE_FLOW_FIELD_TAG" type, but also the "MLX5_RTE_FLOW_FIELD_META_REG" needs to be checked. In the meanwhile, lowering down the log priority will help to prevent the flooding. Fixes: 68c513e861ca ("net/mlx5: align implementation with modify API") Cc: michaelba@nvidia.com Signed-off-by: Bing Zhao Acked-by: Ori Kam --- drivers/net/mlx5/mlx5_flow.c | 5 +++-- drivers/net/mlx5/mlx5_flow.h | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index cf83db7b60..97211fc209 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2411,7 +2411,8 @@ flow_validate_modify_field_level(const struct rte_flow_action_modify_data *data, { if (data->level == 0) return 0; - if (data->field != RTE_FLOW_FIELD_TAG) + if (data->field != RTE_FLOW_FIELD_TAG && + data->field != (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "inner header fields modification is not supported"); @@ -2424,7 +2425,7 @@ flow_validate_modify_field_level(const struct rte_flow_action_modify_data *data, * 'tag_index' field. In old API, it was provided using 'level' field * and it is still supported for backwards compatibility. */ - DRV_LOG(WARNING, "tag array provided in 'level' field instead of 'tag_index' field."); + DRV_LOG(DEBUG, "tag array provided in 'level' field instead of 'tag_index' field."); return 0; } diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 003e7da3a6..d6e88425a3 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -52,8 +52,8 @@ enum mlx5_rte_flow_action_type { /* Private (internal) Field IDs for MODIFY_FIELD action. */ enum mlx5_rte_flow_field_id { - MLX5_RTE_FLOW_FIELD_END = INT_MIN, - MLX5_RTE_FLOW_FIELD_META_REG, + MLX5_RTE_FLOW_FIELD_END = INT_MIN, + MLX5_RTE_FLOW_FIELD_META_REG, }; #define MLX5_INDIRECT_ACTION_TYPE_OFFSET 29 @@ -1117,9 +1117,10 @@ flow_dv_fetch_field(const uint8_t *data, uint32_t size) static inline bool flow_modify_field_support_tag_array(enum rte_flow_field_id field) { - switch (field) { + switch ((int)field) { case RTE_FLOW_FIELD_TAG: case RTE_FLOW_FIELD_MPLS: + case MLX5_RTE_FLOW_FIELD_META_REG: return true; default: break; -- 2.34.1