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 419894571F; Tue, 6 Aug 2024 05:41:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 311504068A; Tue, 6 Aug 2024 05:41:52 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013039.outbound.protection.outlook.com [52.101.67.39]) by mails.dpdk.org (Postfix) with ESMTP id 2B09A4067C; Tue, 6 Aug 2024 05:41:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Er+7zkjWIMSCPXr1sUXpK8VOzJoAoIQqD0cEI6uceaV0H/hK/TpOKTZxGcsE+ntkCaSDMaRrRIAEsa8pb6SbusZznog1tt0BSCo8j3cWd7XZkbuohIL/VmhPzTdwo2uOfxHzl5kxO7FtrFgwv/mL4XcOAntqqyhw1Rs8wPjS45GPzGxeF7P5c7FfzGacspWVvrRQp6NwVOe41kofK5Yo0AeBJlFFWSyuvC23Lm+gJCmcFo6jIdyu1XY4xI+tmAIaBPPO1xy/7WoeqhcPd8WISQ1Iby9N9klBCul/xlZOS03tWJ8oAj2oHL8sMwuolKOe5dvy3UrBc4corJqAFuBwgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/Ctw0pXUC4WbVo/F/HsbyCmjgmGQ45OOMboAysNyuHw=; b=W8JFRHJZspN2aD39DwSmRacONGMFgoi9TOu9k/FTc7Wg1nBiOhxilTNDJLhaQyu0QOjJnMqxxzbxQZ5pOiMqb3Wbde8hXQKk5v1dTwjeJkRWUCoMo7/uVZRA/OOJ7sy9sbGJHTBTfawVZHGmpmOSNiEvNwOmTw1Y9/R4K0FWM7T6DExKrgHA6sbLrFr7kYrGUnUIGWkly4vEiPkJ3lisRWHFcwa7XaAR3lmtiC7piDv5gBkAn9REQcRxl4/+zboVwJWyFSBVAAEMukd9KitFxc4aZo5hc9g+WPm2gmmgAeh/oneQ4YKgr0w3qm1LgidOwYSdf8gykvzws4R9WWqCew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/Ctw0pXUC4WbVo/F/HsbyCmjgmGQ45OOMboAysNyuHw=; b=lVcgDG4bVonMjsPwe7Ok/VEcKw4nYtzPI9GV9C3aWxSoIQbrcHwD9Yxu7sjH0k2CB8bKmouA9qHBzy3R6zfxcR6uZ5jUtXmPH7eAgHOfNiCFlxhnbg+lzU0s474b6nLaGAg3bF7uuSMnbfqwpiz1CJo2bhmrwGTtv7DLeWUAc1KJ/FioDr7MBFN6aKdNTnxZjVY8p8ln5dDqfLnZw34NMEv/t4c3WsuHzBC/YmjLD0rt9N4f9L6ep3vQv5F3uZLXb21mE45AhxHHr2BZKcKVuZa0PVZS2i26o/41rNwDIrXMdCc4KyJ8sfdFbaJZLPYPeM54L+a0NGWJLIz5MP3eYg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) by AS8PR04MB8387.eurprd04.prod.outlook.com (2603:10a6:20b:3f7::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.11; Tue, 6 Aug 2024 03:41:49 +0000 Received: from PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f]) by PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f%7]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 03:41:49 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sean Morrissey Cc: stable@dpdk.org Subject: [v2 2/3] examples/l3fwd: fix return value on rules add Date: Tue, 6 Aug 2024 09:11:19 +0530 Message-Id: <20240806034120.3165295-3-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806034120.3165295-1-g.singh@nxp.com> References: <20240715101458.645014-1-g.singh@nxp.com> <20240806034120.3165295-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0112.apcprd02.prod.outlook.com (2603:1096:4:92::28) To PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8205:EE_|AS8PR04MB8387:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d70324c-8e02-458b-1db0-08dcb5c9b42a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|52116014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?XhQFfzAsDFt2KRhZMfeDicEPdO3fPr/8CPGlJT1r3QgMqzt4ZMIQsVD1p8v3?= =?us-ascii?Q?bJnLCiuz1pq+kDZHq8L/8U1tRJNxr8HI9Q5x/NR7KgD456NnyQQ0nIgtSPkz?= =?us-ascii?Q?VASLeCpceAeip0yNiB4SwUtyEXJ6T5D+UQRXMyFzoRpMUBVOf1Q7AoLby3MK?= =?us-ascii?Q?y/WUNEWNjj9tSIr/4TxjpsqqRwsPf7tpfcVqpoyTcBhC30DUPv63dh/QnZ8q?= =?us-ascii?Q?b/F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R8KCQxdpD2ahg9WJAKgGG?= =?us-ascii?Q?KzewnwoiACUokrpmXkHBHGA6PrEsqbZ8y5P+L6WE7h5/gKPy5FElG8xTerFv?= =?us-ascii?Q?78pT/v5oWlIz1B9t8jjN2oQFuHSnwBVcFqIElutlgn0rkOSP9ToLe3aHc5o1?= =?us-ascii?Q?pN5LM9zqlJHEPIbLcmarbKG88hhFsMr1qi4k5xBjTfde+OGmS00RJGsKFvxv?= =?us-ascii?Q?JrJV+r8sRwrshNlEWsOSMG/s92/lXCSKWPb10QiZgzxltJSVj4B7OubIoMNJ?= =?us-ascii?Q?tHJJaSilgo9fbctq67fS8jKlJgS1Mq2P86HVHGMKBx2qL2ZG9g=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8205.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(52116014)(376014)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?z4dEgRyyNlv5u6HPzurcl1oHvLA3HT6Roeu4x65j5pxalfEdorC+4ANkCdIS?= =?us-ascii?Q?bptGCSx13U7Gf/d4lgKw65y0q7HAx8vV9UFnu1Z5dwZiXWMO9npdk1Qa3E3z?= =?us-ascii?Q?I5RN7RJCC3ic/hhXcSU7OoBVvX0uC0Lxdjd86Ta8PJozf8Tue1dM+SCUD16B?= =?us-ascii?Q?w89T+fAiLfiMe3XWlj97t9/11qr7mzKVa+TD+MHBT6y0TUHp+xCJsRmmJbX7?= =?us-ascii?Q?H7MRT07jhe83nCLd7UhUnwpDtD+yz4mP+KsC5Mt0KDejWveuEjhEo/mzse6W?= =?us-ascii?Q?yPbMc8a1s+xhK0jn/H9Laa4Rz2vMon0qDFc/t7B8+EPuKSVbL58gsJHwnPfx?= =?us-ascii?Q?xgGV2MaxEDdhKY0W/2z4eSXWAFKaMlyiBrvY3F/b5tIqzW1U6Kc17KeIc3D4?= =?us-ascii?Q?pqKwP9nwNjaUfpmSvB2fpEa/N/ak87xMODSDAOu76ti2mwDeDzzSTweMsDSy?= =?us-ascii?Q?eO0a2VhjhZNdirZCk4uFca/mKuOF+G66izKTI1UoA6+pgmnDSneQR7PunJku?= =?us-ascii?Q?g7FyB2MRbgmcG3LtBIqmZWO4Od+KDcmTibFXq9W0p3qYUSwatdedWUMtp7P/?= =?us-ascii?Q?bVhdXbce0Zxjo+P3qY9AyfNawU/6eH3ks5f3qHZ/WCfruCSjZcYI4+brTQka?= =?us-ascii?Q?ymWxEchxaFTWIprvn9A6F/aLARQTacC9Ks8+JjXU48rWEdivMacCKUwW4aib?= =?us-ascii?Q?2d0mDeQA13KKD+ySPdVK5irqLns3NX67SsV1DLJYjtonwiGzN2kQjcMZgv36?= =?us-ascii?Q?pOesBm5ocyWArgi2VAuRHASih/+jZqIj+amiyg0EzV8oM6ZmNyKEvOrketRh?= =?us-ascii?Q?EeNb3pswgDrbocmxxF25912RQMX9l4J7ViyQsme2WV3fKYi0QKPk2FyzIpO5?= =?us-ascii?Q?0Q1xFAeyJz7x+Kf2kl664uI+WqP9cX2GrBPRMXU9nezNdtOFeV6NuO1PA6Bg?= =?us-ascii?Q?QJ1+Ylokc9GESjnYPBOcFwjEJ9nV+qzld8henKx+GcRz8XLhozPysDvdP1ah?= =?us-ascii?Q?NF5DzooXEVlq1d8D31ArQU0hnYJekCj+15BjyJ4F8E/vra2uLIPbHjVGlpnV?= =?us-ascii?Q?ISqVxqKALmn/1P4X4WTnC+9MXZ22BC+XDiiCrJog+UWfpuOpWbdPSzMOvJNT?= =?us-ascii?Q?zt772hxI1Va8HbNf/ZReMnY++/qEIPQUKAlmWxB2Bj2AmupDpxjy7DZ06Bve?= =?us-ascii?Q?uFlrc1RRIlVo9vbCqS0qTuwyd/MRvem/P170GSNMtMdUQZvBhWdowJTvy5AK?= =?us-ascii?Q?6W0c0+O8EUp+R1JZ3Mc3n08jzIehQBFUr4YW5ftULyPl11lTMZd1dveZVfjd?= =?us-ascii?Q?RvFi84US+5XDW3hz2Bl7eITjw3GosbR6dLBmHVVSvJbZtISc99Y8YmxQp6xr?= =?us-ascii?Q?Fi3iHa4SvwtiCXu33HubJTl+qz/CnKf7xGFX/CEwCCL6fxxOuTRRFscXXSvj?= =?us-ascii?Q?lD0On6IkcRExswln/0oKo1TkQfZEU2MqAY/ALyA/rnGl5K3qQxa5os91jlsf?= =?us-ascii?Q?/9/kkuX/bkNF3Vpbwtcs9YSRmydxEVR2sg6B8BRsiMf2fU3LYePqBj9RRQxD?= =?us-ascii?Q?45DSpf8MsekW9ZIxJno=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d70324c-8e02-458b-1db0-08dcb5c9b42a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8205.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 03:41:49.7785 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZdMuA9lgPr0kCPUm2SQNhC/y/DbWeYNFi/E0FM194/XRZXzyISQdfgWYgL2/SrHn X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8387 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 fix return value on adding the EM or LPM rules. Fixes: e7e6dd643092 ("examples/l3fwd: support config file for EM") Fixes: 52def963fc1c ("examples/l3fwd: support config file for LPM/FIB") Cc: sean.morrissey@intel.com Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- examples/l3fwd/em_route_parse.c | 11 ++++++----- examples/l3fwd/lpm_route_parse.c | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd/em_route_parse.c b/examples/l3fwd/em_route_parse.c index da23356dd6..8b534de5f1 100644 --- a/examples/l3fwd/em_route_parse.c +++ b/examples/l3fwd/em_route_parse.c @@ -119,7 +119,7 @@ em_add_rules(const char *rule_path, char buff[LINE_MAX]; FILE *fh; unsigned int i = 0, rule_size = sizeof(*next); - int val; + int val, rc; *proute_base = NULL; fh = fopen(rule_path, "rb"); @@ -172,13 +172,14 @@ em_add_rules(const char *rule_path, return -EINVAL; } - if (parser(buff + 1, next) != 0) { + rc = parser(buff + 1, next); + if (rc != 0) { RTE_LOG(ERR, L3FWD, - "%s Line %u: parse rules error\n", - rule_path, i); + "%s Line %u: parse rules error code = %d\n", + rule_path, i, rc); fclose(fh); free(route_rules); - return -EINVAL; + return rc; } route_cnt++; diff --git a/examples/l3fwd/lpm_route_parse.c b/examples/l3fwd/lpm_route_parse.c index f7d44aa2cd..f27b66e838 100644 --- a/examples/l3fwd/lpm_route_parse.c +++ b/examples/l3fwd/lpm_route_parse.c @@ -184,7 +184,7 @@ lpm_add_rules(const char *rule_path, char buff[LINE_MAX]; FILE *fh; unsigned int i = 0, rule_size = sizeof(*next); - int val; + int val, rc; *proute_base = NULL; fh = fopen(rule_path, "rb"); @@ -237,13 +237,14 @@ lpm_add_rules(const char *rule_path, return -EINVAL; } - if (parser(buff + 1, next) != 0) { + rc = parser(buff + 1, next); + if (rc != 0) { RTE_LOG(ERR, L3FWD, - "%s Line %u: parse rules error\n", - rule_path, i); + "%s Line %u: parse rules error code = %d\n", + rule_path, i, rc); fclose(fh); free(route_rules); - return -EINVAL; + return rc; } route_cnt++; -- 2.25.1