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 CA8CA41B9E; Wed, 1 Feb 2023 12:35:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C945042D61; Wed, 1 Feb 2023 12:35:47 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2065.outbound.protection.outlook.com [40.107.237.65]) by mails.dpdk.org (Postfix) with ESMTP id 0633B42D55 for ; Wed, 1 Feb 2023 12:35:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HnLZiuxPEm3kE5uKHtkzArDUap2JCzNwRvNPvlshXSHi9plj9vp21s1OiSLzFMKu0aL63mot4d8RLHUby8KFMFTBcdFwR2Sd5efuIv+CyoO6HInn2OGKbWjzs0bQ/j5iqun0nIXR1NL6G5PJe1QzuxjwRj2xp1vSUZ2ZeIqYhi/u9HqIm9/g6TLeCXXCv9z2nAckgpG8RXFp1FQeD/+cuGqNmwacU5hGAKz/DsoI9DIFR61WV4ae5nYeFAIhpwMWXZGMotzUXspcHEGV4TFvh0QZrOYuScwtEOjmri6x1LPLPBnv6Uz+seQc3JU6EI6kKdRF5EiZiWkcTRorwhQ+pA== 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=/vZdTcwFiT3QekNYEFzAABRzpkjGQxE/EFP4QHti6PQ=; b=gRtfFlRC90jHjMpTYR8C9MEZl57xfNigWSPcSHnxIE6/ckpY6cwD3mfyk7bUrpy1ZH9yuxGn1gwLwV3ebW5u86sQErC5LwjMcSVZVv2E06aspASeRWEsgvwiSk/Zh6eFLMcWnNrF2+XCGiUMrCCcJ6K5DYVIZMBe8ErCxiF1qpQxeVZkGDmiiMf1QHHOlv4zFSzErcb0+HfP4AwSsGkp9OHj2iPliEJRsv/yC9dAgLHUmpLvuxkd2o50CdnqRR1h1rl1jxcSheyKR3d7hE2H0Dppxs4aeXkdW0PopyjkcIJw/BUSckHN92+7eDysuSbkwWB4Dd/aZOR8sfkPhwQMXw== 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=/vZdTcwFiT3QekNYEFzAABRzpkjGQxE/EFP4QHti6PQ=; b=C+bxUdqhFs7yibdk12o1iJeNI9FPrGz4SjPKGeRRmwFABrs6JV04Nt167UB/oXifzSOurw+6bCroaPC8Jf2dLBa4WJBYpLhI6gs/idlZxtBIjQY3hkMCAvJP4S+kzwvsTnOk+X6hQ5Z+DWp08uJCG/lw5cqcZgn6hoL8abXWRhItg+nJ6nBwjHq+XJl8uJ2TMf7NrV83vFV860nt+ISfAGWfZ/H8OUnD+nBVk4RoFK4xuQPyv2o4oE4QvyLUJVtvsVlUjuUoJGdW54rfBxpwjc7nyAMRYZ74aQt1QWmbHjkQt0e6eWWAd6xF7cMUsv1XHMveRbT8XQPFJXdNziYbPQ== Received: from DM6PR10CA0027.namprd10.prod.outlook.com (2603:10b6:5:60::40) by PH8PR12MB7325.namprd12.prod.outlook.com (2603:10b6:510:217::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.24; Wed, 1 Feb 2023 11:35:43 +0000 Received: from DS1PEPF0000E64D.namprd02.prod.outlook.com (2603:10b6:5:60:cafe::b1) by DM6PR10CA0027.outlook.office365.com (2603:10b6:5:60::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Wed, 1 Feb 2023 11:35: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 DS1PEPF0000E64D.mail.protection.outlook.com (10.167.18.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.21 via Frontend Transport; Wed, 1 Feb 2023 11:35: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.36; Wed, 1 Feb 2023 03:35:37 -0800 Received: from nvidia.com (10.126.230.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, 1 Feb 2023 03:35:34 -0800 From: Rongwei Liu To: , , , , CC: , Aman Singh , Yuying Zhang Subject: [PATCH v5 3/3] app/testpmd: add IPv6 routing extension header in raw encap Date: Wed, 1 Feb 2023 13:35:11 +0200 Message-ID: <20230201113511.2362188-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230201113511.2362188-1-rongweil@nvidia.com> References: <0c02f3bb-f733-b534-86e5-0cd047d927ee@oktetlabs.ru> <20230201113511.2362188-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: DS1PEPF0000E64D:EE_|PH8PR12MB7325:EE_ X-MS-Office365-Filtering-Correlation-Id: 4476a8d4-954d-4896-ed7b-08db0448742b 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: rd8h3IJk47njaLF3aK7W94hw6cNElcdC7fLFEAH4/RuvMWPwq+YinVauHYPVUNnyPITnUC76Rrqi5Tlwer31hOzeMkeWqc3bQACsK0fwUtTFCbLjflBBZR969OXO0fzWuMJTWGK2FljEs7W+pjm/2JiGjVKf6GURyTbL/AJ9ZtYLYF7E2uCww3/jyUs4WExiGb9f7Q8YZtxsS59sjGser8Swj7wMW9yrrzF2gm/yTKqiNlOPV9krCuSKvjBmEmOxa2AnAlw6xF1Rw1JvVj3j3SHtWhbZnZS31e+yb0oKKnERzBDS3DNQi6HnICFFPsc84hqGtOM7+iT8KLvh7xr9SJ8lW1XYhKvP40WJecD58ye08Wm2UL9yMm1T5/qw57tnszcW82n45Uhnav3kSEnpa0Ziv6becG3VPfcNPfEB9YiXQ/T3P/3MTqhkxHuin6/xWbyU+ZwYBmt1XYkliNQcaasZUR4MHRbRcfiTAaLkkaCuRQ/RWBY/o0YAVEXN3LgM5v+3KwBmeYvU0Uwzd+g0z6lNBVw9L2flxjV2hz0yvIaehqWbjWnFquWPPJvmuNqhgz5J/yzTSarpLbyapBErPReqKY+yYPW11gdcSrRSOO1xMiKLQy8YvchLCxgNACuQy+9zbZ1CQeYfT955CFs2yqgsnkTHtkqJvmgqi7TbO3yf1OV7NakP5uYyWpOleFTV+RWRDSOZsjgUjVT2iK3ksA== 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:(13230025)(4636009)(346002)(136003)(39860400002)(376002)(396003)(451199018)(40470700004)(36840700001)(46966006)(36756003)(2906002)(186003)(26005)(36860700001)(40460700003)(82740400003)(1076003)(7636003)(2616005)(47076005)(336012)(426003)(16526019)(6286002)(70206006)(70586007)(54906003)(40480700001)(8936002)(86362001)(4326008)(55016003)(8676002)(41300700001)(478600001)(356005)(316002)(7696005)(110136005)(5660300002)(82310400005)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2023 11:35:43.4687 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4476a8d4-954d-4896-ed7b-08db0448742b 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: DS1PEPF0000E64D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7325 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 IPv6 routing extension header support in raw_encap command. 1. No TLV support now. 2. Assume header length equals to the current segment_left. Signed-off-by: Rongwei Liu Acked-by: Ori Kam --- app/test-pmd/cmdline_flow.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index b8156ebca2..1340cf3a9b 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -10926,6 +10926,13 @@ flow_item_default_mask(const struct rte_flow_item *item) { const void *mask = NULL; static rte_be32_t gre_key_default_mask = RTE_BE32(UINT32_MAX); + static struct rte_flow_item_ipv6_routing_ext ipv6_routing_ext_default_mask = { + .hdr = { + .next_hdr = 0xff, + .type = 0xff, + .segments_left = 0xff, + }, + }; switch (item->type) { case RTE_FLOW_ITEM_TYPE_ANY: @@ -11028,6 +11035,9 @@ flow_item_default_mask(const struct rte_flow_item *item) case RTE_FLOW_ITEM_TYPE_METER_COLOR: mask = &rte_flow_item_meter_color_mask; break; + case RTE_FLOW_ITEM_TYPE_IPV6_ROUTING_EXT: + mask = &ipv6_routing_ext_default_mask; + break; default: break; } @@ -11182,6 +11192,7 @@ cmd_set_raw_parsed(const struct buffer *in) for (i = n - 1 ; i >= 0; --i) { const struct rte_flow_item_gtp *gtp; const struct rte_flow_item_geneve_opt *opt; + struct rte_flow_item_ipv6_routing_ext *ext; item = in->args.vc.pattern + i; if (item->spec == NULL) @@ -11202,6 +11213,18 @@ cmd_set_raw_parsed(const struct buffer *in) size = sizeof(struct rte_ipv6_hdr); proto = RTE_ETHER_TYPE_IPV6; break; + case RTE_FLOW_ITEM_TYPE_IPV6_ROUTING_EXT: + ext = (struct rte_flow_item_ipv6_routing_ext *)(uintptr_t)item->spec; + if (!ext->hdr.hdr_len) { + size = sizeof(struct rte_ipv6_routing_ext) + + (ext->hdr.segments_left << 4); + ext->hdr.hdr_len = ext->hdr.segments_left << 1; + } else { + size = sizeof(struct rte_ipv6_routing_ext) + + (ext->hdr.hdr_len << 3); + } + proto = IPPROTO_ROUTING; + break; case RTE_FLOW_ITEM_TYPE_UDP: size = sizeof(struct rte_udp_hdr); proto = 0x11; -- 2.27.0