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 5D71343FC9 for ; Tue, 7 May 2024 14:44:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50D5843410; Tue, 7 May 2024 14:44:44 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2055.outbound.protection.outlook.com [40.107.92.55]) by mails.dpdk.org (Postfix) with ESMTP id CEDFB433C0; Tue, 7 May 2024 14:44:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S0yDblOMXvmGMQsNJrxHM0d/8mQr3u/Lo5l8O/1txnnnFZXdp9WyhQet/06YZ3EQJranNsxey3BGzlfXrrfMMilHO33E779O65XpRYXUCTyIlvso8AdRdNWiPXE8rj189VHhTtashvc15EbgD6FCJE4LFouAH62jF+XuPUxdVLBkW/3b/2GPUxcrFOVyrAD28eg95vErHMw12rGjfcCG5q52OxaVUuuamtH3OIsMIYmovTTEqtRN6P6WRitKEelerBH3uvqjhAul9HQ3wGKTczyNBxeh2meto4Lf/w6YZRVqjn7/ofntFZrxvr2myrweBXtQ17Bvs2EkpCDsNRAmZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=daOCjbN5Y1j/CO3DYdSNbANIUhg+AgINEDMsQKPOXu0=; b=EOK41WZBfGWWFizClolbyWVPiGahWeFsQIjRM8fOLF3ldcRWNX+5YiiqAdZ7rtYclQhAlCocCNUAwuiPLaF5NdnOSmeUT92tEV+BzA3oZd0RxKgfMrTNiCH9ir1XnMm35/JLShYbse/j2sKt7FjFypbjVA/6uJsWT6BWG2Lq+KLtPPgg4KmOPRi8ycXJoxP2n1iKux8PtIZHOthS5mp6jsGp6UPIyvczl53qnKSxPu3Cs1Er1eIfcPEVgd0L9nXJjNzqG9yNe28csVfxMrty0Il90miH85k8AR6tvbUa6WFZzqNyqiEHjmUVhinDdWeydSeq9PdzZ8zbcTrM0Y1G+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=daOCjbN5Y1j/CO3DYdSNbANIUhg+AgINEDMsQKPOXu0=; b=NOF1ybdqPzrJ6IIXjhkf4W5MovxLPxnG+8K4sbhedHiqaWyYrQTyP/jmsDfz1d4dce9v3owdBphLwtQKB7GjrGd6aHs6mA1DjbzbueRdZBupqtMskRo1h5Cy0c5sqQHDf7hrZ5pc2G5wgYGJHqrO82APpUuUJS1abgJjTxQ0iWM= Received: from PR2P264CA0002.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::14) by DS0PR12MB9039.namprd12.prod.outlook.com (2603:10b6:8:de::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Tue, 7 May 2024 12:44:37 +0000 Received: from SN1PEPF00036F42.namprd05.prod.outlook.com (2603:10a6:101:0:cafe::25) by PR2P264CA0002.outlook.office365.com (2603:10a6:101::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42 via Frontend Transport; Tue, 7 May 2024 12:44:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF00036F42.mail.protection.outlook.com (10.167.248.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 7 May 2024 12:44:36 +0000 Received: from cae-Lilac-RMB.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 7 May 2024 07:44:28 -0500 From: Venkat Kumar Ande To: CC: , Venkat Kumar Ande , Subject: [PATCH v2 23/25] net/axgbe: fix the false linkup in axgbe PHY status Date: Tue, 7 May 2024 18:13:03 +0530 Message-ID: <20240507124305.2318-23-venkatkumar.ande@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240507124305.2318-1-venkatkumar.ande@amd.com> References: <20240412125013.10498-1-VenkatKumar.Ande@amd.com> <20240507124305.2318-1-venkatkumar.ande@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F42:EE_|DS0PR12MB9039:EE_ X-MS-Office365-Filtering-Correlation-Id: f15f7a07-76fc-4103-00b2-08dc6e9373f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|82310400017|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?O7/NW0y5wlRHJDb/7bNg3gk3xGnthEZMWzdhZo9guXsnLpEB/S1oZ/fjpmsu?= =?us-ascii?Q?+B5iqaeST7hkV/yZCStXRnVgJFSakEmTAbRra2U6oITzrc3KhQ9WKY+cb3XY?= =?us-ascii?Q?XrA3Lxiv3IOa474bfMJGx7wukrJwKnpB1zU04P7eX5tuAyX+W91xyQeTQn5p?= =?us-ascii?Q?KlWdYdWb67FDlyicx80q8JdeH/8v6MSrLqRyCEveBlB6El2zgLcmfSXA11W5?= =?us-ascii?Q?YvThAQ3wftZ3hVMeoSTUkTTWGdRaHRTSh5f8AKy/x0mekYJMDsIj90sPgykj?= =?us-ascii?Q?spPHkOUfq+cYB29uWfHZ0oTyWSJMnOcJy7LgCdb1rRWof7AdMNYP7J7luEbO?= =?us-ascii?Q?UbqltfmlTK3iXJryoNZXTPQTlBlPA2Q4GbJ/BZUMesj6aHoh1azNv1jeFtWa?= =?us-ascii?Q?FqdTxWM9Jln33d3XJb8uMq8xnjkEYpInjJMPysntJd2CspZAzXs7qR3eUBUU?= =?us-ascii?Q?P4BqwLpz6EHtp4z6gmKs6qhqyX+phTf+/jgxj72aqPOdj4/Z1+nLU8QGRtgf?= =?us-ascii?Q?5n5Q7Bb2bBEYdKdvwhDszPWTdE4OiacmEk3Un0pVSX6UpbDC2bpzgdRA9rOi?= =?us-ascii?Q?ZOKc7pkR8GYC3xj/GSF4IgpjCqf6zTlC1WK8/KhKtBsn6tFJ1pCJQKRlay6m?= =?us-ascii?Q?cBHW3OmPGI3u63reMOEWei4alW6rKLUDw1TJicTDnDYjTBH/dIuE0I1EXx8p?= =?us-ascii?Q?hG1TwxY5QbAEpypy+YPpuLlvXIp7zGffciofhzX3G2P9z7tcVMebxerEIcc2?= =?us-ascii?Q?RejzZd/+G1MyIoOZm2yIPoxZLknxxf5xo+VYdcb+CB6QAA2Hv7Rde1N0H5HS?= =?us-ascii?Q?PnoIofsYA3SfvTofU1B2DeIOXf61ynQ2O7Grf8H5AWnRypWUwjKj+pYpU6jc?= =?us-ascii?Q?QTAhi5ZYKkuifH69JvZ/sRmF8tPfiFpDxnEM1Le5PkYowADgxn5GzyrgG07V?= =?us-ascii?Q?OT/dp10Y4Bu4b8vqmkKXOKtWsBo4LGzUsjhD/j0Cu/JioYxtpTM+4FsY3cRm?= =?us-ascii?Q?3yTx1f8LaDVjTQKfxAB6UM5PYIBtrmhWVBExlIQEEI5Z83oFw+2KeNO+IeqE?= =?us-ascii?Q?tCqgEqkhOJQYfvDngHZ865jKahZPWNBDxznqpUFnv/P1z1Lk7r43Lh1ucZJT?= =?us-ascii?Q?dMcWI3+go8mR3Qd5xCs2c5m/ANZKr2auz05khJRluMdRunXI0fqbJ2p0G4R1?= =?us-ascii?Q?Ua07nEMPm8YJ6POU3eu6RrfqILDzvtUDa1eFDf/kVg8k5Usm1X3sw7oV6AV1?= =?us-ascii?Q?Bv7SBcgC2ZKENhJ0VhsXtFPlEIxXOaX9iUrch6SWg4LgC+Wyc1ebOUIIJ/Ck?= =?us-ascii?Q?F+atW80hcgUPaJ0rXiEOHxZkYGjytp7f3Xy3QhrtoYuXt4fmtODru90In6Od?= =?us-ascii?Q?7P4kPVrzF6dcm43lQUTyNnl7XbDD?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(36860700004)(82310400017)(1800799015)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 12:44:36.3801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f15f7a07-76fc-4103-00b2-08dc6e9373f7 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00036F42.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9039 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 In the event of a change in AXGBE mode, the current auto-negotiation needs to be reset and the AN cycle needs to be re-triggered. However, the current code ignores the return value of axgbe_set_mode(), leading to false information as the link is declared without checking the status register. Fix this by propagating the mode switch status information to axgbe_phy_status(). Fixes: 102b6ec3d5c3 ("net/axgbe: support auto-negotiation for 1Gbps") Cc: stable@dpdk.org Signed-off-by: Venkat Kumar Ande --- drivers/net/axgbe/axgbe_mdio.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.c index 9fe30e83bc..130a67479e 100644 --- a/drivers/net/axgbe/axgbe_mdio.c +++ b/drivers/net/axgbe/axgbe_mdio.c @@ -1028,7 +1028,7 @@ static enum axgbe_mode axgbe_phy_status_aneg(struct axgbe_port *pdata) return pdata->phy_if.phy_impl.an_outcome(pdata); } -static void axgbe_phy_status_result(struct axgbe_port *pdata) +static bool axgbe_phy_status_result(struct axgbe_port *pdata) { enum axgbe_mode mode; @@ -1065,8 +1065,13 @@ static void axgbe_phy_status_result(struct axgbe_port *pdata) pdata->phy.duplex = DUPLEX_FULL; - if (axgbe_set_mode(pdata, mode) && pdata->an_again) + if (!axgbe_set_mode(pdata, mode)) + return false; + + if (pdata->an_again) axgbe_phy_reconfig_aneg(pdata); + + return true; } static int autoneg_time_out(unsigned long autoneg_start_time) @@ -1133,7 +1138,10 @@ static void axgbe_phy_status(struct axgbe_port *pdata) return; } } - axgbe_phy_status_result(pdata); + + if (axgbe_phy_status_result(pdata)) + return; + if (rte_bit_relaxed_get32(AXGBE_LINK_INIT, &pdata->dev_state)) rte_bit_relaxed_clear32(AXGBE_LINK_INIT, &pdata->dev_state); -- 2.34.1