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 CDDD442DA0; Sat, 1 Jul 2023 11:26:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6144A410E6; Sat, 1 Jul 2023 11:26:57 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2084.outbound.protection.outlook.com [40.107.244.84]) by mails.dpdk.org (Postfix) with ESMTP id 7B725410DC for ; Sat, 1 Jul 2023 11:26:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lGekWObGoStnEtHO9k1fQBVGC4D4qTKjWUpXkhDNDKW4Cek9dWFXY7/j0yppd3nFx4hOAt2bsOfNq+b3nrIUkaTO6n6L3ELe9mxe3wZp9g0jCoq3oDJvsibGBXEL5dCObxxSWqUWsoi5MDFH/xxLU8WKqi1hjqronniC210ecTGiyMcyVuWNNtLcMn/ARdLdpaoH74AWA+tbPYxZNVemp4MSliljRNXXs7kiQhLN+TjdoRwXIettK3rGur7/BHv/mHhJ76KWNezg9UtIm/3zxyTogJAujv+496m0WV0Rk2qH6474fXuBIW9U/McazHJ/Xe7evkIcq5nYj8EjQDURXw== 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=8gKj/sm2j+Q2PwWlzCmBzSWWTzd8UtwhIVz7OlQUZmw=; b=UTbRqVopO+IiXzlHnFjRYFMzIhN+u4tPqmnz3FgztJ7htpZsHM4WdHj6hPxFBRjGtwGnkZNzSpBTxszOw2eoGiOh435EEiOBVMzD6UY0SORtHXWEhHJtUzhUnuymRXcU6OCYOC2J28yxUE+x0NRkr4KtiFUHDjtUPL4yzj+Zx/YsNitXYEc/ZktRVWdmf1ZOtrP0EbZ6ULhRKRF95SEEX8e450DK882fY4KknFdUtwuKNhdsgnbuzkbmIiG5TV10bjXmYSPRAJHo2ipgaQf6mx7AHDa4REOxMhaVL7QQCOFX3eHLfEY2usDKXzSdnfTWqV1E6SJE0EjS0X7JmmhjVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com 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=8gKj/sm2j+Q2PwWlzCmBzSWWTzd8UtwhIVz7OlQUZmw=; b=F/sk0jysK7vp0hLzuU3nDpoYrgM69gGlKWeRUJXL4J2I7PE2QVfz1qUvSXGUxqhZufrXjw0pXPjhVLhulVj2vKW+AkYwIMksLfRVOKB0C73vGeGP8DHhZzCIKH3iUeAOVfgqXg1dcbzGo5PQwGLcjKsI4ARrJ4S5ldEfua/N/cvu9j6NByUWX+cd3d+YcJeGVVNatpiglLSp0vMuAXP3Rqs34k7wwJDk5aLMXaYCCGixOpBSBNd/aIN4pUVRZP/biSSeaKQpdPEUxIuiYidtw+bpB3MClTvZ0LXfRPBisY9OPYikQY4ilUSC7O5cwkZHvuIaom8YwlsVOpL5D0Yieg== Received: from MW4PR04CA0193.namprd04.prod.outlook.com (2603:10b6:303:86::18) by PH7PR12MB7915.namprd12.prod.outlook.com (2603:10b6:510:27c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Sat, 1 Jul 2023 09:26:52 +0000 Received: from CO1NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:303:86:cafe::91) by MW4PR04CA0193.outlook.office365.com (2603:10b6:303:86::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.22 via Frontend Transport; Sat, 1 Jul 2023 09:26:51 +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 CO1NAM11FT035.mail.protection.outlook.com (10.13.175.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.43 via Frontend Transport; Sat, 1 Jul 2023 09:26:51 +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.5; Sat, 1 Jul 2023 02:26:51 -0700 Received: from nvidia.com (10.126.230.35) 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; Sat, 1 Jul 2023 02:26:49 -0700 From: Bing Zhao To: , , CC: Subject: [PATCH v2] app/testpmd: add IP length field matching Date: Sat, 1 Jul 2023 12:26:32 +0300 Message-ID: <20230701092632.439715-1-bingz@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230701014721.437572-1-bingz@nvidia.com> References: <20230701014721.437572-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] 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: CO1NAM11FT035:EE_|PH7PR12MB7915:EE_ X-MS-Office365-Filtering-Correlation-Id: 29109aca-9a90-4b21-0b00-08db7a154d91 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MmaEpA62Vr/O0XZCzkTbM00BAyauTU7uJbm+oCuudQ8nYNRiHn/8zVUBtJEI5u1wesSVvWOJ8bf7XKZUp8eRNcgUez2VDV7kKylHZcTkEVpaR3sTkj6LPNlPRh5U1VRf7bSUeXJncLE5bjw7NUY5YWhEzQLMS7Z8xrpP1Psg5hKvfBwB0zyFgILW0poQ/sDDuE2vq5dfwEKbf8C0hndoKQUnk1HSrblQhIJDiEnrJ6tyXaqiwQXiNmRLXXeCr4QePC7Ux1RslmTydYwXfgP55nE5SuuhgxUsKA4Atn/oNr6hvwh0VLTrsVE/Ic2ded5GUAV73X5nw795udYaVwF3EEeT8dvtXsCECDzlUlHI/5TkuoaxNaoR02iknYLBdoZoGkImbRIRU1qIH1USqg08lK3A1W5SINIXEO4YphHVXwTScBaeXHvapBoVwUvVCwSrVhTm5+S+Ev6ETXxi+x7IeIHY//nb1GngnwCZtpbLH8nmsnuDA+MSCGXZmaEPu9MbdolBvKDy0zjNBT/H4EpCqLIz4E32EtbgRW9LCWyV2VEcijJFcDhyB6KJ1jZ4+M3gXwfyrwfzkiUR3l4l7bcUbH0CjtW4CpF7JsN49K5ck7f+7PSEVAE4YqgrBWL92jzLdxZ68ov56TlzrJp1E9SHA2C2cNDtl8dLmrW0rPo1ZHa5FCzAPq/YymMTEsy+UOInwA00VpSEAvWoCv3i3ujEnxg5bkatB6TM3mF1debk0GIZc9P6wOYDllAtBY1qjma2 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:(13230028)(4636009)(39860400002)(376002)(396003)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(36756003)(86362001)(110136005)(70206006)(70586007)(4326008)(316002)(6666004)(478600001)(7696005)(40480700001)(55016003)(82310400005)(1076003)(2906002)(8676002)(8936002)(41300700001)(5660300002)(82740400003)(356005)(7636003)(336012)(16526019)(186003)(26005)(426003)(36860700001)(6286002)(47076005)(2616005)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2023 09:26:51.5747 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29109aca-9a90-4b21-0b00-08db7a154d91 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: CO1NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7915 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 Added support of parsing IPv4 total length and IPv6 payload length in the command line. The value of L3 length can be passed to the rte_flow API for testing. Signed-off-by: Bing Zhao --- app/test-pmd/cmdline_flow.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index bd626e2347..cc47d6cb80 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -313,6 +313,7 @@ enum index { ITEM_IPV4, ITEM_IPV4_VER_IHL, ITEM_IPV4_TOS, + ITEM_IPV4_LENGTH, ITEM_IPV4_ID, ITEM_IPV4_FRAGMENT_OFFSET, ITEM_IPV4_TTL, @@ -322,6 +323,7 @@ enum index { ITEM_IPV6, ITEM_IPV6_TC, ITEM_IPV6_FLOW, + ITEM_IPV6_LEN, ITEM_IPV6_PROTO, ITEM_IPV6_HOP, ITEM_IPV6_SRC, @@ -1604,6 +1606,7 @@ static const enum index item_vlan[] = { static const enum index item_ipv4[] = { ITEM_IPV4_VER_IHL, ITEM_IPV4_TOS, + ITEM_IPV4_LENGTH, ITEM_IPV4_ID, ITEM_IPV4_FRAGMENT_OFFSET, ITEM_IPV4_TTL, @@ -1617,6 +1620,7 @@ static const enum index item_ipv4[] = { static const enum index item_ipv6[] = { ITEM_IPV6_TC, ITEM_IPV6_FLOW, + ITEM_IPV6_LEN, ITEM_IPV6_PROTO, ITEM_IPV6_HOP, ITEM_IPV6_SRC, @@ -4229,6 +4233,14 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4, hdr.type_of_service)), }, + [ITEM_IPV4_LENGTH] = { + .name = "length", + .help = "total length", + .next = NEXT(item_ipv4, NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4, + hdr.total_length)), + }, [ITEM_IPV4_ID] = { .name = "packet_id", .help = "fragment packet id", @@ -4302,6 +4314,14 @@ static const struct token token_list[] = { hdr.vtc_flow, "\x00\x0f\xff\xff")), }, + [ITEM_IPV6_LEN] = { + .name = "length", + .help = "payload length", + .next = NEXT(item_ipv6, NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv6, + hdr.payload_len)), + }, [ITEM_IPV6_PROTO] = { .name = "proto", .help = "protocol (next header)", -- 2.34.1