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 EE982427E7; Tue, 28 Mar 2023 14:28:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CEBA540EDF; Tue, 28 Mar 2023 14:28:15 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2083.outbound.protection.outlook.com [40.107.92.83]) by mails.dpdk.org (Postfix) with ESMTP id 6FAC140156 for ; Tue, 28 Mar 2023 14:28:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R3F0/Zv0+UdCiRE8hDwNgkvY3iCemDtc23PFVbNUSz5JeSLLujUh3ERIHtrTKLUAzWFcnpLbWtew9ehcLjUYeKulc/BAASsygTaJMIfpU3fu0SYa5qSGkciE4jmX5VRa+r9ZmvYdFqG8VnluyTfPfsne6ISxGDDQY50yx4GzLHDNT4pllJj6a6E+4AzvnPShIIH9skqiV9XhEbwUJPqQzC7pZQznHVrVWDrUT4iPOUZZXrrZ/engDfigf+83MTMgoeziOlGLCazdt8ZlmCyela9EzPT/bBKy/u7UjjUulFpczGHTZ+uulnvfIFI145E4wIprmpWwvDHmPuR0J3MMag== 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=y76icRbYTETbuMXdLWoASe2nMTXHzotNv46sPdisMwA=; b=mlxR4YNwHQSrHnZsxaQ07Hr9lEFV0mgII0Q7EL1DvJDvHijz7Qq8jgVuWlaXGffXtd/wDkyonZbytfei0wLJjEkhRPNNNy/KXTw+tx/uFY2agB+CVO2CPT0EPOlybogBhcssrl8S1TNc9dq4/QnWXAWfEijkAxeXgpBqXSAWqmunM1iJLlvBySoJSPWiZQ3nNesXkbKTFvnupfzunteg+pExrD+JpNZdl8BUzr6zCgzPLRjxvwkFa7tM2YGRhPlP3u+oXECE0gkiSC7YitOw1tt5ZQFc2qtOAQkFxozhptlwLmjnYBXpcPU+C3GYp5kSF3SJbUmhwV1VMkt7ZlLBsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=y76icRbYTETbuMXdLWoASe2nMTXHzotNv46sPdisMwA=; b=HA1K462kLZnif3uMNHdT+nvl6tAHtxBee+VusZ3Y3sBMP680yJYUjmGuAQZ6Nl0brqXjVA5SN2Gs53TubOQk3JSZZpAFCZymWes0E1EJ9bBB33Sht5ervR9kB9GKxf5Y14yQpAxUQpDErOro1ja4RjSvVt6IH2Kpj+SSJg7+kZF4AeKBg2WckbNLKmBn/4WpU9q3Stl4FN5RTv1ISREhpjAYb/DyR2EjICcc4GBr/1RG5iUngiy8X2O/XMMRde/kuSVgUjM+n9ogJO4xSWWxdONmMxYjAqYq7TNIttxxV55hCxdbOc9iNcY0jZ0/BqxYU/l1WBVLIgiw72624YFCmQ== Received: from MW4PR04CA0289.namprd04.prod.outlook.com (2603:10b6:303:89::24) by MN0PR12MB6271.namprd12.prod.outlook.com (2603:10b6:208:3c1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.31; Tue, 28 Mar 2023 12:28:11 +0000 Received: from CO1NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::79) by MW4PR04CA0289.outlook.office365.com (2603:10b6:303:89::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.43 via Frontend Transport; Tue, 28 Mar 2023 12:28:10 +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 CO1NAM11FT016.mail.protection.outlook.com (10.13.175.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.22 via Frontend Transport; Tue, 28 Mar 2023 12:28:10 +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.5; Tue, 28 Mar 2023 05:27:57 -0700 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.37; Tue, 28 Mar 2023 05:27:54 -0700 From: Rongwei Liu To: , , , , CC: Aman Singh , Yuying Zhang , Olivier Matz Subject: [PATCH v2] app/testpmd: set srv6 header without any TLV Date: Tue, 28 Mar 2023 15:27:42 +0300 Message-ID: <20230328122742.738048-1-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <10910654.BaYr0rKQ5T@thomas> References: <10910654.BaYr0rKQ5T@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT016:EE_|MN0PR12MB6271:EE_ X-MS-Office365-Filtering-Correlation-Id: e2af74ee-44e9-4283-51a5-08db2f87e4b4 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: DqIAzwLVg/aNVU+Eaqrc7VHBYbehtlFE7J7hTXfwkWZYf1Yqz0eVH3cSlJ8id9ezM961smO5F+ZssCxQj8GxI5olzjHd9/wBAJD24EmnOBW/8wKO8vsd5Wp0fY40Cvb4fFsGBAuz15Eqcljw7HRWM2Q19Yh+35yEnWDmBFnpDSXXRzd/bHbBkNxUVsTPP58xGa+QAWmXoWXMcEw+/TSos6DAMwMkzi5yxzpUqBD711113IR52lfG7eph/rmjHq5gveYW6SLyicRBlOjHY2bQbNXRFrJV5ojBYPyilPzfqKVqh5k0bp0Br8LoYNHwEY6gCqT2WAdCJmzz7I7Ml1H8yVrDP8bndwYd0GLLeTKDvDVh9vwViQ27kw6o0urFQ6TcGgYlVHQZTsecuN7nEVv1DXx6gwkUlTh1ZbHskGjePHqX68dk7rupU7rPvEwQsD1gfcxqwQiYpqEsdPA7w2HYCXp+kCHJMJX92RN3IdDeXMmI1xcWYH10S973ZW3tXT2ASDQCv4UpmPcAtQdnq95GWIsANd3o4S3VttUNcxWqsqXfLz/YWFz2SRnAyUDO8afsDhyl4dspM1sMk5ZCV+s8Gsk+jyYZRCol4Hv6DEgdS0Lr5vTQlwzPOrcMRt4KJFs0+ps+aUeOvOUcX6M+gwU/fJQGP95AAHI/vZANEDKYzVc0+mgEO5e+D44g+9MmpZMpn5GcMnzfWn6ntrO5PgxtlqhO6LRe3v8PP+d+ZdUFFhhWLOU26hqvf0085wsujWAbc2jHYDBdmrjJhbwyz+aRE4Pe7ix8xqQzQYXWEl6uYcc= 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:(13230028)(4636009)(396003)(346002)(136003)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(2906002)(40480700001)(82310400005)(86362001)(36756003)(40460700003)(478600001)(426003)(6666004)(336012)(2616005)(8676002)(7696005)(47076005)(55016003)(110136005)(54906003)(70206006)(70586007)(4326008)(36860700001)(316002)(34020700004)(5660300002)(26005)(16526019)(6286002)(7636003)(186003)(356005)(1076003)(82740400003)(8936002)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2023 12:28:10.6232 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2af74ee-44e9-4283-51a5-08db2f87e4b4 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: CO1NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6271 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 When the type field of the IPv6 routing extension is 4, it means segment routing header. In this case, set the last_entry to be segment_left minus 1 if the user doesn't specify the header length explicitly. Signed-off-by: Rongwei Liu v2: add macro definition for segment routing header. --- app/test-pmd/cmdline_flow.c | 3 +++ lib/net/rte_ip.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 5fbc450849..09f417b76e 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -12817,6 +12817,9 @@ cmd_set_raw_parsed(const struct buffer *in) size = sizeof(struct rte_ipv6_routing_ext) + (ext->hdr.segments_left << 4); ext->hdr.hdr_len = ext->hdr.segments_left << 1; + /* Srv6 without TLV. */ + if (ext->hdr.type == RTE_IPV6_SRCRT_TYPE_4) + ext->hdr.last_entry = ext->hdr.segments_left - 1; } else { size = sizeof(struct rte_ipv6_routing_ext) + (ext->hdr.hdr_len << 3); diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h index 337fad15d7..cfdbfb86ba 100644 --- a/lib/net/rte_ip.h +++ b/lib/net/rte_ip.h @@ -540,6 +540,9 @@ struct rte_ipv6_hdr { uint8_t dst_addr[16]; /**< IP address of destination host(s). */ } __rte_packed; +/* IPv6 routing extension type definition. */ +#define RTE_IPV6_SRCRT_TYPE_4 4 + /** * IPv6 Routing Extension Header */ -- 2.27.0