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 C192743A2D; Tue, 6 Feb 2024 13:18:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C5E4740E5E; Tue, 6 Feb 2024 13:18:21 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2080.outbound.protection.outlook.com [40.107.220.80]) by mails.dpdk.org (Postfix) with ESMTP id C779940ED2 for ; Tue, 6 Feb 2024 13:18:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNG56IaUmx9y6EwvOQy3D4PNp1xVHNHD1EWFCYQ9EL5+gNnMgCxQC6A/O09h5yxuIlSkZI/1IXB/Qjzpg2BJrlrRECmR1Gt12iGhW5vuHpApj5qNFN17lO43ugYAneTqgKTbVhAur4wgrMucobL3oMBHpLq9HJc0irGICZMHYRXcR37vymloRAICV3kVQ7tBEmxhEtmmU4Dla4IxmZT+u04f7uitjtthS6oRULrEEna2LxIqBdeY2DEgwaHmgoE3x2ONpM6GRiwGeEa+zjgZq5DONSXex2uCf+e3OrIs/1sS1hUwgkRl2X2Bu732Prx2IY5aKf/x5np32WOeUdQjGA== 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=lVHDT6p7xwpDF76OW5ko7KH6aNly9UHzMBVh4SwtYbA=; b=oQWrLGujOIl4jD1rOPQ85ZJ23KXiG+8DGARYI7khqDym7Lkg1NxeKW2iV/R4484j8HvgJkX2HFVMg8vyDdbmnH8x62haseENwqXOzta3EeUNg4sIAMbbck9948bypfOI6Nt923Y4tfuJqHyEzJj+44MRtfmMkEveeXQJSasZqjptoAnJSoeOdhE9JgTx5KVPPPBwgX3d2fDMDzGUQPHHpb0YhYiOJYAO1ZIKdWZVswgNNXBLWiStC5kKFMkCi9DnskVQSLOGLmuI1wyvMSeFvVzC6J1POgjZptCVXcsgOZD9JA3PhyXFiaqDil0owJCcffZDlqFn9oAUaY/jMM6Rlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 (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=lVHDT6p7xwpDF76OW5ko7KH6aNly9UHzMBVh4SwtYbA=; b=I2IEfICQv/ltqO+AuBzhK3K3UOgw17xQtem5pLydtwLuHSFu/s9UQzXjCXNmXwgOGgbKZnb8ZM1mhWOGbu8p4xx3hsez0Y01YB55hbIBnnXY6FZwGGJCbGSk8l6kjxsBks4bx1WeARbJE3aYFKKaU7ktUGr6kj7GH1N6hC+ClTrKVkbdFk/cCm2w+P68RYv+nAUr/pL71V6xzz0tQH/Ce/lTab9vrEIP3OeM5hRBb0Q/ayYoZKcPKK9b/yJUBSQStxex6aDnvzBrg44RZx6sLohxReWOEzF53qx+PbKpuR4NlOqo9kDW4CImMT4sahLyO40CcQJmgQ8qlV7IE09oSw== Received: from BL1PR13CA0154.namprd13.prod.outlook.com (2603:10b6:208:2bd::9) by PH0PR12MB5629.namprd12.prod.outlook.com (2603:10b6:510:141::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.14; Tue, 6 Feb 2024 12:18:16 +0000 Received: from BL6PEPF0001AB58.namprd02.prod.outlook.com (2603:10b6:208:2bd:cafe::af) by BL1PR13CA0154.outlook.office365.com (2603:10b6:208:2bd::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.22 via Frontend Transport; Tue, 6 Feb 2024 12:18:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF0001AB58.mail.protection.outlook.com (10.167.241.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.14 via Frontend Transport; Tue, 6 Feb 2024 12:18:16 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 6 Feb 2024 04:18:03 -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.1258.12; Tue, 6 Feb 2024 04:18:01 -0800 From: Viacheslav Ovsiienko To: CC: , , , Subject: [PATCH 3/6] net/mlx5: add modify IPv4 protocol implementation Date: Tue, 6 Feb 2024 14:17:33 +0200 Message-ID: <20240206121736.27391-3-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20240206121736.27391-1-viacheslavo@nvidia.com> References: <20240206121736.27391-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB58:EE_|PH0PR12MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: ea3ce6ac-6283-41d5-45e8-08dc270db27b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nP1toF9OHLe4Zhhxw53mMhbYlSXJ0oBwl9EqNps6RIkLzXbr6SViD8IOfgWS9q96UZIBb7iB6AKrgUeEvS8k8jSyz3y5ybsjZ5VRGhNkFIax33SuBSr4CPTg//E1vFrGBuxUuXDTAIntx+QuxFfHm+FBOZzLuRXdCGmsBzTYtl8oYvUL6hFLaB88IStypAiCp1tD7o1yNvg/kQZJxhufJoTXPeL4Tzo8gZDQEiALik2fnt9HRClIzDOGZIT8LYkPJUr/kUe17qgOiUPS3OiWYAav6aI5+8eeLGNNTkw6UntVQ2RPlZar/Q+tijkC/j5vRoktCgYxb5tDK/V/LdWJOWleorT78Aq6mCgVFhvp7NEN5hLcDX1yHIQB/uOyT6ttUw0A6ObClji0p48smeXCadcZVy5PX+zWQwGFQMDSpTRxK+LrlBf9CyGUREQcDmWVvg0PQkIKyz8xNNtLQim5D0cS5TXpr57DVYs/TMyrhswZMX5FEzNjbzUCOJlLQmVYuf/QLJgqmE9Gs0fstOIauVG0gEhZhcxufnKnyG/32Cn/WXWWRvgDJtbNLqlFffu/yrfBOMKQnoNUmvYt5TQcVB2HIqaFLYDynlwz0G36s5/MLx1Xw5C6w9i+tBMWwTYZIamIryt40kvrki2+3xUd5NM4r5MIPpCU2G5NYGp9XKtvyaPuuwh+sMX9AcmIQv2lkF3E1so0qK3NUWz4fQmxBIgZ8PdVDqYeNWgdmbg4Q4iUP5VTqC029RjMYgjc0FpI X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(230922051799003)(1800799012)(82310400011)(186009)(64100799003)(451199024)(36840700001)(46966006)(40470700004)(55016003)(36756003)(40480700001)(40460700003)(478600001)(54906003)(1076003)(82740400003)(107886003)(2906002)(426003)(41300700001)(2616005)(356005)(83380400001)(6286002)(6916009)(336012)(47076005)(26005)(16526019)(8936002)(316002)(5660300002)(4326008)(70586007)(70206006)(6666004)(36860700001)(8676002)(7636003)(86362001)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2024 12:18:16.0217 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea3ce6ac-6283-41d5-45e8-08dc270db27b 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB58.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5629 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 IPv4 protocol implementation for mlx5 PMD. Signed-off-by: Viacheslav Ovsiienko --- doc/guides/rel_notes/release_24_03.rst | 1 + drivers/common/mlx5/mlx5_prm.h | 1 + drivers/net/mlx5/mlx5_flow_dv.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst index 33e9303ae1..3e33ff2d86 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -91,6 +91,7 @@ New Features * Added HW steering support for modify field ``RTE_FLOW_FIELD_GENEVE_OPT_TYPE`` flow action. * Added HW steering support for modify field ``RTE_FLOW_FIELD_GENEVE_OPT_CLASS`` flow action. * Added HW steering support for modify field ``RTE_FLOW_FIELD_GENEVE_OPT_DATA`` flow action. + * Added HW steering support for modify field ``RTE_FLOW_FIELD_IPV4_PROTO`` flow action. Removed Items diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index f64f25dbb7..44413517d0 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -839,6 +839,7 @@ enum mlx5_modification_field { MLX5_MODI_IN_MPLS_LABEL_2, MLX5_MODI_IN_MPLS_LABEL_3, MLX5_MODI_IN_MPLS_LABEL_4, + MLX5_MODI_OUT_IP_PROTOCOL = 0x4A, MLX5_MODI_OUT_IPV6_NEXT_HDR = 0x4A, MLX5_MODI_META_REG_C_8 = 0x8F, MLX5_MODI_META_REG_C_9 = 0x90, diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 6998be107f..764940b700 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1384,6 +1384,7 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev, case RTE_FLOW_FIELD_IPV4_DSCP: return 6; case RTE_FLOW_FIELD_IPV4_TTL: + case RTE_FLOW_FIELD_IPV4_PROTO: return 8; case RTE_FLOW_FIELD_IPV4_SRC: case RTE_FLOW_FIELD_IPV4_DST: @@ -2194,10 +2195,11 @@ mlx5_flow_field_id_to_modify_info info[idx].offset = data->offset; } break; + case RTE_FLOW_FIELD_IPV4_PROTO: /* Fall-through. */ case RTE_FLOW_FIELD_IPV6_PROTO: MLX5_ASSERT(data->offset + width <= 8); off_be = 8 - (data->offset + width); - info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_OUT_IPV6_NEXT_HDR}; + info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_OUT_IP_PROTOCOL}; if (mask) mask[idx] = flow_modify_info_mask_8(width, off_be); else -- 2.18.1