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 0AB3FA0C4A; Tue, 13 Jul 2021 12:50:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 496224122E; Tue, 13 Jul 2021 12:50:48 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2057.outbound.protection.outlook.com [40.107.93.57]) by mails.dpdk.org (Postfix) with ESMTP id 9F3BA4122E for ; Tue, 13 Jul 2021 12:50:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZInz8zyk8XWpsnyeJzXqHL7F/ZyCVJwbQKoMo2GY1V0T2Cso4aMgTnJIbe4xOrw2akJvYhapu/18l+V+uAA0gWIQZpx3u2eN+HyMGFhnQ9LHuCrpaagNCdrFFte5yiM+HzPF+ZU+Xfq6vFX+PN2Ie5XqJgIryfeVOe/DDEQ6gyfKkxGLjADkq8sF+H/7Q1CY551TT09LSFWDNdtB1xV4AYwT6PnzUzAQtau8fmspkwGwUzDdp8ZQWBibtk0pPcN0pmuY0mYI6trmS9s0T8Vd+eSa69yBF89MeL4cCEXfux5Zhjc2bL68qv38JcgQ6pX/xqd6m8Qc3XpP+UwB9BU/Mw== 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-SenderADCheck; bh=sWembWIoepbk4h4K2aEEMGdUhra7/kdbJ8pPQvCy4dU=; b=kKaQmfALVKShhKucQYeIhyDa6gyrC4vcex7S0fMQSg7QtDzCbIf2Hj+PK9qXk3t3KU93Bhfd9sUu6JduYMzAa4LWpXz7zVQdIszaBMFQRYTTitpTGkGQmH8GhXcoC0j38PZCykUjijROjsTxMrQ5Xxcq5j4iTKPw49eQM3LxpDEsD1tVvFOGzxdRfLFS9TTOLAIDFABA1YeaREUoJOxrfdgdCqUsz7UoTZ6oebNWUBZoF9S3H+7rN7LkRpfj0DNtt9yBUeLzFvlOwsbCKf9TEMvZyU/94nH94A6roZYaORLQ3J/rG4q2NdM1MEZSsI/5UXCadqeQmeZ0tSUSLXGHqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=sWembWIoepbk4h4K2aEEMGdUhra7/kdbJ8pPQvCy4dU=; b=hAcisBsVpV4kbp+n1tVptBv/DLOq+su0b4v307h/+IuwHasI+/abpaA1LkcRwjhPQmyzFL35TRI6hJ1V8Cypkwh4ebN+2B+oqdMAowEZFOOsTcdwkoMCYz9snYzTeaRdzW0+EuyQGyaw0RwSo5Qe/TrHWdBej+D74Fm+vLUH3lH3NnOleD6Wris55o11ASbRwXI7b4GoEJzLUydtXSK36HiSxC4csDEIZbL100aqUBcMNb0YJY8OnTaqiNB0LdMg9YIcpQqFL0LuJJBEU+U9usottFjqH/oBZc976fJ1y3roMgOVZD2A3c6Lt/9035X6WHJ6yquAB5uF2Ff9leVdSA== Received: from DM5PR13CA0022.namprd13.prod.outlook.com (2603:10b6:3:23::32) by BY5PR12MB4902.namprd12.prod.outlook.com (2603:10b6:a03:1dd::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21; Tue, 13 Jul 2021 10:50:44 +0000 Received: from DM6NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:3:23:cafe::81) by DM5PR13CA0022.outlook.office365.com (2603:10b6:3:23::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.12 via Frontend Transport; Tue, 13 Jul 2021 10:50:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT020.mail.protection.outlook.com (10.13.172.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 10:50:43 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 13 Jul 2021 10:50:41 +0000 From: Rongwei Liu To: , , , , Xiaoyun Li CC: , Date: Tue, 13 Jul 2021 13:50:24 +0300 Message-ID: <20210713105024.69340-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210713105024.69340-1-rongweil@nvidia.com> References: <20210713105024.69340-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93490a8b-44fe-4b81-29d4-08d945ec106b X-MS-TrafficTypeDiagnostic: BY5PR12MB4902: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qpW7dfvdp+k8IF8xFS37pRWi0Ca7nlLqMnW8b9PsbrBe/ktET/QHL5KKy27xPZF8gXHua7dRf2BGPDsXJg368L8ZkjXTLTPOTSwcOnYTd2/Mp/SA7exENRby4+E0NAJwMOwGL2xQOrgUSTQvCEPBZU1JhZrQe8gJSNaUYWxriHZ+rHpG6fIOCZJlfADtEUOxAKcCMAHoCJRVm8YOb56AYwTNInlsyd90BkCea6AgH87GroPrJAhA3YZIldloyj5BUH7UGBlAtrg2ePuE/4Eufb3D5cmt4m/Fh0c2aJhW9EfyekULnfturwaIZNJEWjyxxxs39Nk4GM3eztA48VdRq5WV1lpR5xRE/Xv6GJJtawqKxZJzS3CjhcQCg0pCdUIe8KXmCFqVSGhAjupujjCCrcq4n2JmN8U7berOc1wJvp7GgEVoN31Qg2/nr+iFjZVV9pV6DjwdP+mpVnIO5RIwqyc8ifkLjhRlAiKdEH4od/GeHZrpfx8C1gGYo/yDTEaDsTVQIEfwsqbooOvl3v9jVyffL3i8SL5twVoJqs4CTN8grWRUUijLAVY4e5rU/SDhXNgVl9RaxCo+WdmGENJN9l42ns8FQrEf5Q09zCF9h85UOsx2bSKNHUPWfqpzGIiGLKbBd2VZ4Ul4puT0ZoZcu2fDuRSNM6csT3v5I+pW+HzWmbtvCnln9qSav5RgBmVT9i9dn/76GZwW2J/+ejJ6X5SLELPIIcTVkCHffP0ZwwY= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(346002)(376002)(136003)(396003)(39860400002)(36840700001)(46966006)(36756003)(356005)(70206006)(47076005)(82740400003)(336012)(54906003)(5660300002)(36906005)(8936002)(7636003)(478600001)(16526019)(316002)(186003)(8676002)(70586007)(86362001)(26005)(2616005)(4326008)(110136005)(83380400001)(7696005)(55016002)(36860700001)(1076003)(6286002)(426003)(82310400003)(34020700004)(107886003)(6666004)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 10:50:43.8353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93490a8b-44fe-4b81-29d4-08d945ec106b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4902 Subject: [dpdk-dev] [PATCH v6 2/2] app/testpmd: support VXLAN header last 8-bits matching 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 Sender: "dev" Add a new testpmd pattern field 'last_rsvd' that supports the last 8-bits matching of VXLAN header. The examples for the "last_rsvd" pattern field are as below: 1. ...pattern eth / ipv4 / udp / vxlan last_rsvd is 0x80 / end ... This flow will exactly match the last 8-bits to be 0x80. 2. ...pattern eth / ipv4 / udp / vxlan last_rsvd spec 0x80 vxlan mask 0x80 / end ... This flow will only match the MSB of the last 8-bits to be 1. Signed-off-by: Rongwei Liu Acked-by: Viacheslav Ovsiienko --- app/test-pmd/cmdline_flow.c | 9 +++++++++ app/test-pmd/util.c | 5 +++-- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 8fc0e1469d..3d5ab806c3 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -205,6 +205,7 @@ enum index { ITEM_SCTP_CKSUM, ITEM_VXLAN, ITEM_VXLAN_VNI, + ITEM_VXLAN_LAST_RSVD, ITEM_E_TAG, ITEM_E_TAG_GRP_ECID_B, ITEM_NVGRE, @@ -1127,6 +1128,7 @@ static const enum index item_sctp[] = { static const enum index item_vxlan[] = { ITEM_VXLAN_VNI, + ITEM_VXLAN_LAST_RSVD, ITEM_NEXT, ZERO, }; @@ -2839,6 +2841,13 @@ static const struct token token_list[] = { item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan, vni)), }, + [ITEM_VXLAN_LAST_RSVD] = { + .name = "last_rsvd", + .help = "VXLAN last reserved bits", + .next = NEXT(item_vxlan, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan, + rsvd1)), + }, [ITEM_E_TAG] = { .name = "e_tag", .help = "match E-Tag header", diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c index a9e431a8b2..59626518d5 100644 --- a/app/test-pmd/util.c +++ b/app/test-pmd/util.c @@ -266,8 +266,9 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], vx_vni = rte_be_to_cpu_32(vxlan_hdr->vx_vni); MKDUMPSTR(print_buf, buf_size, cur_len, " - VXLAN packet: packet type =%d, " - "Destination UDP port =%d, VNI = %d", - packet_type, udp_port, vx_vni >> 8); + "Destination UDP port =%d, VNI = %d, " + "last_rsvd = %d", packet_type, + udp_port, vx_vni >> 8, vx_vni & 0xff); } } MKDUMPSTR(print_buf, buf_size, cur_len, diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 33857acf54..4ca3103067 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3694,6 +3694,7 @@ This section lists supported pattern items and their attributes, if any. - ``vxlan``: match VXLAN header. - ``vni {unsigned}``: VXLAN identifier. + - ``last_rsvd {unsigned}``: VXLAN last reserved 8-bits. - ``e_tag``: match IEEE 802.1BR E-Tag header. -- 2.27.0