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 70D97A0350; Tue, 1 Mar 2022 23:48:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1863340696; Tue, 1 Mar 2022 23:48:08 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) by mails.dpdk.org (Postfix) with ESMTP id A986F40040 for ; Tue, 1 Mar 2022 23:48:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R7aPaA4cs720fiHx+oDEmhYPxPIEsA2rrNjy+zg//UkB/g4iaPZGrqFqAG/Ly/xV+shQQ+QfECrPwaeC1JcLjea3/9ueMJeiMhoGCYovNfznHPK1gjW8GFujJsUhTeXi1ESrLpEY7nXZxRkLQrfUvP1ClNQFe8Q8zomzWLvqNZKrc2trgHIc8WU2PFw7T3thHYq60mMrPsyebXGe1PYA9rI2tWKBGFbzJPNLGEJVMmFj/QYXpWDuWqWaFFKtC4jWFVgd4w/ZIU4R1RcxFXZ5kTDwsMuGyW+AONyg5Brt7E3yRV485s8okxRrAzB3qSuGtOLnSJf3DGSoxflAWDbQxA== 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=CqdLzJJ5X/AAvVShAbCtP1sgzObfQ87C5aJXrqIq2mY=; b=eHVMxoz+1aN9MN8JaU6YBek+O//endrF+cMB/iphwgoAPvFYsUbcIWCTzJ78KRs+XVEija16vRifW8myLdLtAXBi0SSqcElFNjKV8ppfgwgOpuupGeXhiwqiB54at7CqFnoENknrhKqB/wPobakMtMc/lpkQnoDIo6O3K4VeL1bgVfJSUAEHxb+IRDNfgrILwldJhTQl8OeXUUrt0FVHT4VHqwtOB0LZ50hWGOwyhQQucP/BcnepoNQwP24aE2hIrCgevKMNneeuU4M+QjyiE7ko28jdyl9axWMqRCgX8kJAEFHY81OEdspQipmg5133DGDW8F4SwOu5DQauOU1KZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=CqdLzJJ5X/AAvVShAbCtP1sgzObfQ87C5aJXrqIq2mY=; b=SQUK0k6rP0D7n+UnNKARwtmk2z5TYISnldSChlL9nhBfOa57FRBltYAHRXV7XKjDjjBMTHtm34VFK+217UornLrlbiRfJM+p1xrpvOwTr/74AiEb3BVku+RzaSx6f1L4VmXdBMSAxzRAz2z+oUU2QvvphpECzHU46xk20JAgy6TSb7/z4ajtKjtZtaWexD+ykrBaCQZDwjFnSbFazyeme8JcVgrBLkSnwrO6I+4ivnUzi1cknskM1CaMiX8hsyj59lPAJqqzFDngun+pa765I5wLRpyJOLHyzevg+AUF2+4uoa8I2LsxBJ7WLGIXYfrx3ITBvF27ChLg072vDpW1IA== Received: from BN9P222CA0002.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::7) by MN2PR12MB3263.namprd12.prod.outlook.com (2603:10b6:208:ab::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.26; Tue, 1 Mar 2022 22:48:03 +0000 Received: from BN8NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10c:cafe::f) by BN9P222CA0002.outlook.office365.com (2603:10b6:408:10c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.23 via Frontend Transport; Tue, 1 Mar 2022 22:48:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT009.mail.protection.outlook.com (10.13.176.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5038.14 via Frontend Transport; Tue, 1 Mar 2022 22:48:03 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 1 Mar 2022 22:48:02 +0000 Received: from pegasus01.mtr.labs.mlnx (10.126.231.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.9; Tue, 1 Mar 2022 14:48:00 -0800 From: Alexander Kozyrev To: CC: , Subject: [PATCH] app/testpmd: fix flow creation parsing Date: Wed, 2 Mar 2022 00:47:39 +0200 Message-ID: <20220301224739.3072563-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 518bdeb1-df77-4b8d-0bf2-08d9fbd58b75 X-MS-TrafficTypeDiagnostic: MN2PR12MB3263:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K1ytBlZuxw/TbkzpnLj2FEHSe/PFbyKTKkFcnDtZOfbaut94MZ2bf9hWA+ixRnzps0BKofIJUVnYEKy1Fg0K8wKBcPIEbqnQBwF+0OBkOS+f6imnyRWC+T+xWduylEETR9O72rmbKkK8iG/hKtbpb8+BKfJ/+RS0K8k1+A9TNw1DV1XHZUmaLWNZh8Q9Ng24b4JKEer88fdE2TV6OR8MVKuNf/QUrNNG9lGIRi6n3/m3xBUWpxa0teBeBcy1q0aPXmOxNRaHAweG2KJ9rHeg7ytYBqSFJ0HRfmGA2NNKDERp3LnyAnRNrQ7kK66py+MlLfqooqNRrqvbODmclQCuz7T9UYrljorPEGhpFGXQaz8zAr+i5rSX8w9uDbyIheh1ozcQpAb7r+ixi71jmQ4gOOXphJ6c7f7IeHexFBJL5vHtdidEQ7rRm4CCTyI7oNeluCdKkZzwIdaMc5aPcCyYVDXD9JbmYwYO70OG88xc7VdTa44WKfqGLgXPHehtGllP96+pdNXxRIf+ZD0U6tTk2kI02Ka4e3mtULQoMW4uBX5T9s5wZDSO5bM1A/U1ilsvO1pu/3i1ZHQTNykmmyVYcY87lblrSQHKPYCyyLV+/inuQ7lAJi9Zupb2YouSV9IyZI3FJ1e+iPqm1e/3J4IbmN0eeDkduU6c6ESpqMSn0yXyIsR1Fm7GHHYuScbmzZI0J7jsIVYDYUoGn71MVY+cDg== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(86362001)(6666004)(16526019)(82310400004)(316002)(6916009)(508600001)(1076003)(54906003)(36860700001)(40460700003)(26005)(70206006)(47076005)(186003)(426003)(356005)(2616005)(336012)(83380400001)(107886003)(81166007)(5660300002)(36756003)(8936002)(2906002)(8676002)(4326008)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2022 22:48:03.0477 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 518bdeb1-df77-4b8d-0bf2-08d9fbd58b75 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT009.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3263 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 A pattern template creation shares the parsing mechanism with a simple flow creation. The pattern template creation only consists of pattern items while the flow creation continues with actions. The parsing mechanism now accommodates both cases and allows to stop at the item end token, which should not happen for the flow creation. Fix parsing mechanism to differentiate between these two cases. Bugzilla ID: 941 Fixes: 04cc665fab ("app/testpmd: add flow template management") Signed-off-by: Alexander Kozyrev --- app/test-pmd/cmdline_flow.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 4f7a9f17f9..fc4a6d9cca 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -6864,6 +6864,14 @@ parse_vc(struct context *ctx, const struct token *token, ctx->object = out->args.vc.pattern; ctx->objmask = NULL; return len; + case ITEM_END: + if ((out->command == VALIDATE || out->command == CREATE) && + ctx->last) + return -1; + if (out->command == PATTERN_TEMPLATE_CREATE && + !ctx->last) + return -1; + break; case ACTIONS: out->args.vc.actions = (void *)RTE_ALIGN_CEIL((uintptr_t) -- 2.18.2