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 37A0D423CB; Thu, 19 Jan 2023 04:13:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 982E942DA4; Thu, 19 Jan 2023 04:12:33 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2086.outbound.protection.outlook.com [40.107.237.86]) by mails.dpdk.org (Postfix) with ESMTP id 7CF4242D98 for ; Thu, 19 Jan 2023 04:12:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F4u4Y3T+UKHnI+rWTID2q6W9RjcNQ4gd3h/LP8867qpz6KXnCjtgE+uBM98UUvy0wX3FsWlD0KnZRDT6MRUrKGGIQndJDiOjS+67toYOThiGC7E4C/GkfJWA11/cu/gyZPqZIaVeEAkrWf3iZXpVbcnYWy/O4cZP+dhgMfIuCG3a2pzmsd1KMOcYsM3+h79C0JEsOIZasnl5z6SwBxjrBIY60b4gtfpGTW0bLLFPCS/wGlAYjeiguGHycY/0OwblXT054M+DyYb0sFqyDQpFmOS31BgHt0gN8whKVlUn4nab9R8X4ioMFnsUNFkKq95MZZmEu0L8cfommPakCmNmug== 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=55zOevxELXKd9B2qyxyjUDv26tJ02MAxeiUdExV+ASQ=; b=mar4w6m9nKBxErC1Aqxl2+G7UEKDsJYNfPKOHMUP7KFFE78GJHp81YDkNQrLiLGUMmk6t5xxNzfPde0h0utfhKv/GK/AW0yqJiop+w9UZAEsLzcFiG8/Ia8rBX49gjfXlJGUfVptChOiaFm+EDOElp85zbF5/KpLPPznh5Hci4PjDN8FK0L2QlQdC29sCMa+PDiYcN2ZtiXiYYOfemA3CgFSBvSMJwXujih359ifD9JtEBowussmRue3CSnKxLl+cbbt3jJodOrvJkUOVxvQ1Hz+b+6ZO02jjlrqBIFkSJZ8VAabVyM+Uw4PX4VnlYYESO+gRyKykOVvVRpOF9rZ3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=55zOevxELXKd9B2qyxyjUDv26tJ02MAxeiUdExV+ASQ=; b=LAcWpknJsTsX7rjcQCE+E5S2R6maarkyIN6pzyGl0ES/POQHTQXtYGy3RzAndUMraPIb+/L6rnrqBWTh1sTEq3fFNkChK1QXPw1Pl6QI90Nk6DXzhnfDo3fE1j240WScNiInSfJHarTHRjE61hQnKCw/oI/nyt+HzMFByXm+DyAR8xi4QckZqBPXMaQy5xGwq0qINOG91ypCnNKihsr2Xcj5y9oF+A+1IQlBTMd4tm+rA8jBOjbqpsL/63h7GuvNKWRs3tg2hUdF8KRjSvPyD10qx5hvdJP4VGl7drz9yEQGmTOFpT/fICd3UhwOePlh9ESql2uCMKkGmu+fPmjvHg== Received: from BN9PR03CA0536.namprd03.prod.outlook.com (2603:10b6:408:131::31) by MW4PR12MB6876.namprd12.prod.outlook.com (2603:10b6:303:208::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Thu, 19 Jan 2023 03:12:28 +0000 Received: from BN8NAM11FT061.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::90) by BN9PR03CA0536.outlook.office365.com (2603:10b6:408:131::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Thu, 19 Jan 2023 03:12:28 +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 BN8NAM11FT061.mail.protection.outlook.com (10.13.177.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.24 via Frontend Transport; Thu, 19 Jan 2023 03:12:28 +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, 18 Jan 2023 19:12:09 -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, 18 Jan 2023 19:12:06 -0800 From: Rongwei Liu To: , , , , Aman Singh , Yuying Zhang CC: , Subject: [PATCH v2 5/8] app/testpmd: add IPv6 routing extension header in raw encap Date: Thu, 19 Jan 2023 05:11:36 +0200 Message-ID: <20230119031139.621217-6-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230119031139.621217-1-rongweil@nvidia.com> References: <20221221084304.3680690-2-rongweil@nvidia.com> <20230119031139.621217-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: BN8NAM11FT061:EE_|MW4PR12MB6876:EE_ X-MS-Office365-Filtering-Correlation-Id: 871ae720-dc42-411a-c650-08daf9cafeef 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: waextYG1JwCLqCDgu25bCXIFcnw0l+lWqUR18yZjtdpYd86f8dQylXwo5aOPBZmSDwt+ochn3HtDzKClplQ5CRAOzKqa23CLGfV9VVlB84sOT5kRXyadatyL+o88FnoZ6YqBtHB0/SvRv9eVJqF3GisiDiIzgrC3NQ8y5H2Nr+JDLtAk7gdtAj0u3Y7PeVPCrf3m4fHejwsV0WxlSI1M22Sc1iP/IMsQ1c7uIqdn1gowsvQlKv2RFydeLowMqGDLkuSJ0WYmty3HFHUp2a+3+3VWIErUeM1c3vV/oqsHtSa+6FMNK/8R/dkC4cUpasXTbUkfhg5NozUJn3G+80rw+hdC2JD4mD/7T5SHbLJO8mB7atU3XCw113AFJNicrjR5n7lM5x+ONYAqpD6kT3DWr5vKWC3ziDKGQPOMOulpE23dwnmHj93JQggX609Ujetkp3VyXzfQ49CGMgmWOwKVBCh955rDFo5kJUPFrqFmHNfLsMZU3lAOvkHgtWZHl19we59eJii8PR7ujmhlNaseVoEUPbEPmhQv8Uezp1h5FxRMhzwpvojOQ6vroqSPiBQaYK8WxRi1lXtD/dk5BUwoNZhPUvOgOwdn3tQ5hQsEGhQIAbIyq8ADMBpSOTGwdSxuX0LOdwAn+coY3uq0Sr7gBAO9zFSXMsmsmytPniQlhh3Xaj4W7qkX5gZlnplLkcQ+5Jnm0d83MB9EUe6OdpJmHA== 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:(13230022)(4636009)(39860400002)(376002)(346002)(396003)(136003)(451199015)(36840700001)(46966006)(40470700004)(82310400005)(4326008)(8676002)(70586007)(70206006)(36860700001)(86362001)(316002)(110136005)(54906003)(8936002)(41300700001)(5660300002)(36756003)(7696005)(2906002)(2616005)(1076003)(336012)(426003)(40480700001)(55016003)(40460700003)(82740400003)(47076005)(7636003)(6286002)(356005)(6666004)(26005)(478600001)(107886003)(16526019)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 03:12:28.0152 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 871ae720-dc42-411a-c650-08daf9cafeef 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: BN8NAM11FT061.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6876 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 7a8516829c..4bdb46e89a 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -10925,6 +10925,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: @@ -11027,6 +11034,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; } @@ -11181,6 +11191,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) @@ -11201,6 +11212,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