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 D97B04561A for ; Mon, 15 Jul 2024 12:15:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFC1640678; Mon, 15 Jul 2024 12:15:26 +0200 (CEST) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013032.outbound.protection.outlook.com [52.101.67.32]) by mails.dpdk.org (Postfix) with ESMTP id 6088640269; Mon, 15 Jul 2024 12:15:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j6K7bCCTGzFrHvPGrSZJF/wxRDb3i5eAjb6sdO/kd8NHSAXfPWFDGuNm5zpVRa74o+KVjvIqaEmYPrQ8yeEtaDi5j4O2RGJQ0WHLtZ1eFvnWHL5y31sGZ3UqiENEPLmse2z5BAEpVdcEKZSdgracgKBHs12CTIMGeqjUR1h4ZoQ931x5e2gJif4YhqMAL8RYvV0Kcy6vlzK4QRwAyigxMK5FO0xSDjUzFmQbrJytdKnmXeaU878CvsJmFeB2YCpefDHcfFjtavKHFG9WVc7Ibo6kA4Q5G6rTgqTu2A61w1GbkJzVjnbGbwcNqnniljp3KoIt2LYN0jPPzNXWCIIHfA== 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=yloOB3srQFsv/VssN+q9PI3bxKOgoosI/GFvQkXsak5njwwwvaKh0TDVg9P1wk78YEoxyydYyeqCYtsPDwscBsD4VtQLdkCFtunKCvjKDuPHvDhES9k27JM/DooOC/1BFI9INwkTpy1ivvAd+scOTMACLpgM/OcREqPNLmV+DSJTqWd6C2SQ3VJewd2m6IsiqaBqT0+7dzH5NOkyuXAoHcNVg6wnrKVnmPuNIswi/gZa6hRIcK2ftff1VsvalywjpnuZsXqrnIbi5aWtErP/VFT/yAzHgt4+GkyYT7anM7Z8065E2iUOByGo1MRZhN7ICgkHp9z1TNs9/4lnAm7ZlA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/Ctw0pXUC4WbVo/F/HsbyCmjgmGQ45OOMboAysNyuHw=; b=HlMWJqpgPakhqtpsKTppb+cRDN+BEWGNNRoiX5VR6wbZ68O/w6BMmVzIo13oKrsLicvEfbl2QtO+Je7ddlAhRK7J8ekdxpp2Afa+oJujM63aKZZnc29MVuXRnZl05ArqQHXQe/RH+N0LZO+k2p7M6uJEHmIh7w9fL4Qc7quc02I= 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 AM9PR04MB8827.eurprd04.prod.outlook.com (2603:10a6:20b:40a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.28; Mon, 15 Jul 2024 10:15:22 +0000 Received: from PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f]) by PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f%6]) with mapi id 15.20.7762.027; Mon, 15 Jul 2024 10:15:22 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sean Morrissey , Konstantin Ananyev Cc: stable@dpdk.org Subject: [PATCH 2/3] examples/l3fwd: fix return value on rules add Date: Mon, 15 Jul 2024 15:44:57 +0530 Message-Id: <20240715101458.645014-2-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240715101458.645014-1-g.singh@nxp.com> References: <20240715101458.645014-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR03CA0125.apcprd03.prod.outlook.com (2603:1096:4:91::29) To PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8205:EE_|AM9PR04MB8827:EE_ X-MS-Office365-Filtering-Correlation-Id: e7a0854e-c859-4335-b5ba-08dca4b7093b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?rT8m6Dt92eONqVldCDhwngAMo3R/SMSOfHEKv2SDCk5GRIuskm++tuCCMMgt?= =?us-ascii?Q?evYQJzN/Po3/MjxiisaDORv+ee5KznPuudTRN1Bne+dK2u7PvOJB7ahXWqvH?= =?us-ascii?Q?dXt+mOpa5GXfDZQMH/d3537qH0wgfEXNvu00/e9k99848PH3qZCD2sFONTeQ?= =?us-ascii?Q?lsG8po4Kqr956NZOnqK68JUOFdfSNHvVmNr8VYBy/I9dAAokBP1CiAUlAnnD?= =?us-ascii?Q?34G8+5HWhTTa8q93jP5Ge2VdTaRsVtFvAX57n1EACWmMJtUb8OpcyU5bJfd8?= =?us-ascii?Q?ZmnIdzzcMk4OelaXb/xL8vUf/aQXusXjJ1b6izpDFZMMand9+FYG/9Jp9K3n?= =?us-ascii?Q?O466rf3xvnlp2riGV+H3RFDyugKlqhM+WboSgebt9iw7DQ4gHjlMnjr4v9QM?= =?us-ascii?Q?2NoutoV2o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cHTVnPfkoz35c?= =?us-ascii?Q?vaMQSTKzjypBXOI5tXCb1xhbqabKzs9czSP2mm5akR18w6CLIEs9iOor5odj?= =?us-ascii?Q?mZhC81Z2i7yWzpqV4bVsFWJXz5SkWjDqfY9iKTpriutwkZ+MXw=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)(52116014)(376014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?8J5dXhz0463vdAgw/Vdhe3ElQXcRLCmboyedLrbgs/rHEhuZdgxtu8CLSH0z?= =?us-ascii?Q?9KwBsJ1dWWvgkso2Pgq/dfbpj5E5koD0g38ajEoesICeLt0hyEk/N7DFqJ28?= =?us-ascii?Q?bacRNImrehfYi6FSJANcKXWQvRCghZasy/yhYVjqZxy9S0FblKQfGqc0w2K1?= =?us-ascii?Q?0lEMsZM2jTo5x1dHrT9ZmMBI0w60e+l9UBlB5ULe7erEFH7qEWxPn7SDK/tD?= =?us-ascii?Q?SoW1CycqioJTDSltvBAhndump3QEATEoagzLa7/oxr/Lcof/ZPUc6Wnemhds?= =?us-ascii?Q?UEvxdjOT1X4fIwUvyEwEKPm7OeV/f1gM0O+TJtVpahYnDYIPW65TwCme5+Z3?= =?us-ascii?Q?z4ecEedhKtPMdIZ54reSNfNdxfDc3Nv0z8sSsifvEz7bzB86CDntsPSBpCCe?= =?us-ascii?Q?jyGP4sJAAcJoSihrjfIQhVv+WRqqaBDtXbjhEgkfyUx2XGjx7AIad8gyg+DP?= =?us-ascii?Q?OaHmPWIYSt23AQuRj74uIPAf43h9Hs9BPjp6YAniGusFTJY+opTgaoOfUQns?= =?us-ascii?Q?9caMNTgDVwgtS3nWu6lFngsgwfmDlcyHX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-ascii?Q?ZDpokeK/skSc4knSEIF0RXb1LJSd//+yOoSGAsRRCiwgcADakn2SAi+61SDz?= =?us-ascii?Q?lRrrh3jyGWwtPfsPitltKoOJfJ6blFcDdFP1s1u1xvKF1evS0RtSJ308YXNn?= =?us-ascii?Q?SLx3fGIrwOQ/F5hDloIgn85O96iRwDPpouvC6c5I?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7a0854e-c859-4335-b5ba-08dca4b7093b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8205.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2024 10:15:22.3813 (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: 7vuy+S55znLeL7Zh2RymGXgEThM9aneU6Zug/2pnB5P0w4zbTMJe76GBY/v8bVx8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8827 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 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