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 5D05F45D4D for ; Wed, 20 Nov 2024 05:05:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B27B642F19; Wed, 20 Nov 2024 05:05:49 +0100 (CET) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2044.outbound.protection.outlook.com [40.107.105.44]) by mails.dpdk.org (Postfix) with ESMTP id 3C1C342F07; Wed, 20 Nov 2024 05:05:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hbOmvIim6AJ03ELVOUDbKa4B08mBgGmAidbvv6+TVtc6br7Xpd4j8XNuWo8qGEgWHYMR1aMz/6SaOJCvaMjqsMjEotDAAsw82feo5tIEXRCbriyRJu1B8P/jYMe4JBoYNfWskuKUg1wrCmf6hi9DyRpZs27DlNixQps4yzvrgkOdzp66/eOy7mqp/lMwr2W7bsY0hcATIeojzHZkasCaGsp9FpXXElRYPI3kgGemGwU3BgqTpCRWbn898RioRVb6UqTtUWUNEfeoUJXkUtTVvJoAM56YyorwVL0DbI9yMEbLJsh0nJG/WFtDG0VCc9GWgof8aIZjv11Z5rQ78PQ3oQ== 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=H1LjjufZAzYEEq9d9yuSdG6vfkk4D6sTcwhrexHNVbA=; b=mKsKv/ClQD0txbZA8k0lX9kxRKeuSqf+5FJKH2i+XF/63tLCAmbNGSts5Gcw65R0LEfNwBQaBsRpemhxvgVDD8xbe8v25pmlL9zf+dODAXZtypcBeRU8BSDfWA7vclKPxIWHMV8BaQx3/gg9iuCiRId9/SO/emoazjPz+e9vX6JHZ2lyGfk/N3Emjwxrp70FQ2epzDd7yjdrl3FdRE10M9kEDT1hnSy+CfL3oiaHGMLZxHceFoIZJuqfoWEcZQITwyydYdfypB557mKGWeXrhaaPloKg3grn6lAjBIdunJXPeRQ+yDxFGso8FJfmRmGfjqDkkkDdndH88TyDt1epVw== 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=H1LjjufZAzYEEq9d9yuSdG6vfkk4D6sTcwhrexHNVbA=; b=TtvriFNWA+l+939cCHiCkSaP4M0eALGc3UKcbM2KuSzU9ZZ2ZPlMu+CIPpMThCb634B8ZvhROo+FDSCb8tYo32si7ltu7jUAQg2rGW8A6+CKxgNW7p+1o7yupXiHN9aP4rbkhDXUxVK8PrF/TKbLmXXkwiTWSRRfusRzGnh0xljtl2aJEWa5DRsnUnXnY0AxxAYjF265qdqC6BVKawzm2IGPlVmjChyHmSVaWbJ2j1yZbEvLcXwyZhLnyZJzxwjS3L5zyKex4mhtgL92cajBnbakWtFlnmdOdBZLep9U+vnvJaRad45P/Zd8yqp94CngGjYZxIPKw1nYwujf8K2aAA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by PAWPR04MB9837.eurprd04.prod.outlook.com (2603:10a6:102:385::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Wed, 20 Nov 2024 04:05:44 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195%4]) with mapi id 15.20.8182.013; Wed, 20 Nov 2024 04:05:44 +0000 From: Gagandeep Singh To: dev@dpdk.org, Konstantin Ananyev , Sean Morrissey Cc: stable@dpdk.org Subject: [v3 2/3] examples/l3fwd: fix return value on rules add Date: Wed, 20 Nov 2024 09:35:15 +0530 Message-Id: <20241120040516.2836371-3-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241120040516.2836371-1-g.singh@nxp.com> References: <20240806034120.3165295-1-g.singh@nxp.com> <20241120040516.2836371-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2P153CA0034.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::17) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|PAWPR04MB9837:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c988ae4-6672-4813-2808-08dd09189b59 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?5GfKJBJ2OBmk/Xsx1N9IT5Y69qmJhStsXYa4m+nRHoxl/BPUnIEl3VGEoFU+?= =?us-ascii?Q?WtKO3C67DMCiEZWK9KqLVle5uhzNUFYErrNEdwZ66UoaH+wfdZN/1G01xFTy?= =?us-ascii?Q?ydWXjww0iDuTD0Ae8Ssf/7AwAPo40YmhqK5ZbO7SoxtSaGpnd3hCpSf95YIo?= =?us-ascii?Q?ZB3r1hYGi+Sux7xtigfv98hncVBV7qEGZXsDkyppf0iWI49Z0d7kUQdhRCB1?= =?us-ascii?Q?3VciCFgpflCpuGtTpK/PkO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ii?Q?ocKWuBsUmK9tFgo9l6vF+OEyIQuGlSQ8XLIHgOmyt3F9x2diQZbGVw1+Rj/F?= =?us-ascii?Q?vXPDx0mM1/FiyuyPSYPp5Drcm9cuRTLaL6bfuvfrz048JampLQLTWDXlgAnx?= =?us-ascii?Q?a5CNNRe7dMUs4l3GMHB9DG/cA92Psd1TvxvQ0bc5iglTiGNTVJ5t5tFo1IjX?= =?us-ascii?Q?CpiiqFt1No4OuWiCvSV+tDXxjvdSWw8jZr1zSaScJgQ1ZwutbwIC5XEWdPwD?= =?us-ascii?Q?Sh6FLiY=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(1800799024)(366016)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ajjcGjRa9a3bVgHQKIgeWixX/SPkIwRKFVbN9YYjaxDxk6wC8ypv8vmoD9Oq?= =?us-ascii?Q?JnBEK04lrFP0g8y6PXN+UEaYfcDaFnJo1Ntztv34v5fMKgb39I98v6xs1/vL?= =?us-ascii?Q?UAXUeKN7zv3/Dfd+1qaxuoJ7sSazq6N5WTj+Fg7ORXKmDJfzaN/n0HUMYCgY?= =?us-ascii?Q?PNwHI6Es4+hsYg7GbbR6WaVvCWEj1UVWzcFt7Brcpeck7DhMWdm5eXppe2Yl?= =?us-ascii?Q?aSGjeqNGTl/y7mUDuI10w4Bqp47hlwMXK3CbZzTvtpuRvWtVM0pFY57evQ03?= =?us-ascii?Q?VixhlmJ7VZAMjO9vGrCaiu794rw9zoXS2rVN4qdQKCRtngIcqC6ODHUOLfWF?= =?us-ascii?Q?w5ABC2jMB7N3KjHmseO72l4AHPNtG9TVMH4NjVffISxFPLZBsCp0QRkvtGgh?= =?us-ascii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DklcwRwLbVSKU1Q+ET9Tdqp5fjWO1x?= =?us-ascii?Q?Z7Px+vc9QEXlXd6NHXZOeq/Hrpe5RIoWQpjfEkLYANFQ6kSMPtW1etLR6mIb?= =?us-ascii?Q?StRPi7kzhGVa3b83QLU9+H35tl8NzgEXnsyMvsP8Y2twTkR+cNKBPJi5omKf?= =?us-ascii?Q?IG5yUZ42AhS0A9jH1oCfBqeqmHpxyXW+zkklci+wVBX188gAPJatEcY0Fn3H?= =?us-ascii?Q?Gi6jbC96//oK95qcb8jG67FP/FfNzxUzpVEwVvtTiMZQsOfqItILynkvB7+I?= =?us-ascii?Q?YSmMH381Yx2y/xyDWeU=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c988ae4-6672-4813-2808-08dd09189b59 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2024 04:05:44.8414 (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: 5qYaqr7rurSPrPrR3CpU9vPX/OiQv6wzwYbl9lKOb65Jhr26MqlTyvBzAi6XIWIN X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9837 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 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 2df1b3e925..09f6b1951b 100644 --- a/examples/l3fwd/lpm_route_parse.c +++ b/examples/l3fwd/lpm_route_parse.c @@ -183,7 +183,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"); @@ -236,13 +236,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