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 A031DA034C; Wed, 21 Dec 2022 09:44:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1B0740A7F; Wed, 21 Dec 2022 09:43:49 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2082.outbound.protection.outlook.com [40.107.101.82]) by mails.dpdk.org (Postfix) with ESMTP id AC00F42D15 for ; Wed, 21 Dec 2022 09:43:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P5vV57gqltJkReSZeqVyMCNIasRD0CMNy+CVLjEZmpXBHpMhNzF2LnULZ7PIhnoP5rAz4XkKnt0GfqDvE5yBORKI1H6pY/Ixnaf1FQViY/qriapI2sMq/dZLZ57Yeu9KmdAmMjLbd6o8WnhfmyF49nArquXTCJgV9mfHxum1PmjFEpLO3lrF8im5jPCpeXaXVIYTPqMjeBxd6zfh/9mnU8816Tz2rUzSReuN102qSBLZmLqatq5yCzt0HwzOjQDMWU2kRqko0nzIdvDjJQdL5QQ8blF92l37nPXyhSWra4cmU5SUASudJU7nRyGKd7VCOwdZ98AQHPiL+OihL74n0A== 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=gUDIIUSEdIE0VVTtJRueKhEJGgbotwwcRlsE0+ckcb8=; b=RXBSZ09/LaNghBHnaDkp0KBv6MgAUBgzUuE0wkxJ4DgUz37zj9yNcJTXSuUiGuc1DTCBGjn/e1PT58Zd45wz9dLxklYGgKFCy1U7TYfT4K4z0ZJdUi9WCamNokKVlzx6WKkBDA6yEfjfLY63LxaV2tlEb5zLyKxtvAUbVRIXBylslfgB8mgJOJvXcx28sRZA10i3Uc8nCVuyhnVSpcmU3SSgjdzsdyN4gRTk4kkkqjc5g7Fg+QmBoHh6hdygEJO03GL8ZfWUUrNQAtMULIkn4Fmm6yAafaOax2a4dqKDKh83UhNWTnvpMZSe1ohrN0stvEq4G5gEu/Ux53qoSCPEZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=gUDIIUSEdIE0VVTtJRueKhEJGgbotwwcRlsE0+ckcb8=; b=WmWTngbkdTqykZz8qoApFo7oxEpR4qBW2syp9R5/Q8JYJ9IFT4bVPgkYRrbS7PEbw/TbkSVvTek79A8axHPlhzsp4h38aSH7mNn7wKDhMgsYdBuvTCglz4Csh1LPZha8jWyBdfcdRgBvKTz6Gsos6wj/777W1GdTEwVzq3lRqvjjXXso6DyWG+tSSyC0gfiQhK9BpiUVi41GcgCxMr6e28MJvgxi2KXS63QQ+bm6mE8fv6xrp1Yvl5LwMqAlPRzrXkItQHrUAvZwP//Ksi5TP05ToAG8OUO8GuCdDlF9b+yORqs/kCy6ZuKsjPANtEB0/ZPS9T5/PPSdvOANEGQ11w== Received: from DM6PR05CA0057.namprd05.prod.outlook.com (2603:10b6:5:335::26) by BL0PR12MB4993.namprd12.prod.outlook.com (2603:10b6:208:17e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Wed, 21 Dec 2022 08:43:46 +0000 Received: from DM6NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:5:335:cafe::2e) by DM6PR05CA0057.outlook.office365.com (2603:10b6:5:335::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.5 via Frontend Transport; Wed, 21 Dec 2022 08:43:45 +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 DM6NAM11FT015.mail.protection.outlook.com (10.13.172.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.10 via Frontend Transport; Wed, 21 Dec 2022 08:43:45 +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; Wed, 21 Dec 2022 00:43:37 -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; Wed, 21 Dec 2022 00:43:34 -0800 From: Rongwei Liu To: , , , , Aman Singh , Yuying Zhang CC: , Subject: [RFC 6/9] app/testpmd: add IPv6 routing extension header in raw encap Date: Wed, 21 Dec 2022 10:43:01 +0200 Message-ID: <20221221084304.3680690-7-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221221084304.3680690-1-rongweil@nvidia.com> References: <20221221084304.3680690-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: DM6NAM11FT015:EE_|BL0PR12MB4993:EE_ X-MS-Office365-Filtering-Correlation-Id: 83f2ea85-1751-480f-6c1a-08dae32f78eb 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: IReHsMBE4te1OrYcJBExXggQExdU6S/XQJRegGIIzEPTw0A8+GyS7AFLBQTjToagyKzEphAq3xKNR0oIeWBnc0yn+56FnImCoepaJGFxM0X+soO6ngr7PhjL7iQAXNY9BIyDCARLvRj7I7WfUtm/ZvMBrO0FcOz0gjyNHG4Gbx/kW85fBUewFk/YDBx0NCeh+wJ20WO9ctnlE2tbqWyA9z6o7NxU1Syw1Nd1U/f2gFMvakqmTHes6wxWdYnvg5eHYM60MLQWzTlfDRGH58uHEzvtCZDZBE2yRdWEB6JD4YeLOhXKlHdmFwkS0LM4yvMWamLxF62We8dp3RhMnYU+GJUa5x1KyxmFB3Xo5cZ6Fpt1Srnt3++ifYuTqmoN00VzKHPwibFvxg2uZOH46KkH1egVmjpYXwP2ogCxz3BsPV0IDwQv3n43hf1LI3RI3fg6c8eSizN5OZPEP3rYVVJhTwZT/q93L3paYpAY8kWaqCII1WOFZo6cCLcFwhrqTJ949p0zOQK9o702z4X/mryeHw4qu9EM0VK7OxW0kC6lwQbe5vigcG1SyOx960QnUsRPX4d94QAXONxbym6EuWFmoMrYuPVnngrrAju6FTztTPJVSM6L/RXm5EzLMUm+Vl+GiquL3SgIFmU4bcepAqro9sP2pSya0s4vlbSKs7oVT+k= 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:(13230022)(4636009)(346002)(396003)(136003)(376002)(39860400002)(451199015)(46966006)(36840700001)(41300700001)(82310400005)(8676002)(4326008)(336012)(2906002)(1076003)(36756003)(36860700001)(426003)(5660300002)(8936002)(47076005)(82740400003)(356005)(7636003)(7696005)(6666004)(107886003)(478600001)(40480700001)(55016003)(26005)(54906003)(110136005)(316002)(70586007)(2616005)(86362001)(186003)(70206006)(16526019)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 08:43:45.6446 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83f2ea85-1751-480f-6c1a-08dae32f78eb 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: DM6NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4993 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 --- app/test-pmd/cmdline_flow.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 70685aafb1..24fdb260e9 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -10920,6 +10920,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 = { + .nexthdr = 0xff, + .type = 0xff, + .segments_left = 0xff, + }, + }; switch (item->type) { case RTE_FLOW_ITEM_TYPE_ANY: @@ -11022,6 +11029,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; } @@ -11176,6 +11186,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) @@ -11196,6 +11207,12 @@ 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; + size = sizeof(struct rte_ipv6_routing_ext) + (ext->hdr.segments_left << 4); + ext->hdr.hdrlen = ext->hdr.segments_left << 1; + proto = IPPROTO_ROUTING; + break; case RTE_FLOW_ITEM_TYPE_UDP: size = sizeof(struct rte_udp_hdr); proto = 0x11; -- 2.27.0