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 9551741B8D; Tue, 31 Jan 2023 10:37:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BAAE42BB1; Tue, 31 Jan 2023 10:37:50 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2040.outbound.protection.outlook.com [40.107.100.40]) by mails.dpdk.org (Postfix) with ESMTP id 20FE54067B for ; Tue, 31 Jan 2023 10:37:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q9RoaBtMUWXTBPnfIDRe43rml5wDAFZPFAAhG70F8MXCgWHo66Lwg514zUirPVXKr0bokfbFCQQb8x9Rpp9t3sqWMPJ26n+XxXhPaT8hoAAiVbOG+ujBnCgAGicv1s4r0X7tcOzaRKmLmPzjb2vHfcUgoEjpHrq/kFOtJxefSf3rzwA5JihL06gpPcptLxO4BSyUYhv2QV9CvxDgY99q28yqh8Ai7iawaG/s2on4ovRisn1YfWUdnnNzvI55ADGOOsByakyawUDHjGtVDFWyfPSJAMaarcG+FJmPFqHWAWZHCNnlTIr2KN6r2k0tF/gurpZiHrEfVTu01rS6WmZHfg== 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=WF2TR+NpYq/y/nwzEGLSlT5Zclcl3phFsJRmEqo6dUxB5ejp2vRIQ8NXILRB2zEQntTbDecxt76ciSy8Z+QWrXC8dAh3TAOFBIhe3BLqyKBPfPU0Lxzb9DDctBUX7UYi2Ph0+cKb0JW1gQ85Ob9b8WBhMQky/mUbzxs52FkJinQZdq2Z5WvjersGgH5YoXNeLPiyb5y/2Xx35HeAUhieqMf46i01ZZmL/oS6xtMM9QJ/VwZGMx9YLq8IlOfPsGSopfb9R+3nqi6x9OcyIl/Az/KJV7xibM93OLYpdn3q0E57Ttm8i13OaQQ2rl5buhVfk1M/yed2KhzRqGVS7hJVQw== 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=Qa1TDcS5pMs5TgrV1tDxD6o6SNLCty2TSm+tLoiLjdKZzGSCq2NulYDII1oTRlgUDHlusBGTptu6keD+RayBzrWCvyxl8F0qq1zEZeGlfqU9p8MeF+gYH3fStUC6ZFUciE50DWoAw+UbHaqdeGPW7MeYCwlHhTlLbKBpsSzAKlwBQ01sBaX3M2nr9ZSKakDL2j2uMb51NSESQb1onRUZrHgvBp+N/q6K9iMyXmK1Sof70U5d/II4wYxscdMFsYoDHVLG9AaxCti56o1m+03TTEtFUrriC+QlIJrGHBwkOBLEEkePgA8P+4Hr2qt5vb8Vhd/21AMtEI+n7OIh1xMaMQ== Received: from DM6PR03CA0026.namprd03.prod.outlook.com (2603:10b6:5:40::39) by SA0PR12MB4399.namprd12.prod.outlook.com (2603:10b6:806:98::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 09:37:41 +0000 Received: from DM6NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:5:40:cafe::a5) by DM6PR03CA0026.outlook.office365.com (2603:10b6:5:40::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Tue, 31 Jan 2023 09:37:41 +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 DM6NAM11FT028.mail.protection.outlook.com (10.13.173.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.21 via Frontend Transport; Tue, 31 Jan 2023 09:37:41 +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; Tue, 31 Jan 2023 01:37:22 -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; Tue, 31 Jan 2023 01:37:19 -0800 From: Rongwei Liu To: , , , , CC: , Aman Singh , Yuying Zhang Subject: [PATCH v4 3/3] app/testpmd: add IPv6 routing extension header in raw encap Date: Tue, 31 Jan 2023 11:36:57 +0200 Message-ID: <20230131093657.2240006-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230131093657.2240006-1-rongweil@nvidia.com> References: <20230130190218.0f6b1b5c@hermes.local> <20230131093657.2240006-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: DM6NAM11FT028:EE_|SA0PR12MB4399:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e30e7cc-0fc4-4f57-0ccc-08db036ecc91 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: TYxuA6qPOvHLRvmA4IABCOZ1GQ5cJEvhQ33NRLGsq5+kGeWUDsvnQKeVkbNrfjpNWDM6Xt5c+x4ex9f59W/wIjJk/3jSSNS1ZZmISql4XaF54+Juh4tImYPwNg6cvEh5B4JiYo5yge4WuCeqDRHrK3iHj7D2xQQ+LZ2wHInhuGKWcV+mA1L+AMOse02s8sxBvh6c4F0HavevjkdfP2SCq4Spx1B5alKCp3bvkpKxVbtlbTo1sPVSVjH7LbkU6E6viTN9FAbx4UWMeO51Vw4pd8dyjgTUfDqzK+kpSlZfL/uTC3roILpep8RL+iTvj+oyTp6eczlJZFT3OHXFbT/MX1/jJP5iijIF0wgvKPoQBRGSeQENt8myJ35vvjtvMzC+KBim9L6I9BJG63QK8aRoxzszEAP9ncNkHYbjlC3Dt7skPlwm8hDqn4Rfn/OaiblSU74DUO7aedzk4I8DUfE/9fvOIbq0nKi9ysuLcGGOZeUFlG2Enq1mOUAs/HxE6UAMG/NICApmnxDVn/D0876Zo31UzOfac1dK78kwN31uOBpU06YlKYmcTlBt3chKYANqpluyY6zFrXIw2c+PJmrF85b3CGffAjhJ7w3armCld/c1nJA2g+iCvDYKkVqExzfkaW+XMQQWPwsqsFdSUpPQK9/0rnGYcnR84ZOQZMt9jsthYuZWB9upbLUcDnW1FZvv4fZZTMieXoDYjdXR7vGxkA== 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)(46966006)(40470700004)(36840700001)(2616005)(82310400005)(47076005)(6666004)(316002)(426003)(336012)(54906003)(36756003)(2906002)(110136005)(82740400003)(7636003)(1076003)(70206006)(4326008)(70586007)(7696005)(26005)(186003)(478600001)(40460700003)(16526019)(6286002)(86362001)(55016003)(41300700001)(36860700001)(8676002)(356005)(5660300002)(8936002)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 09:37:41.4838 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e30e7cc-0fc4-4f57-0ccc-08db036ecc91 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: DM6NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4399 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