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 AD88A424B9; Mon, 30 Jan 2023 05:00:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 43BEF42D2C; Mon, 30 Jan 2023 05:00:30 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2045.outbound.protection.outlook.com [40.107.237.45]) by mails.dpdk.org (Postfix) with ESMTP id 1AF4642D30 for ; Mon, 30 Jan 2023 05:00:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XiaFyeyVwob2yAqm6By2ncvGYQS9FkzROQoH1fnywWP0FP163c2M7B9JLTsQz27BDmyz2geDwCInUiwrvDHs61rkBkrtQLs5/UQi47Yd8bQAiHe9rm7TichV4vnXevRYwFCBFoejSh1oTZSMvhYKjsHKvNB47ilFt/GgshLOdnem55CS5x/7dRw31F7GjGJoEVJqg1QBPDcQCErK8qcViAwIFJFtpQSwdU+jvvTbFjU7ohreABBHk4ueIbnFrszw7ciL5S1uMCfsZ1VyjBeeNNEKhABUFtMG11xgELnarsFgFX4pc4QSMTuEIRGh/9VXHWnOMo/mkNKYY9Jmt0ZaEg== 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=D9wltlkE/OgHBUUp0Vzav//nQPUkWioBcVj4q1bER4S3D237S1VMZKRYsdZudHqQwJltyuPt5TB5oc/P51Qf/6EvjW75x2AKSvFcWBPxHbFBrH3i6U3/gIGuFUIZJ8IoZv17WEevOKXALR3CiV1oaKbrXAWGo+Xtk1oahPU4DVh97sTnmD2wH08m2fhP12FD4wct6WR2VF6MBpasp+QKrMzErhfduxpRDeED1IP1vbFJ87tdsu9r84BZe1D6j6VxAie8yxJHGm1NP46IbqCI2jbvWjPvwU24E4vY/dSXzAyJNXVYnOawECtidWnAeHgCuye72X5X7KamengevCnBDA== 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=BvvL2ikXenbl66Ktfga97/Ss/Ln+csrZ0nKOumtI0VuSXmUtL8+O2AKoZ6BNpPOW2JgcXtUgAFHXzaEmDwm82fYHvSKAeyTFAbRbFJSlXm3c/t8jf76fLTznwsJfACnEm0wZsfVhlzDG/q3Fc79XIshSjwCt4d1zZgSk/nbbEih4vcICAo3at4Bk3nFznexmgqp249R2HIxtLyOJ/cLnVgB1nKNeIOyebYWuRy4zqHwvZNTr5Axh4tvSMetLnNFqu6l3Rm7f/k2k6qok303kASvWLw+p5mQj6Ol4zOAdq4xtuo5roSIs7dAEvZ+rrVy5L/KEAq2fAGvST49n1/qvVA== Received: from CY5P221CA0002.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:b::30) by DS0PR12MB8217.namprd12.prod.outlook.com (2603:10b6:8:f1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.33; Mon, 30 Jan 2023 04:00:26 +0000 Received: from CY4PEPF0000C964.namprd02.prod.outlook.com (2603:10b6:930:b:cafe::88) by CY5P221CA0002.outlook.office365.com (2603:10b6:930:b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 04:00:26 +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 CY4PEPF0000C964.mail.protection.outlook.com (10.167.241.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.17 via Frontend Transport; Mon, 30 Jan 2023 04:00:25 +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; Sun, 29 Jan 2023 20:00:10 -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; Sun, 29 Jan 2023 20:00:07 -0800 From: Rongwei Liu To: , , , , Aman Singh , Yuying Zhang CC: , Subject: [PATCH v3 5/8] app/testpmd: add IPv6 routing extension header in raw encap Date: Mon, 30 Jan 2023 05:59:37 +0200 Message-ID: <20230130035941.1495874-6-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230130035941.1495874-1-rongweil@nvidia.com> References: <5da6632a-0976-dc1f-facb-f778c8aad8e6@oktetlabs.ru> <20230130035941.1495874-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: CY4PEPF0000C964:EE_|DS0PR12MB8217:EE_ X-MS-Office365-Filtering-Correlation-Id: ab579b8f-e8eb-4dae-b02f-08db0276848b 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: Ac4GRhPnWLhltgr5WZ1KXFdvMATsZXAFShjUquTD16TqkLQALpYYrRRyTwMnRqojq7Y3qnBxZKeoBTYmz0zvSaW9wxCmkZw1YztAZIKk8R7MV+kDjzJK3negm0RbDDY25CQVJPPz5eF5FwwQGICaiOecHhPiA5g4WyxcgJ32Hn9TiM+WmbW257DasQeslGc0BKHeKo1HmVuwDo01wleaoL0tOgUXSYNJyIyV8gdtUGZIx+2vBZWw+Mu+7mwb7vSaxrrtqDmqwomMnCo8U+irm0c3abfkf5uiHQYp/AD+GQqzLfas3WB9qOlfyCyC0hTcIcreC+K53UGDcsCG21IslpO6zWbiDVhbRXY3NQIcoDREu8ETHa150GWlrM9hDFwNSoWvX3adw1NDxAqAvttCTPONLqfUNzONVrWvlwHQ9cm6fVzf3gXc8EGr2UiDgRyVcszfgnB4YalidvdXs62sUOQ+wWORINvlP3vKhBqzeXRf2jxzuODPL/fDHwpWpSuuXnII8LSYSDC/5Tl9MhHItyGeFN6owRN0rXqsW0TI9RdFwVgxQ2OMHLvIUZ7wS+HDauL0RnTmCXGTwxAFKFThg1H+sbuM+OlYVbOGs65N6vXu3Z2zhJd0GevNF0nIavIMvF46qnuEYHOmIyENRYRl1m39ysH7yO1o7nIIBabdrBe9GXySGVWz9Yncz5EhfJL8+1MngLIUFi8Oz+tn1ec8zw== 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)(39860400002)(136003)(346002)(376002)(396003)(451199018)(46966006)(40470700004)(36840700001)(336012)(70586007)(2616005)(70206006)(4326008)(7636003)(82740400003)(82310400005)(40460700003)(36860700001)(36756003)(86362001)(54906003)(110136005)(316002)(356005)(55016003)(40480700001)(5660300002)(2906002)(426003)(8936002)(8676002)(41300700001)(47076005)(26005)(478600001)(16526019)(186003)(6666004)(1076003)(107886003)(7696005)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 04:00:25.5106 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab579b8f-e8eb-4dae-b02f-08db0276848b 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: CY4PEPF0000C964.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8217 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