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 CF7E045B17 for ; Sat, 12 Oct 2024 04:41:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB32540268; Sat, 12 Oct 2024 04:41:48 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2129.outbound.protection.outlook.com [40.107.100.129]) by mails.dpdk.org (Postfix) with ESMTP id AA66A40659; Sat, 12 Oct 2024 04:41:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tgFvmGl07QaGLCTFUuQLyOs1xUu7aGmJ8XelEj280IyYBJoj5Y8CL2d8G01pGfRIxRS/xR6e56vo3TzxEcUlCE0jmGHAqzIB9bk/akixfMdrzj21cqZ4yFrhDjWDDBthsphxjw2VsuoNpKvNGCuUIQTab+lZE0qFYEkdK4WOfNJErNPCbRTxzBjEG3zRsvBAHV6DEV9OJ0Qbvx9fRyiyDD6dZxLBewMyUuBBoymy1UqPmqOsAkvKFULhqDf/+lwPc/isWV7XlD4BOZKJhTCfJh+27Lduz6y2AqlFXUvdAj4v2fiETKjEE589/anxZ6kcxDuHOB1XOYEUOiyj+nRnrg== 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=ZX2kJeAeI+VzUH17rjJSLch/wo4XhfRXTpRaMHseAkU=; b=OVpDeUGH/FMYBKgnMAtD2HUMfKp0klP1n+xqpfLz0EH0TRMV7ce0ozm9oqmJCnyXmCRfucvb1Y5azAl8KR55/JE3wYMyMEFl1DODJWwaKV5GrQWTEpogA1FXFHN3s7578hP8T9gGpN+sMg8bmMwwFNl6/5W5mKLQRmEhBPppN/XMeYrb5Umj9SVbxyez89kLY/S3Q2pCrB79lSODknE+WX/h5GcxdlsSo055TIhrwSrcBNoA6lO0sdqqsdoEefVnLQdVtjhu9hp4Vojf+Ik9+tCA5enCKkzKA9F/vD7AxNKm0X6HMrRLaG8RK4BWWtcOfBj79WTSt1f0OMxoar6m7w== 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=ZX2kJeAeI+VzUH17rjJSLch/wo4XhfRXTpRaMHseAkU=; b=BPT1s2l/K8l43ltekwYtx9JMDcF6W209bB1qUzzo3jp0kZvlj5QOE3Ja0QLzPiKniniI9WmXCQuvhGpiTq9ILr5FLQujZQfKdKrMmmLdTj3kPP82LVuE6tQEAof5vBWLlw/JDT22nBFkcTWb3fPX4W85tshvel5wFVxZCrGmEng= 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 CO1PR13MB4902.namprd13.prod.outlook.com (2603:10b6:303:f0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.21; Sat, 12 Oct 2024 02:41:45 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8048.017; Sat, 12 Oct 2024 02:41:45 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , stable@dpdk.org, Long Wu , Peng Zhang , Stephen Hemminger Subject: [PATCH v2 05/10] net/nfp: fix problem caused by configure function Date: Sat, 12 Oct 2024 10:41:02 +0800 Message-Id: <20241012024107.3795935-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241012024107.3795935-1-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> <20241012024107.3795935-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR06CA0001.apcprd06.prod.outlook.com (2603:1096:4:186::21) To PH0PR13MB5568.namprd13.prod.outlook.com (2603:10b6:510:12b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CO1PR13MB4902:EE_ X-MS-Office365-Filtering-Correlation-Id: 29e6c94d-d336-45b8-e9ca-08dcea676968 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?w0ed/7BVQU6uCpEcq8yoNnka/mE81XhAJhh+zP3Cjzg39k0Vm2f0c2NYkQLL?= =?us-ascii?Q?fDXGiY1WCUSSUGcL8S9eGREjK4p+ZtL2wLbWnDWxWEX34bfwSiD+xey2kydW?= =?us-ascii?Q?grPbPlUxE41CaxStDNvrv+jIRYWLZFduVuSa59pCwRCV+XH2D9tmYHUshUEV?= =?us-ascii?Q?+g7c1RwnMXfHV5+l1Ecero/bAqv9Kh8OpajJVJ9qNebk/uHxjYlP6yYE7Syf?= =?us-ascii?Q?8XrxNwGccjYJz0w9cL5mko5ovJMnieoYTxQmOaYsy/UDqtCErtviB+ae475+?= =?us-ascii?Q?9lQB3ER/joVkOpjHmuzKMbpSoTXUVCrrFMHxVv37Ri8RrZmL7dDOiEw/q5MT?= =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1K88b6pFTBKdkPcS8t9V/nfzg3/doszkDIupVp?= =?us-ascii?Q?xYhn2DsXg9xnzyxHWlGQEgz60bGxzi64hftSLj6RS1RJLuR54cxI4l01S9EX?= =?us-ascii?Q?I73kmTvFV6HIsgo/GQVrl+oW8exyA6VtetTjdShJIpNQBw=3D=3D?= 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)(376014)(366016)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4inRWkYQZ/xPQNFu+QJftE0K92PUqfXTAo2XHQANFji1eC4cyqEOa3gyRIii?= =?us-ascii?Q?LOgt+Q1Affg+ET8Puo6GELVC2qx5ysfG71gUPGcrHZFPDt1XGCduLOz2GI+5?= =?us-ascii?Q?iWxa+OP0F3whJcAeYSwLRIQeRUpqDguvKoC/WqLhXI4hVKaWUV0RQAZ0hr8o?= =?us-ascii?Q?oNylh/vhSvLyCl+Ex/2olFQGgU1IczjjbFr/nTh3N4zN8sgHw+rLEP6iabiB?= =?us-ascii?Q?Zgfmru5vjdWdbuekymiGlG6edvUxYUoSjpuJ4Y8LY4m+hKJWZ7fgT+kG/TP4?= =?us-ascii?Q?66rveU49JsFfPWb4oe/HiZBJ/CuCapM5hfSRae90et5nLYhZJKjTIGogWGt5?= =?us-ascii?Q?pE8yjxHKy19x88LOY8WkNyYnKbq9jceF+ScdDSMRWajNEvseFEJkHKZfZcm+?= =?us-ascii?Q?8Aa92D+s8SlUSD1mCj4TUxtxc9lD/B+ijDlVsNM/u73azRgh6cs9pv7ekcsJ?= =?us-ascii?Q?tkNcIhfrGPsGR77W7z+OIaYLlJXpo5tKwAa3hOTAo9OqY4ZD4yygTlBrpFV4?= =?us-ascii?Q?KMlo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9oKlbd9EVrIAUauo?= =?us-ascii?Q?fGIeVg+11wA9iMXADh9ldRCFYvjY0tuvg02HxbzIhiJ6u5/1Yo1lmEHpDZlN?= =?us-ascii?Q?ZVlgvQ++SzvbNUEALOliGx6aDaSETemUJZgr5PJj8q5iFCJRA9ZUXXoCOr+R?= =?us-ascii?Q?kbA6kDPKk+foGI9f6qR3FZfB9jLte0a7b9pa4w9z+dU6rkFD2axQi87LQD3g?= =?us-ascii?Q?zg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29e6c94d-d336-45b8-e9ca-08dcea676968 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB5568.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2024 02:41:45.3955 (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: Wn1k7HazrSFwlHXvMD0OfBU83kvizDz1OSu4RPl8UIcI96SFFyTf1TaDE1VYjJjx2A5kFRH+6KIoIBf3Aian34ivIZFMKlVlTIxH41QST7k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR13MB4902 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 The return value of 'nfp_eth_set_configured()' is three ways, the original logic considered it as two ways wrongly. Fixes: 61d4008fe6bb ("net/nfp: support setting link up/down") Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang Acked-by: Stephen Hemminger --- drivers/net/nfp/nfp_ethdev.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 405386e882..2fe6b1a292 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -527,26 +527,36 @@ nfp_net_start(struct rte_eth_dev *dev) static int nfp_net_set_link_up(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; struct nfp_net_hw_priv *hw_priv; hw = dev->data->dev_private; hw_priv = dev->process_private; - return nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 1); + ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 1); + if (ret < 0) + return ret; + + return 0; } /* Set the link down. */ static int nfp_net_set_link_down(struct rte_eth_dev *dev) { + int ret; struct nfp_net_hw *hw; struct nfp_net_hw_priv *hw_priv; hw = dev->data->dev_private; hw_priv = dev->process_private; - return nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0); + ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0); + if (ret < 0) + return ret; + + return 0; } static void -- 2.39.1