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 2A9D3A0C4B for ; Thu, 11 Nov 2021 13:50:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 230EF4115D; Thu, 11 Nov 2021 13:50:58 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2072.outbound.protection.outlook.com [40.107.237.72]) by mails.dpdk.org (Postfix) with ESMTP id 61DD540E03; Thu, 11 Nov 2021 13:50:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KrZlOmruj3rLei8IWMyLknEWLaDlD7GBxqI1NdfRJZTtsryWVfZxtY4ETYhpC9+IW1f8P44fsWiu8S8LSmIbPA3d8rKwRSBeGCbBasF18L5dYkgzFAiwY344UHeQO6TpjqwGUznHOGrGDSMTc3yoY6RWSgHmVN67jqj9QEzytFaxKpkqqoX7kjweOjEwe6KAABmoHojoBHEXhVLrG2vp2xUv5omAH7dtZa/mCmMwXLuOH3PJfRsLRiIe//1k70siGsPQSMhTS4bB6+gpAkcjLNdYE1ovhqzm8AA+D0/2LGxjn0TR1NeChxtbLiBYaUB3OiEHXO1LowdSqYpllOuNtg== 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=4IMglZ5cioCsKFnCuqM1eGgRA0AkksF7Qx+4V999Mgk=; b=D3dtDJGC1a/aPvvS+ufnouenVRFvfg95Msez+EiEQJmrjw4h2wtH7p71Bk6ApFrPRHIAXB3pMqsZLjKvHjTNOpJ9Fr5EVd5kstH6DoRpmyDp1ODzILcNglvjPLenACLVos0X3a6dKmjAKjCkbUc5yGP398AJYLwfBW87GPkTOQPJS6GkztXjJLL4gVS40hxtgf7nHPvkGe3tNgLf+J2S99FCjaIi2MqM32CSwCuF6a71v+wqxMMnnCnpfWcNUKvUvLqg03TvAYbP0QvmfyHu/f/D9trNw1aikJHUKs9zcvdLUebur/9dWg94JQPLQg6PdkIM0KFuQvr6i3g/xe01Mg== 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=quarantine sp=quarantine 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=4IMglZ5cioCsKFnCuqM1eGgRA0AkksF7Qx+4V999Mgk=; b=JwnAcZK5O7KxlfBNhaCncVHYewLwh/fiyb6PGQxSJ5r+QWasENDGwmWRW3YOMzswdTQSKFe5mlFC1JQpjiHcLzC8mO4l3/BxzWZ03PG6NoL5KZoGY7qzmeKMmjH192VZUHbQaUTWEc3lkZjIWU0uMw0WRwRTN2p3HmgwNS29xI8HtIgyZWBsh/AkN2SmRQINNqkXYzUOVMj45fiQEbvy/b+IS8lQUmCXkpIAs79PFdWAK7DuEyn6R8ecTFtq0JAWyswTRHvxeyuRerxzj1eNvvYbyBxs+WtgM5dEWrN0dUQ+tFpMBdv8hADK/JqDp/vrvdHPFScIoMWFRMM6ZR1eNA== Received: from BN6PR17CA0014.namprd17.prod.outlook.com (2603:10b6:404:65::24) by DM6PR12MB3947.namprd12.prod.outlook.com (2603:10b6:5:148::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Thu, 11 Nov 2021 12:50:54 +0000 Received: from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:404:65:cafe::ae) by BN6PR17CA0014.outlook.office365.com (2603:10b6:404:65::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Thu, 11 Nov 2021 12:50:53 +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 BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Thu, 11 Nov 2021 12:50:53 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 11 Nov 2021 12:50:51 +0000 From: Raslan Darawsheh To: CC: , Subject: [PATCH] app/flow-perf: report invalid parameters Date: Thu, 11 Nov 2021 14:50:30 +0200 Message-ID: <20211111125032.29087-1-rasland@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5afc03a-8a6a-4f69-eb80-08d9a511e591 X-MS-TrafficTypeDiagnostic: DM6PR12MB3947: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2byXD8jiuJDHKR0s5qdvebesgZNXa55Pa8H2nM1xnMWdq4Xdz6AGZRg6AbtUxYuYnC6bFv9lZ3pD595g3DUg7BoQU6XI32LjUvlrTVneHd5oOMPQ1OnxuxojDCXrHpfUjzXxNO2aAnLmF544OXwfW3L8Q0oN43TSSX3vmgMw0Dxsa4DsYDrMCUArG8+wjDM9l9DBxfVN8jHp/R/hBhv/erQV0i+r3wdTY4HD2XxHD7jNVM19jZ0oWdFhLYZLluntihWlIK01+umDm6x8FKDAiM5ZEGZqcQBlmuxLml/fVrZWTo3pD/IAuKqlAJ1puzQGSIDNkfUIO2mPuPeJzy6JTYe0awlH1X4LAu8hkQppiLMqf36NLYzuUL3FByAJ2OIAuEnK71JB7K9aaRl2OW0dDxLnQ56zaQjlVkktKaYu4Z49FdjXtTy8HowCM0p2Md2ci+TxcDEGuoDl/jUcw9s2f2awoTQ9iV/JuImOj4xPvmiTIkESwXs+YNZxZycx891vp7DgTzkmaEZlis3zL1GzEW7hWq53JHjofqOjgG44mbDpX7obClHj04YW5u/e/1zPcZqbvXJmP5sr2IIvinkltEyaRNXmRWGHY6FTCJHGLZsJN+O6YhjCCo7Z+r+XV/tDImp4oM+YYDfqoSo+AGcWcX00F1iDWVpb4ITnw1KiMp10nVpejoRzMkRdYOCfx+pdbF0xz3AzF8Uj8EkNh4EWAA== 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)(46966006)(36840700001)(6666004)(8936002)(36756003)(6286002)(356005)(82310400003)(26005)(5660300002)(4744005)(426003)(70206006)(83380400001)(2906002)(8676002)(336012)(55016002)(508600001)(36906005)(86362001)(70586007)(316002)(47076005)(36860700001)(450100002)(7696005)(54906003)(7636003)(4326008)(16526019)(186003)(1076003)(2616005)(6916009); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2021 12:50:53.2589 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5afc03a-8a6a-4f69-eb80-08d9a511e591 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: BN8NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3947 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Currently, there is no check if an invalid parameter is passed to the application. for example: ./dpdk-test-flow-perf -a 01:00.0 -- --invalid This validate that all strings are part of the known options. Fixes: 3344cf2e3001 ("app/flow-perf: add flow performance skeleton") Cc: wisamm@nvidia.com Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh --- app/test-flow-perf/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index c1477b14a1..7453cf2b78 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -885,6 +885,13 @@ args_parse(int argc, char **argv) break; } } + + if (opt_idx != argc) { + usage(argv[0]); + rte_exit(EXIT_FAILURE, + "Incorrect command line %s\n", argv[opt_idx]); + } + if (rules_count % rules_batch != 0) { rte_exit(EXIT_FAILURE, "rules_count %% rules_batch should be 0\n"); -- 2.25.1