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 1BBC344153 for ; Tue, 4 Jun 2024 14:12:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1754C4369F; Tue, 4 Jun 2024 14:12:29 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2084.outbound.protection.outlook.com [40.107.243.84]) by mails.dpdk.org (Postfix) with ESMTP id C90D5402CD; Tue, 4 Jun 2024 14:12:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nMZACemFxLINf6AkQpLKLDHvMk1LyHe5Q5GL8pfBN+66luoP8kVO2TsXFzi5GC5B9RZtbX4KxxcQrBv2fx6b4fwOg262CzB8vI7Rdwa85Jw7oHeCeZarKnXYJMyVe+MzdmzC3OdVzgSpvaNDfAG6xkVJMZQoasMaMNBKIhzU0zrJ2RsMMgALyUCa1bhCijHZ4VB3l6lg0Ei0bueKN/hjrFbunOTqqG/Qg992hAe017mOB3fwyIjMLbQIfjNyRKaPI23Jrejfl61K03Ymk/cjmNliQYBEyQnwSjFJOyxc1hQPBF683kugbAC+SP+kS6IYFZR3lF9mbcbeLsHjAPzFkw== 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=VIEj7EaG65y1/6+jI3ry4eZcWMLptrsGo0vUaELcrGw=; b=e3QkKzZyCwjRY49S+WfP+PT5EUqrv5QDQC1WClweK2mpxz/omoPDJRq1gMZrpRjQJDXgwi12+52e/MDnC4MVO6QfTkWJwyAsZHSWXDvMW5BBkReIW94Hd8rtq8ANMtnxgoWu37qoonTfgSfVdNKcoNZAq6ThV+yk1BO11EAYcOzJnBTx5bf8dYb+viG4TpGbyoviXKq9p6pIh0MnhUwgSx8LeA5Y/TGLQaiide+42RYY9W71TGa9vDdft77zDgcLRdVXcTlZXkAPqVlyhFuW9PGi9Dc4obSXZVbakBxNho/iWfIhikn0xXhWRNm3+MNcU6Bzib4dc4UZj1zhYSq6gw== 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=VIEj7EaG65y1/6+jI3ry4eZcWMLptrsGo0vUaELcrGw=; b=mmNLLEAHEMeatdPkkJzXw1PHhbE1Px92KMNMffTzis8hhnTwXBTVH9vLUo9Up5BCM7IwJ4zcfLhlZdsMsjhTIks3Owoj6K6mUtXtMIb29alf72Pc8XmEstzaiyIcDrHgUlXEGZJeYuF+dFTrryRzgw2WqNp6qDuZdex22Pxe5eg= Received: from BN9PR03CA0935.namprd03.prod.outlook.com (2603:10b6:408:108::10) by PH7PR12MB8014.namprd12.prod.outlook.com (2603:10b6:510:27c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Tue, 4 Jun 2024 12:12:24 +0000 Received: from BN3PEPF0000B36E.namprd21.prod.outlook.com (2603:10b6:408:108:cafe::ce) by BN9PR03CA0935.outlook.office365.com (2603:10b6:408:108::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.27 via Frontend Transport; Tue, 4 Jun 2024 12:12:24 +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 BN3PEPF0000B36E.mail.protection.outlook.com (10.167.243.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.0 via Frontend Transport; Tue, 4 Jun 2024 12:12:24 +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, 4 Jun 2024 07:12:22 -0500 From: Venkat Kumar Ande To: CC: , Venkat Kumar Ande , , Selwin Sebastian Subject: [PATCH v3 02/25] net/axgbe: reset link when the link never comes back Date: Tue, 4 Jun 2024 17:41:34 +0530 Message-ID: <20240604121157.3052-2-venkatkumar.ande@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604121157.3052-1-venkatkumar.ande@amd.com> References: <20240507124305.2318-1-VenkatKumar.Ande@amd.com> <20240604121157.3052-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: BN3PEPF0000B36E:EE_|PH7PR12MB8014:EE_ X-MS-Office365-Filtering-Correlation-Id: f0504d52-507c-4f60-fae1-08dc848f97be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|82310400017|36860700004|376005|1800799015; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?O5pwte1CsmxkgspiS2r22RqsZGlp4mT2Uy7/Df8GxbiHGKFiz1+FfNRurBXg?= =?us-ascii?Q?gAUVaqxL5w298h2YKXEiZYxXNP+V3Y92pTk/tI8JLTrO1KN9H2h4DZ7RnJs0?= =?us-ascii?Q?mKbdV4cry5SuwuMB2X/Ubc3QAm+WWFzZBbmSsZgY7DgfdNxEu6xF6vV/8ZIT?= =?us-ascii?Q?PVZytH0FTP6xUlxIZKKkXyqOO/U79KuDLsIujDEyrYbOFM+wqXTK+RxdWBas?= =?us-ascii?Q?YregRoi25Mf5ScgbdnRmtB7KeB1W2IZ4aVoWhe/9jw3G5op8+JxWRSTy/QKo?= =?us-ascii?Q?HiAlALrlNxKtf+xMYGoz0UNr49KodV8+Gs2oEO3dgo88QY6FJ6r3am4G9Y7t?= =?us-ascii?Q?zcqNJCHRQf8txeAgjPhkJBg6YP1lvMRRixIbEqRynZOjzbO5JXI+aJfvBh7x?= =?us-ascii?Q?8HATFzmkFQxu3KpaGusOHdiv4Bl8HhRvF36r3obZXBR/fqbHTBAPrHt7D2q0?= =?us-ascii?Q?OoNepymdUG9C2WvqqUfUspbSI9Yvb22B1ylp73yu6Z6EUepxcX9ANz0gM9x1?= =?us-ascii?Q?2iugeeBwVE/tV3ORNxMgwdYWddacHVtL91QHLhtQwoftUr6hp0dw6I5FEY6S?= =?us-ascii?Q?SA6uOwkxrV7/rYv7GC/G1IdxOdCzEMMNtITIrBN1LKlbBOHzMrY5e6vLbqaG?= =?us-ascii?Q?XGHYHdTMWHrYXrMu3I3hjT+CVfA3bpCaj3TkTsAXbNqVA2dZ9jDlEIgUQluU?= =?us-ascii?Q?Opn0WuxBZZxMfmvTLzJQCjoJF23IexhqEgYNX2qUl6qWgB84gZpUJav/XHSr?= =?us-ascii?Q?rVzxfSGmxMzfaFuGOoTsVWeYyCI2hFhdlsakDX6PuTG9+0GynABJZMpiU7SO?= =?us-ascii?Q?ZtUq2d6nxRa9o1tV4eVS9QbLqUULgDcLltWsGSwkCQW+VYUv2HlsdaPD40Eq?= =?us-ascii?Q?Kz+by3IzdKB1ESn8HV9gdp0zIa5mrNzolGN41OjNzHvFISBYfEsTkO1968TB?= =?us-ascii?Q?KRSVVWe5uXKIp7kVIFaQw2P9VRuDhGOgAZmwogTy5m4rLpPrFJCw89IoU1HY?= =?us-ascii?Q?L/rqXfS/nSYiD2FnqNfUAPQYZy59s6BPf6yI09Vp9ApTO7Ma0aJZ0eY27D9o?= =?us-ascii?Q?+SzRFNW9X+R9WDgRXEq1LJQXblLuC8VOACz+bLcReyHwybFYR/+cj12+w+bm?= =?us-ascii?Q?m+E2gLphQ9J8enSq1lObQmojGHbLOCPcgRNrAN+iGv6VyEF68Hsl+ko2wJFQ?= =?us-ascii?Q?0dGdMeo05JIsfi6xNvwM8XabsIySHYov81bjHAAPR6wnRhb9mnLOREmxSMRs?= =?us-ascii?Q?VRe9XdJm3X/ghMpC+0BAgAkb4vu76TZuvYRTr69I6YW4+DCukIfAGSzYgsQS?= =?us-ascii?Q?u3lFdQSdz2HQ2iD4BqEOqwyEoxWFzgDgqs9edqqvi7Hp3t82bIDeSX+cRqwb?= =?us-ascii?Q?aHSiF6YUkoOQ8Z2lN2sxGY9fVI1hqLb3WaVrbxgYqAMGpPJiZw=3D=3D?= 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)(82310400017)(36860700004)(376005)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 12:12:24.0364 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0504d52-507c-4f60-fae1-08dc848f97be 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: BN3PEPF0000B36E.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8014 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 From: Venkat Kumar Ande Normally, auto negotiation and reconnect should be automatically done by the hardware. But there seems to be an issue where auto negotiation has to be restarted manually. This happens because of link training and so even though still connected to the partner the link never "comes back". This needs an auto-negotiation restart. Without the fix the user will not see the link up status Fixes: a5c7273771e8 ("net/axgbe: add phy programming APIs") Cc: stable@dpdk.org Signed-off-by: Venkat Kumar Ande Acked-by: Selwin Sebastian --- drivers/net/axgbe/axgbe_mdio.c | 2 +- drivers/net/axgbe/axgbe_phy_impl.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.c index 913ceada0d..b03bc471cb 100644 --- a/drivers/net/axgbe/axgbe_mdio.c +++ b/drivers/net/axgbe/axgbe_mdio.c @@ -1051,7 +1051,7 @@ static void axgbe_phy_status(struct axgbe_port *pdata) &an_restart); if (an_restart) { axgbe_phy_config_aneg(pdata); - return; + goto adjust_link; } if (pdata->phy.link) { diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c index 44ff28517c..54fe9faae0 100644 --- a/drivers/net/axgbe/axgbe_phy_impl.c +++ b/drivers/net/axgbe/axgbe_phy_impl.c @@ -1697,6 +1697,13 @@ static int axgbe_phy_link_status(struct axgbe_port *pdata, int *an_restart) if (reg & MDIO_STAT1_LSTATUS) return 1; + if (pdata->phy.autoneg == AUTONEG_ENABLE && + phy_data->port_mode == AXGBE_PORT_MODE_BACKPLANE) { + if (rte_bit_relaxed_get32(AXGBE_LINK_INIT, &pdata->dev_state)) { + *an_restart = 1; + } + } + /* No link, attempt a receiver reset cycle */ if (phy_data->rrc_count++) { phy_data->rrc_count = 0; -- 2.34.1