From patchwork Tue Aug 6 03:41:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 142910 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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> 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: XhQFfzAsDFt2KRhZMfeDicEPdO3fPr/8CPGlJT1r3QgMqzt4ZMIQsVD1p8v3bJnLCiuz1pq+kDZHq8L/8U1tRJNxr8HI9Q5x/NR7KgD456NnyQQ0nIgtSPkzVASLeCpceAeip0yNiB4SwUtyEXJ6T5D+UQRXMyFzoRpMUBVOf1Q7AoLby3MKy/W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ToLe3aHc5o1pN5LM9zqlJHEPIbLcmarbKG88hhFsMr1qi4k5xBjTfde+OGmS00RJGsKFvxvJrJV+r8sRwrshNlEWsOSMG/s92/lXCSKWPb10QiZgzxltJSVj4B7OubIoMNJtHJJaSilgo9fbctq67fS8jKlJgS1Mq2P86HVHGMKBx2qL2ZG9g== 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: z4dEgRyyNlv5u6HPzurcl1oHvLA3HT6Roeu4x65j5pxalfEdorC+4ANkCdISbptGCSx13U7Gf/d4lgKw65y0q7HAx8vV9UFnu1Z5dwZiXWMO9npdk1Qa3E3zI5RN7RJCC3ic/hhXcSU7OoBVvX0uC0Lxdjd86Ta8PJozf8Tue1dM+SCUD16Bw89T+fAiLfiMe3XWlj97t9/11qr7mzKVa+TD+MHBT6y0TUHp+xCJsRmmJbX7H7MRT07jhe83nCLd7UhUnwpDtD+yz4mP+KsC5Mt0KDejWveuEjhEo/mzse6WyPbMc8a1s+xhK0jn/H9Laa4Rz2vMon0qDFc/t7B8+EPuKSVbL58gsJHwnPfxxgGV2MaxEDdhKY0W/2z4eSXWAFKaMlyiBrvY3F/b5tIqzW1U6Kc17KeIc3D4pqKwP9nwNjaUfpmSvB2fpEa/N/ak87xMODSDAOu76ti2mwDeDzzSTweMsDSyeO0a2VhjhZNdirZCk4uFca/mKuOF+G66izKTI1UoA6+pgmnDSneQR7PunJkug7FyB2MRbgmcG3LtBIqmZWO4Od+KDcmTibFXq9W0p3qYUSwatdedWUMtp7P/bVhdXbce0Zxjo+P3qY9AyfNawU/6eH3ks5f3qHZ/WCfruCSjZcYI4+brTQkaymWxEchxaFTWIprvn9A6F/aLARQTacC9Ks8+JjXU48rWEdivMacCKUwW4aib2d0mDeQA13KKD+ySPdVK5irqLns3NX67SsV1DLJYjtonwiGzN2kQjcMZgv36pOesBm5ocyWArgi2VAuRHASih/+jZqIj+amiyg0EzV8oM6ZmNyKEvOrketRhEeNb3pswgDrbocmxxF25912RQMX9l4J7ViyQsme2WV3fKYi0QKPk2FyzIpO50Q1xFAeyJz7x+Kf2kl664uI+WqP9cX2GrBPRMXU9nezNdtOFeV6NuO1PA6BgQJ1+Ylokc9GESjnYPBOcFwjEJ9nV+qzld8henKx+GcRz8XLhozPysDvdP1ahNF5DzooXEVlq1d8D31ArQU0hnYJekCj+15BjyJ4F8E/vra2uLIPbHjVGlpnVISqVxqKALmn/1P4X4WTnC+9MXZ22BC+XDiiCrJog+UWfpuOpWbdPSzMOvJNTzt772hxI1Va8HbNf/ZReMnY++/qEIPQUKAlmWxB2Bj2AmupDpxjy7DZ06BveuFlrc1RRIlVo9vbCqS0qTuwyd/MRvem/P170GSNMtMdUQZvBhWdowJTvy5AK6W0c0+O8EUp+R1JZ3Mc3n08jzIehQBFUr4YW5ftULyPl11lTMZd1dveZVfjdRvFi84US+5XDW3hz2Bl7eITjw3GosbR6dLBmHVVSvJbZtISc99Y8YmxQp6xrFi3iHa4SvwtiCXu33HubJTl+qz/CnKf7xGFX/CEwCCL6fxxOuTRRFscXXSvjlD0On6IkcRExswln/0oKo1TkQfZEU2MqAY/ALyA/rnGl5K3qQxa5os91jlsf/9/kkuX/bkNF3Vpbwtcs9YSRmydxEVR2sg6B8BRsiMf2fU3LYePqBj9RRQxD45DSpf8MsekW9ZIxJno= 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++;