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 9044641BAB; Thu, 2 Feb 2023 11:01:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94B6B42D9E; Thu, 2 Feb 2023 11:01:21 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2059.outbound.protection.outlook.com [40.107.100.59]) by mails.dpdk.org (Postfix) with ESMTP id 9B3FE42D85 for ; Thu, 2 Feb 2023 11:01:20 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PmTYLvAlPSYWLSGG4iXPhNJqEw3HDxxVmplaZw8ZKp/r6Vck0SITiXd9zWy+OYacR/KX2VwYKXfwwnu4GGQorMiGz63JS/UUFGSyNRu2IuKjZ/Qlr9OARJ9iaS6YtLgqO1CHCQZnhjWQE6AJ79UR7jQmCzjWG5qFd2csOxyjGtQOechNajBkpffNZ7nMQ4Jno0UI7rYN/0pGIb/q1ZPv3LNs5rfJ4HcU+HjJvNdNVbHoZ/OUVuD4H4UqjiXvj0i4L1jDigq/4UYqA945sI4TezV4YB3L4j8V3xpC5lSuA/piARd4HwHVAyO2kE7NEvnhz0twFd+51nb8UkcU8LDXAw== 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=P7RtSgvGpMtS/MsDGVysjvLYmwOHhMb28POo7ahmPgiNzdKz0Kev5qNcV5CedtcRM+mgx3NAioqjOJE7z03a9FTLj+2AlpDEQKIXgxVXPirywzr86AIcp9msLHVMhGIZsYqENmG9pDPOb2qSBe64sSK+4YvahgtOvJw/tZsXe43Lqmm3CUTrXViZicjklT8WglnWt04D8wY7O3U/jBgxMjX5v5ngfeIedPqB7JmQysXmvc0SNZjHeAQgjwR5/ODzTtu8+okbRqz967mWbjCuTnN2RiCf5Pq3Mso6m9nKxn/4YlePvLj1QSp9QjBsp/QRlg/7TxWnPlLXjSr1MDtAfg== 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 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=A8ODOSsLhwdOzOjxJMJxQnYNuJwsO0mLlbY4aeGCFeocjV4PPVGQ9VMF4av8q4HvemOA38GHt8hyKooM8wC0KYi5cERE/Jt3/aIWAbjFx/V49UmTjRmGaKd+UTl0J69Qb5CCFtNYTPcqe4lyQNKnZO2KXtcNKm/mw49S4gZ5Pi+b5a4Mf7vBiUyR5tyyEt0flZ8STojxilzqT9V5zw4QJC5LnqomtT3t/s3KOerZ7PMErbjJNFEaaRXUUzJfHIP0sjJSxRXXsfseKH37CHPKt03m8O0hsSSximWFWYjCCv7KtzMHitug+TT4wnGkJgONt6h8v9tH9Kn7QFjdGZP1/g== Received: from DS7PR06CA0006.namprd06.prod.outlook.com (2603:10b6:8:2a::7) by PH0PR12MB8151.namprd12.prod.outlook.com (2603:10b6:510:299::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25; Thu, 2 Feb 2023 10:01:18 +0000 Received: from DM6NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2a:cafe::ff) by DS7PR06CA0006.outlook.office365.com (2603:10b6:8:2a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27 via Frontend Transport; Thu, 2 Feb 2023 10:01:18 +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 DM6NAM11FT035.mail.protection.outlook.com (10.13.172.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Thu, 2 Feb 2023 10:01:18 +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; Thu, 2 Feb 2023 02:01:08 -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; Thu, 2 Feb 2023 02:01:06 -0800 From: Rongwei Liu To: , , , , CC: , Aman Singh , Yuying Zhang Subject: [PATCH v6 3/3] app/testpmd: add IPv6 routing extension header in raw encap Date: Thu, 2 Feb 2023 12:00:21 +0200 Message-ID: <20230202100021.2445976-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230202100021.2445976-1-rongweil@nvidia.com> References: <2111452.3Lj2Plt8kZ@thomas> <20230202100021.2445976-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: DM6NAM11FT035:EE_|PH0PR12MB8151:EE_ X-MS-Office365-Filtering-Correlation-Id: 4654400b-1362-4376-489e-08db05046dea 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: wJIFFVE2T/B2p0Hl5JqpyLlGoIoTIqjXBzrK9tBbpJE8SbTnnL492EFw1Cv5aqSp4tItA3KORfX0bn1sU98N3LCq78A2hQQX+ZyqIH5SFrQthSayCURd2f4OeYhdLb/MWsrFJonbMJ71Tkg+4qfMdJasiXwKfdAUoV8K24ivjluu720UURYYAnQ0faXCOq8BGadzeWbPAPLzTkD0qQ7YeWvEPdmqe/wcX8TyslsVJCiuAD1r20wu3pOdB0IODI/3dYikFeI1SBQwWn/MMpEq25QuUv1xtk5cXs4KESzc661EZzspR5WbQOMuXph5XxkRxXydLRnyBttamLHcxgQCBhuag5nMJHLjEzawk0gVRJH09WJ8g0E+kZaU+0xKnU7sUlfYS/n78CmPom2HZBW8gknwWXSqEILhwjPzmXW9TZgeGl3yJ4Sz34M0YzTqlRPMsTiX4dxFen/i8ol0acQXuL/X6qhaZOaLWBCdzE21Ecgpp2hdNSBTmqkSBCpnqN5EH0mBNe0q1OOv5vd44LUkzkjVqrwZawkoy5LciZ5K1/JDI6PuNQFdYWyCDWTgpfjGQMMy7Dsv3eI9lXvOsKkP7zKZXfUtYBUQsQOMksHFDZ7G5nebCygBW723xyaK6vOmsKS1UCly+tQmXtpc1cxkYZmmg/iDQYQcRHl4I3qmSTJGzPhUtwBF05zTy1y1Vux2sNQEkpda4+PsW4gwIXhxqA== 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:(13230025)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199018)(40470700004)(46966006)(36840700001)(5660300002)(41300700001)(8936002)(478600001)(36860700001)(4326008)(47076005)(70206006)(70586007)(8676002)(6666004)(36756003)(1076003)(6286002)(16526019)(186003)(336012)(110136005)(2616005)(26005)(2906002)(7636003)(82740400003)(40460700003)(86362001)(55016003)(356005)(54906003)(316002)(7696005)(426003)(40480700001)(82310400005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 10:01:18.3573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4654400b-1362-4376-489e-08db05046dea 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: DM6NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8151 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