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 407AAA0524; Sun, 11 Apr 2021 19:34:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A53314141B; Sun, 11 Apr 2021 19:34:43 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2060.outbound.protection.outlook.com [40.107.93.60]) by mails.dpdk.org (Postfix) with ESMTP id B0C02141419 for ; Sun, 11 Apr 2021 19:34:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LLFlAWa5m4qplwTMxnfTqfky0awjj9ULFBQTOZLKPNHFMiOEcpwJKOfvjfmiMsraK8Kea4l9TDS2gXIUOQiRRQnnE9Td/ZEo1D/mmGMCGdq0noLOVb8/jB7AlVgEgoUV7qKP1ZFphngiLM8kbDN+UZDZg86NrmPrAKuwZN6eA5DC6KLOL3AaA0U8Yx2GP3MgtgA2W9+3SUdzgxy+d7a85zjCTCgDW9cOuMqhyKbTi5Cpz+onOwnUbN4P3bOT6VcYeKotSEpafxfTLQ88lPuzzwcAJFaTKCKlYjI7VNSVTJ/RDO7pBgXd2JZr+Ie8O9lGp41bfhaxFURjv2aNHEn7nA== 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=LpR9C5ZF+Go3LdYFT2Q0u7eNUyNOR2JlSfan5yb9MCM=; b=lkYIRJN737EMvVFsNG9/2LpRTZLurnhkfbuy0lEsd8K5ej6pB9fvW6fSpZd+9hy8YOK7EjqC6oK4sJe8gxAjMKQyE7bfzy0l71JOQArbTyCibvrCvWaXPl+//H+tZlkdZ0i1CMf7gK4ftUFEf4IqoBfCZHV7UZGFu40ahBz1Hc9QtmNkfMoDBwO0pMfoM6uENsNYfPpfjGjH+3tpa4w7SfqYMBHt6diSY4VtMPQBOXClz4tVl3+rV5m1IBmVf9UTus/oo1q5GTsO1G0Jv+AoSNWqNBzeARunNOGDHr6b0ukER71wJvSrP93TdDHC9Lrn1Tyy1+/j7KC3V84DeT5pbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=6wind.com 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=LpR9C5ZF+Go3LdYFT2Q0u7eNUyNOR2JlSfan5yb9MCM=; b=nVNkICc9jOqnnNQIl8py9crtUntONWPsYJNwsAI0SXCheujMWZgaCZJ1f9OV4i8lH2bMwz/GbWpZxt3Y83LDAPuJXePx3FeYXz/uwgrPV23bANk5kUT/pvv1w/5ralRrDf+54JXZg1q7XON5hGybeVRTwrYwjx/Rt2CkwPxmBrBLdyZD2FiEAlsbhpnw2FXZ02MftMUaY0PNkMZCZhH/4Anltri7ULaEmSIY+dCMAyxi6ZkNWWR1U0ms4GZtKB9Dp4CMGYIOP+uqpOkwusaI289/jHMKVxupQxwg5qRjNoNM6qSiHNBjzxRHcBDcTSl9rGTNsV8YMOPcfGIgxkY5zQ== Received: from MW4PR04CA0153.namprd04.prod.outlook.com (2603:10b6:303:85::8) by BN7PR12MB2644.namprd12.prod.outlook.com (2603:10b6:408:2d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.21; Sun, 11 Apr 2021 17:34:39 +0000 Received: from CO1NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:303:85:cafe::64) by MW4PR04CA0153.outlook.office365.com (2603:10b6:303:85::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.19 via Frontend Transport; Sun, 11 Apr 2021 17:34:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; 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 CO1NAM11FT034.mail.protection.outlook.com (10.13.174.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4020.17 via Frontend Transport; Sun, 11 Apr 2021 17:34:38 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 11 Apr 2021 17:34:35 +0000 From: Gregory Etelson To: CC: , , , , , , , , Xiaoyun Li Date: Sun, 11 Apr 2021 20:34:14 +0300 Message-ID: <20210411173414.12568-3-getelson@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210411173414.12568-1-getelson@nvidia.com> References: <1617645874-105139-1-git-send-email-orika@nvidia.com> <20210411173414.12568-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] 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: 67d4905a-ec15-498e-f57e-08d8fd1014db X-MS-TrafficTypeDiagnostic: BN7PR12MB2644: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-Transport-Forked: True X-MS-Oob-TLC-OOBClassifiers: OLM:1148; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O+KklIunz6lZhC+oj1qJ5Yd2syu2SAnjckrXMloZRn6kges8F80lrshqZa2Bg1sRemDdUyF74bUowVX19ILM68hHuq4CbLdzYFvjh2c43pffivvaomigB7yhjMYyWRxkc+Vy3n+9xLI/DyoQGsAqHUqpq9CE0iixcfvTzLR1RRBMGNSSvFqXprBTKugLYsgOIcuUm24/nuhxgKPI7hM13/Ng5xNkoAc8i9WvijkKLQ18moWs81KQAMvAKxvxMsMfljPy8xBunjYmnhgviEoW8k5wvTszhoo7X+9eNHWQmn59GhNpyyS6+aYOJpMeFtXgY4lq5W1ZHVO03xrTFk0SBW0wKvO/kkNVoC0IP8sAhfmO22+c89CYVAjC67NsFi2I3YOq+o/DDnhXVO3q2ZdTGDI7MokmDVxbjwE3tr3onR+ttGOgmWuN1YDzr/jmZD700FgGgdgYqV4wQIZUuy0YF+NC59u7wAJWkwmC48w1iLsJ/9Yn8fGhUgJ0fSZ8pW7cbQHKMQJzpUKqWJDchw7T73ZZwncDiitygKF3zNf9AuCsph/Z0J+KYdaQnRqsbYbPcqDOFst3TMgcioRiD9+BsveusJNfV/tmGm/6s4VeBXv2IjGaZjMjXmz+bHA/TCSrWTaT4RI7dct2xemwoS+WjCFyKX+ELewRrD+503Q5R1M= 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)(39860400002)(396003)(346002)(136003)(376002)(36840700001)(46966006)(37006003)(54906003)(36860700001)(7696005)(2616005)(426003)(2906002)(47076005)(82310400003)(83380400001)(336012)(316002)(36906005)(70206006)(6636002)(4326008)(8936002)(70586007)(1076003)(6666004)(5660300002)(36756003)(82740400003)(6286002)(8676002)(478600001)(6862004)(186003)(86362001)(26005)(55016002)(7636003)(356005)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2021 17:34:38.3199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67d4905a-ec15-498e-f57e-08d8fd1014db 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: CO1NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2644 Subject: [dpdk-dev] [PATCH v2 2/2] app/testpmd: add support for integrity item 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" From: Ori Kam The integrity item allows the application to match on the integrity of a packet. use example: match that packet integrity checks are ok. The checks depend on packet layers. For example ICMP packet will not check L4 level. flow create 0 ingress pattern integrity value mask 0x01 value spec 0x01 match that L4 packet is ok - check L2 & L3 & L4 layers: flow create 0 ingress pattern integrity value mask 0xfe value spec 0xfe Signed-off-by: Ori Kam Signed-off-by: Gregory Etelson --- v2 add testpmd patch --- app/test-pmd/cmdline_flow.c | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index fb7a3a8bd3..b5dec34325 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -289,6 +289,9 @@ enum index { ITEM_GENEVE_OPT_TYPE, ITEM_GENEVE_OPT_LENGTH, ITEM_GENEVE_OPT_DATA, + ITEM_INTEGRITY, + ITEM_INTEGRITY_LEVEL, + ITEM_INTEGRITY_VALUE, /* Validate/create actions. */ ACTIONS, @@ -956,6 +959,7 @@ static const enum index next_item[] = { ITEM_PFCP, ITEM_ECPRI, ITEM_GENEVE_OPT, + ITEM_INTEGRITY, END_SET, ZERO, }; @@ -1307,6 +1311,19 @@ static const enum index item_geneve_opt[] = { ZERO, }; +static const enum index item_integrity[] = { + ITEM_INTEGRITY_LEVEL, + ITEM_INTEGRITY_VALUE, + ZERO, +}; + +static const enum index item_integrity_lv[] = { + ITEM_INTEGRITY_LEVEL, + ITEM_INTEGRITY_VALUE, + ITEM_NEXT, + ZERO, +}; + static const enum index next_action[] = { ACTION_END, ACTION_VOID, @@ -3373,6 +3390,28 @@ static const struct token token_list[] = { (sizeof(struct rte_flow_item_geneve_opt), ITEM_GENEVE_OPT_DATA_SIZE)), }, + [ITEM_INTEGRITY] = { + .name = "integrity", + .help = "match packet integrity", + .priv = PRIV_ITEM(INTEGRITY, + sizeof(struct rte_flow_item_integrity)), + .next = NEXT(item_integrity), + .call = parse_vc, + }, + [ITEM_INTEGRITY_LEVEL] = { + .name = "level", + .help = "integrity level", + .next = NEXT(item_integrity_lv, NEXT_ENTRY(UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_integrity, level)), + }, + [ITEM_INTEGRITY_VALUE] = { + .name = "value", + .help = "integrity value", + .next = NEXT(item_integrity_lv, NEXT_ENTRY(UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_integrity, value)), + }, /* Validate/create actions. */ [ACTIONS] = { .name = "actions", -- 2.25.1