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 1C755A034C; Wed, 21 Dec 2022 09:44:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD15D42D3A; Wed, 21 Dec 2022 09:43:59 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2067.outbound.protection.outlook.com [40.107.92.67]) by mails.dpdk.org (Postfix) with ESMTP id 33A7C40698 for ; Wed, 21 Dec 2022 09:43:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=McNeY3nwRzI7xczC+aVPjGNaRCGQbHSsF25yEy3vMavaJDlIhtBRdKiwbuPIJYI/9YU5EjfaG9pU2Cv0T5/0m7m2qxx3k/qLDihgFqcWnImlPnrc9OsydzUT+Z11DEXS7LladcfmiQiSJxSgbuR5DWe8/YDzftEqY41gsC5R9PJabBDB21wiCGNM1hyXfy24mIwDFr7PK5uJynL8g6GqkbAu498yRnn7FHuvzZHzeb2rG20xTE9HOqtgCpYjKfPWg5iSMXU8bZETWol1DAh942fB/78b3w4tNlrg/KlGOkl4qBoklf9nw7+73LLfiQoChaoDLQ6reWcXxje1l0gmwA== 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=obUpnzst9SWmyYqxX93uBuzTNThJvzsvYmJiDunY+28=; b=lMXVopYoUD1FHPMFpNUUOpj0qKD1Qiub5P0hqi1oO2Gs5lPkxKyNhZwZKqPVK5s+bUh9lukczLRkhfzivhg6NXf3nA04mARp7RD8o/yYsby8OEUzDinT/k5mweFGI0SrMH9anmElJwB+2YuUKYZCEtK74BnuIC/sOc22a8BC+aVTZtvYqZaPi/SHpU2DxKsbo4VsZ1SP1Zemt86XV7+emqtTM49c/PYBbnuE4DGRVq17lMFVNpcV+dnzu5XLsK4MzWEg+UmBwtFJ3/8hdQ9YhLSsIx7X34a80i6UDzYUCQxTVcNpWJ2y4UtJilXOzBy2endNI+5kW6zkQaOfLJaH/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net 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=obUpnzst9SWmyYqxX93uBuzTNThJvzsvYmJiDunY+28=; b=MLm3Ak/tMa2Xdf8eFVeDLzBTp5VL3PToBlVP8wSVZw/Bf1BBqSJ8D0SrxIxZ0HZSQJOkEzD7vsvXoox22a66fmg/cS3DULAltfhGe5kfJM7Zmzjfh9s7RmhCU+9A/0XV+rhkSHWOm+cFx2QuvXEXRbs6z7UxanJq0V0KPaIuBFBGpi2hTYOh0PBkmdnIR1gjXtw8CMpvOh35NY2Hz1dsNtDaaofxxc8+Js8QG0xNtERXpkntXVYMvuJ+Tb+W/jPsp0m4G2Yz0ysX5AZIoFEvwqa7Nv+7HieVxbDl3njTIl92zaER04QecNVuFi1fPK8BgiojrXFSI19JhdU/G3OFLw== Received: from DM6PR07CA0051.namprd07.prod.outlook.com (2603:10b6:5:74::28) by CH3PR12MB8354.namprd12.prod.outlook.com (2603:10b6:610:12f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Wed, 21 Dec 2022 08:43:54 +0000 Received: from DM6NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:5:74:cafe::93) by DM6PR07CA0051.outlook.office365.com (2603:10b6:5:74::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Wed, 21 Dec 2022 08:43:54 +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 DM6NAM11FT026.mail.protection.outlook.com (10.13.172.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.6 via Frontend Transport; Wed, 21 Dec 2022 08:43:54 +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.36; Wed, 21 Dec 2022 00:43:46 -0800 Received: from nvidia.com (10.126.231.37) 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.36; Wed, 21 Dec 2022 00:43:43 -0800 From: Rongwei Liu To: , , , CC: , Subject: [RFC 9/9] net/mlx5/hws: add modify IPv6 protocol implementation Date: Wed, 21 Dec 2022 10:43:04 +0200 Message-ID: <20221221084304.3680690-10-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221221084304.3680690-1-rongweil@nvidia.com> References: <20221221084304.3680690-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] 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: DM6NAM11FT026:EE_|CH3PR12MB8354:EE_ X-MS-Office365-Filtering-Correlation-Id: 8010e482-de95-42ef-2d4d-08dae32f7e57 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: NY0t9mqE36SP8ncaIt5o9vumrXb0GOgTQtStj92E1E0+bVPVivxYvRjZWr58ICoAy28EKliF7AkWuibV1ce9lx5VkcnO1zLaMfmrX3UyJV5R4OGyqutLOrSWAEfhtvufVrUkMdMWinTvaIgASShsB6dFKw/eVqbazO1SW4oHimA43zFLP5LU+FtxwU0lZYCVjeIssuY5VbkHz8T44hQ6twYCU6lj+lzF4R0MqoK3nq1xvLYoeJWTnDI4tIAS2gyLSpJzsVM4czytc1KFTySmVlFPGmGkyFu4XkFD1NYGru9LgSx6iSvBSoExsOmo5HhBzRNx6OfF+ISm+E3KwpJN+812U5b8ACkNTUzOf6I8zPgUutCQyvDhKJ9bW+lb3lP2KD3wHkc6UfpFjce6TLkHaXF0Lyw2GflzLIk85Oz9wUeS/0r+lIkQAjV2+GshiwkB5GVzhY6NoOWyPaAhlg8jEN/TgvvYFctYMEvP3C0CH4b0S5WH44kmpcb9sHEFCwlnWeopzZIoFResn9u/HBBTXtbSctms6BCAzhg5ckjiiVUTj4vRbQjMHOcSYR564QCUL/0+vziiklpgGxTjmlYDQxVLufJ7D5yBFTBkmOrcxgpdiQnodWRzRKfL8WVO9+WUefUhTQ9g711gIMBG3en0opqG/MfBHZhu1UZ2ho6ficR3+PcMy8uP+EfR3v0ho68pasn54j7l4AJIi0QJ3qHqeQ== 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:(13230022)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199015)(46966006)(36840700001)(40470700004)(316002)(5660300002)(4326008)(36860700001)(8676002)(186003)(16526019)(6286002)(26005)(40460700003)(107886003)(6666004)(70206006)(70586007)(1076003)(86362001)(2616005)(7696005)(36756003)(83380400001)(8936002)(47076005)(55016003)(41300700001)(54906003)(2906002)(426003)(82740400003)(478600001)(356005)(336012)(82310400005)(40480700001)(7636003)(110136005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 08:43:54.7394 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8010e482-de95-42ef-2d4d-08dae32f7e57 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: DM6NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8354 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 HWS modify IPv6 protocol implementation. Signed-off-by: Rongwei Liu --- drivers/common/mlx5/mlx5_prm.h | 1 + drivers/net/mlx5/mlx5_flow_dv.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 1545b929b6..c57d49e079 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -753,6 +753,7 @@ enum mlx5_modification_field { MLX5_MODI_OUT_IP_ECN = 0x73, MLX5_MODI_TUNNEL_HDR_DW_1 = 0x75, MLX5_MODI_GTPU_FIRST_EXT_DW_0 = 0x76, + MLX5_MODI_OUT_IPV6_NEXT_HDR = 0x82, }; /* Total number of metadata reg_c's. */ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 7ca909999b..e972a2dc5a 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1357,6 +1357,7 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev, case RTE_FLOW_FIELD_IPV6_DSCP: return 6; case RTE_FLOW_FIELD_IPV6_HOPLIMIT: + case RTE_FLOW_FIELD_IPV6_PROTO: return 8; case RTE_FLOW_FIELD_IPV6_SRC: case RTE_FLOW_FIELD_IPV6_DST: @@ -1883,6 +1884,15 @@ mlx5_flow_field_id_to_modify_info info[idx].offset = data->offset; } break; + 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}; + if (mask) + mask[idx] = flow_modify_info_mask_8(width, off_be); + else + info[idx].offset = off_be; + break; case RTE_FLOW_FIELD_POINTER: case RTE_FLOW_FIELD_VALUE: default: -- 2.27.0