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 2A4A1A0C51; Tue, 13 Jul 2021 14:09:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EFBED41257; Tue, 13 Jul 2021 14:09:45 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2050.outbound.protection.outlook.com [40.107.244.50]) by mails.dpdk.org (Postfix) with ESMTP id 65D1A410DF for ; Tue, 13 Jul 2021 14:09:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GweR+MYTAWJLl37f77uymQh6T7LoK/M20xPrsmbu+1I7ErGB7Dr/pQCu5wFwTwN3sSkxANmwllH5va59CpsiMnM0yFsfvvpX6Yjh1rkPkCZbvSRf9Jxi3BCqepAhNb+XN82NzzMlx1FFjBE/CmJusPV5jVhBv2dhc2IoaB9cg1D8FZpEQyUQ9/mbEAjVFlb1m52NBNNSwx2BqVCkUFoGjDS/OVIBiY69vBb2/5QMW7VFrfnEH6LbXhL9cJ4WtVYtYyU04EoREodcUUEtYr/kIpJikBaq/TvhXyG9jxQ4LH3Jqy3Pa1H03Yc3JADlOpTB7WHuQQeQ6M5LGI3R8f6kAA== 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=WRBC80GMefpBF4b5GHsGM+0KVfaatT0U1IjoBoGaz84=; b=ayaEahXBWQKklLVSlbFITLsPC//wNy9TCMoJN+DgJe2R5wZW0bUSlHeBEJjVHUxxpVB//xfswGxzFfTukk/JPAcPDQnWgtt2vGdPpnPEMfSkgKNYEj7mqsSIbpU+Tq82cavq1D/9jbL7GvLsX1xn4EDGP+HbP2SMZY7c5vL7ejgwsZOwqXC7yCMP7SOgD8T11SHKYfxI4EMPd4cW8MQjGB1W6TsxeXsyUhBanOoWrCLQ3defs1yrq/w62EKxELwemEbgUIGkOKWA4pzLzO532wTKyEVqXbmFghkHpJpxcOupRVIVfZ6vR1jB90YmiwHNC+UissSRx0hbeaJDt8Axww== 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=WRBC80GMefpBF4b5GHsGM+0KVfaatT0U1IjoBoGaz84=; b=rDfNMtf2o4xRX0EjPGNwmsub8YR3Zd16FH9mnlrJOofFutA02uyIavrZl7wm8rlyOVSwyk/GHhceUFptcUnensrvTYtavtKiTK6Kwc5fLTj22MLfCm9SEYyAZa/84WdGtmtC+v5ohdS/g0W4atQ/rxd6As6+Cg6q32mb88tQvMY09xsKOz2jOyfN/BP7EH0EBKAhPBmVxIqS3vw0/nR+XWpRXKaW/ynacANSCDSV6ebTzRl+xWbIB3Jp1Z4tHjr9wUdkVaPibO2qM6a4lkoI5n62KygN4Zlv2uSOP8SVuNHuVzCdssW/C1JZVItlqs5vfeCD5cShBjA/JeSxTL3r5Q== Received: from BN6PR2001CA0009.namprd20.prod.outlook.com (2603:10b6:404:b4::19) by DM5PR12MB1756.namprd12.prod.outlook.com (2603:10b6:3:108::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Tue, 13 Jul 2021 12:09:40 +0000 Received: from BN8NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:404:b4:cafe::7c) by BN6PR2001CA0009.outlook.office365.com (2603:10b6:404:b4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 12:09:40 +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 BN8NAM11FT029.mail.protection.outlook.com (10.13.177.68) 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 12:09:40 +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 12:09:37 +0000 From: Rongwei Liu To: , , , , Xiaoyun Li CC: , Date: Tue, 13 Jul 2021 15:09:20 +0300 Message-ID: <20210713120920.131354-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210713120920.131354-1-rongweil@nvidia.com> References: <20210713120920.131354-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: 565d6b00-1cd5-462b-14f9-08d945f71773 X-MS-TrafficTypeDiagnostic: DM5PR12MB1756: 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: tg58t7Q4YGS0bv0LAG2CLc2qXhmwtf0YgN+qDSKUr6rH0VgRmIJZVtKOz6y+sTxihixO5PDFRvbs7r3exAtPEm4szC6CdI/8zZEYxLp8KOPZsJZHnM5/6fyKgZG6hcey4tvGdXIIYK0V8BQ8oAdiCj/c5MJRgZ4rx9+7K62PcvqhyFNP0QIpjFtq1DY97iK/hLWuiGqbxW4vPqjbm5mxiXwtw/pnP7zDtSoSfP5jkNVFrLUqIatX8+yvESV+2ElCfuJvAD/RItoj3U08g9RoozMh2B+DHmbiY2iZbshKWuqtRmqrL5s6MaSe0Y0JgOvABjysZ+RUvElvj1NWFhg5uMJpCXS3StaCkoRHt8iuzhrLXdixR3N1IJ5jRWyjYRI06bZVgfkdTyJvhD41eGqKkySFLow/cyPd/Qz/fTwoUmUy5s0XYo9Y1G/rXODE1oCe1Sw0z/+S4Dbxup+3v3YnZ0UpYbHgWFLCb1jx+RzntLu5PmAUJlbqZw3vV/I2FHLwgwEUauGwuglDKkaGml05xeAVqOiN986J5kDtlOnDZnwoO2dSqxHRLLbM5QNGAyrjM5CT5H2ltjlr/gXU4BiLEeD/X9dYxOLVGB6DH3PWYcgx/g6Np1BrCDnN4ds5ZkC8Le7UWJvVys+Xkr21HusS/QFZPQKg+ChdXYx3/bxq3iekfGFDXzXh4g0CibUSJpM7aHpGvpEjkvu7fS71bwRgWgFhTbnRTj85hPBHrKlxtzE= 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)(136003)(396003)(39860400002)(376002)(346002)(46966006)(36840700001)(54906003)(426003)(107886003)(70586007)(478600001)(110136005)(70206006)(26005)(47076005)(7696005)(5660300002)(83380400001)(36756003)(4326008)(86362001)(336012)(8676002)(8936002)(6286002)(356005)(36906005)(316002)(2616005)(1076003)(55016002)(7636003)(82740400003)(82310400003)(36860700001)(34020700004)(2906002)(16526019)(186003)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 12:09:40.0353 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 565d6b00-1cd5-462b-14f9-08d945f71773 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: BN8NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1756 Subject: [dpdk-dev] [PATCH v7 2/2] app/testpmd: support matching the reserved filed for VXLAN 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 | 10 ++++++++++ app/test-pmd/util.c | 5 +++-- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 8fc0e1469d..58c6f8151c 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,14 @@ 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(COMMON_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