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 1CDFB460D9; Wed, 22 Jan 2025 02:33:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A3C4402DE; Wed, 22 Jan 2025 02:33:48 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2121.outbound.protection.outlook.com [40.107.237.121]) by mails.dpdk.org (Postfix) with ESMTP id 201C8402A9; Wed, 22 Jan 2025 02:33:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jb8lH+wUMUX5WnUnV0XW1+kkj5qwCJfEzRebxBwZt8UyIugT93YGMhRqm2Xryrpa3kAzU38WJujgmBJEdKYMZ3h0XUyhhcsqZWUM/KsIx2frS24GaehZQCbTPHUyOSlM6W8ged+M9jrxOeVu+sNI7feMZnaTxwuf3bSjwiASiK7my89n+EUWDQ/xAf6T/owWlY6Bl7lsK3I7pSu9LSGKRNQzwaYCmNEL22tmA7WaKoI0J8hFiSVbGylcKsSFZ1yLJbnXj7m+ZFFNK3y/iidxppjijssVkvXk7/BuDENXumu4aS8Jceyu+eiv042ps+VnHSR53ngRRqmdPcdqwKtBOQ== 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=IXh+c3FoTvs+97LosqpFjtpZIg799Edv08hzMpNt/ZY=; b=cajj0LVHTkXqJVF3pQ8PWlmJEGjMHpJ7mvtStJDP5OsUWUkavae2tFvyM6/qA8awlD9/f/1wmZUTIIBFo4MLV6whJLicaXxXX6yfRrGawggZOIA7k3A1WzeJRthfW5vA5vXUkHRO3vdb6ZNaMrSLOc0is+ylCYTY+42arWR4R2Z+HDlXqEoo+S83eFvIMaEBof+Wyhkz2dKo6w0IlRAhpKN7C1vFQWDAQ2YstavYz6NWTZsD7Vgcnq2w1mnWANvyGA0+Uq/CMF2DXVm6aSUAxmVTFalYEBtmFdRht8AkUYUI0Dn96wErwGk58YXkmey9yXBMjgAcmdETwHZ2RsNNEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IXh+c3FoTvs+97LosqpFjtpZIg799Edv08hzMpNt/ZY=; b=nZz4pRuCiDKrZ/YFRSUtMkvOk/NcAaNsnnbOWdjQ2kWoNvA7PFYuDRsgp671PRcTtCiZwUGwA7+HKuqjbDGUw1cRfPhAzbYBtRhMkCmnmzqJgfjlpzjiEZOywWvi8sYieTAr6DDCfPvMDNRs92LeIzi709VTJsoXCpBWLAMoWDk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB5987.namprd13.prod.outlook.com (2603:10b6:510:15b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Wed, 22 Jan 2025 01:33:42 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%6]) with mapi id 15.20.8356.017; Wed, 22 Jan 2025 01:33:42 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Zerun Fu , chaoyong.he@corigine.com, stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH] net/nfp: fix misuse of function return values Date: Wed, 22 Jan 2025 09:33:20 +0800 Message-ID: <20250122013320.1704468-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.43.5 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SGXP274CA0018.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::30) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB5987:EE_ X-MS-Office365-Filtering-Correlation-Id: 19945079-a459-4d16-8750-08dd3a84ce04 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?T0vYdjZVlHbyfosxkUdBHzu45OmsHUETeDJJNfQAy9FaVrvTHR72lSIwVNEM?= =?us-ascii?Q?/tPEJiHmnL4vloJGamJLtIg/mJVLI4GkIvfJDT+duPyVXU3H2XIa7XC0NWbQ?= =?us-ascii?Q?Wj5C7wqrhtEw28L4izgguRg4eyVbcBbsLEUtcHAEOcMUvW3BsDaEsQws/ltq?= =?us-ascii?Q?1Iee1Ap0Qoo76D1UnAb2xU240qOP2N0EU9JeSSdkadhylhe7V72ssoffgC9Y?= =?us-ascii?Q?wV0fKQcJLbov2ieTyCGRko3H9xTeCFOZXc5F4WgKlhimlS4MFziUefTuQ5xY?= =?us-ascii?Q?BFkb8H9Ghrj6CzAXokf5pCoCa1LBsnbi3V+IYsmiEWaCpxpNiR6WwF4kkoMl?= =?us-ascii?Q?N+R9CMK/8R9W8/mPVoqSbD8GBvd4aBwc6MwMfCr8mVaTPMWAwCQs8/Ai5J4l?= =?us-ascii?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+BtDhnDn0Z0HwxeApFEA2rbk10EXgclwvZ9df?= =?us-ascii?Q?REpmFpdQEWj3rIcGRhD1pzY/glKgL3BRWkErDBUumeQzj6jmTfhJLDpmPq+Z?= =?us-ascii?Q?3xyBWFx+QImS6LngUyXAUWaGzRlpLu/5kVcqOciabHfTBvORk+i7ZlcU0GJV?= =?us-ascii?Q?ydXydPnJJFRW8zhO/0QjLHR/EWZi/WAg?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZbPglFFraZOxIxGLl/yFicOe56iRPVeTQBnx/ZxddTt1ucjAm+g9hjGKKs9G?= =?us-ascii?Q?kMEF/P38iqe8wNO1VrEwNXJRboh89ZJt8HJkI2b3MtDFKVhrA5EfzHhT3iIJ?= =?us-ascii?Q?ogOV1ZYPvVKvHNycZWWYNpYU5C9SIgMw1ZWqlRXtV2vSAD8LJs7khchwOav1?= =?us-ascii?Q?ONodoq6pCAfEelUxligJlHqyp52hB6VbJb3H8RoIOMqu/FA41RcvlJC/xRT2?= =?us-ascii?Q?qsA8vFmOgdmpQeisKPriPmPPyRlnhxvQ6peU5z7Ct38+qcVhC2drDuQoi59l?= =?us-ascii?Q?R2oWjjvLgNSBJLAo/YMnep9GS+8Shq4LXWHOsy6wvEevgzpVB3g8ZFWwhqnq?= =?us-ascii?Q?ji2UEWhdeuWaZsJY+8KY56jsnCjs4n7lR2QVOu5giqfUFGg3jI7DI3Gu8iSA?= =?us-ascii?Q?JOkY7+c5/jSpg+5e7e2YDF8Mm8tzk4Nt37qJh7KD3FrEzCDvtqt2xYXrog8i?= =?us-ascii?Q?bOEdbr9MdkUTaf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ascii?Q?gyhgfoedq0bmqI0xMx1ZAkI3hvFD7DICRXU6uD2WoA0Z16QN6GK+osLGGJBT?= =?us-ascii?Q?xfh/KpJxa9U1krVSHs7bhCi2mOk/pP3aGgIhcXWublNiHxxvePQVLf1fiEix?= =?us-ascii?Q?SrNb9mN3TaKNo9sAAmDRsvxeXe4JeNoIMGzX1NStZk5xLd5TEbUKTf9Sg9bY?= =?us-ascii?Q?hIOHQWTeeQDd/4AcFaVCGIalzv0UvL6IWWhN+m1O+Tdx76lo4fZYoYzl0u5S?= =?us-ascii?Q?Pw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19945079-a459-4d16-8750-08dd3a84ce04 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2025 01:33:42.4648 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lD5PnTwh1k9cly2jXcWkfg2S8o4e5q9Qrb81NH2vOGebGa1PZmk3c78Wpr7p6oBhNhKxaYtlLbMxpiKrZfJdYFchLfeNcwp9rT1nLQchvKQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5987 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 From: Zerun Fu The 'nfp_ct_offload_add()' return 0 means the result is right while return negative number means the wrong result. The caller assigns the 'int' variable to the 'bool' variable. So the negative number will be transform to 'true'. This will cause an error because 'true' will be regard as no problem. Fixes: b4ae16eae01c ("net/nfp: support to add and delete flows to firmware") Cc: chaoyong.he@corigine.com Cc: stable@dpdk.org Signed-off-by: Zerun Fu Reviewed-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/flower/nfp_conntrack.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_conntrack.c b/drivers/net/nfp/flower/nfp_conntrack.c index 0b21e4ee5b..439a1a1b0e 100644 --- a/drivers/net/nfp/flower/nfp_conntrack.c +++ b/drivers/net/nfp/flower/nfp_conntrack.c @@ -1440,6 +1440,7 @@ nfp_ct_do_flow_merge(struct nfp_ct_zone_entry *ze, struct nfp_ct_flow_entry *pre_ct_entry, struct nfp_ct_flow_entry *post_ct_entry) { + int err; bool ret; uint64_t new_cookie[2]; uint8_t cnt_same_item = 0; @@ -1508,9 +1509,10 @@ nfp_ct_do_flow_merge(struct nfp_ct_zone_entry *ze, } /* Send to firmware */ - ret = nfp_ct_offload_add(pre_ct_entry->dev, merge_entry); - if (ret != 0) { + err = nfp_ct_offload_add(pre_ct_entry->dev, merge_entry); + if (err != 0) { PMD_DRV_LOG(ERR, "Send the merged flow to firmware failed."); + ret = false; goto merge_table_del; } -- 2.43.5