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 E65B843FC9; Tue, 7 May 2024 14:43:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC08043392; Tue, 7 May 2024 14:43:46 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2088.outbound.protection.outlook.com [40.107.220.88]) by mails.dpdk.org (Postfix) with ESMTP id A80884338E; Tue, 7 May 2024 14:43:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iVUKFrZu9pNW1AkXQAwkvAZieC7se+qfD9+tFg+JCq8Ph+aBQlGgvx6fHOdDMIeFEFwyLZ2EDxAIRek6zjoevqHTPqfa+ncu5myNIRmbSlDLA4Y7opZPq5tPHj/76U+VnfHtvaodadmMgqi3v/U//c0xa2d99Zri15fWu9hDVyWTwqe4ZUrxocWMPVMucxjiaNuZeXRqWzphmaFPAuw8cV5HFMS13+ds/ufCELuyf3SxOgCKO98ufgbGKvu7nl5W7b4yn5tkR4/TUPtYLOwLDLiZy4LyR+2sgHtWGl43GA6PB/tY7+rOxanKb7/ISb8QFSyBGyMZDjg8csR7JcO/ww== 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=mai416eg24Sohql0vZV4j8PZvzCDit2VkFpMvEdjIsE=; b=hMHyAHXER/Ld1qdSqiM+V/qsUPISUXSMpnQLBhnYl6B1hhg8EMpoFQlY8o+3zwQPF1YFG/FldpXH1l16W2gEjNeUbUlD3s/o5gN9sozIcXy0AyTm0mBmd29v1BQfGkP13z7jWEM0K0R8tV36gaOxbvMRcmwd3ogVGEZTvCkG+Cgkpa979zr9npU5ZXUfKzWoStHJxXj1r6bzjGSgI6Tth1VYnJ7i3qlxX/FhlaKSXihinxiD+a5g7tDffyEOchJhifK9kIySD5mlgA9zZipfQrHsTZvH0k4IEjFFvDvJzkWvEk8dSWIAAuTKfLNaW6x57We1G8kc/CWmwnZbGRlFeA== 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=mai416eg24Sohql0vZV4j8PZvzCDit2VkFpMvEdjIsE=; b=My9JURk3Fz6KbLexyEhOx8QLW6sXZy2mvU+FoXCf2ZZHEzEyDP92RsD7K9juaXs5qF/+Ke7DpW82KUQgrdT4kK4izhz5tu2l2qrMwW1801raySTUVxxhGQQOJzLCaUJbY2dom0sx6SiOW/02Xo1NwNFMWvQBa40h5+cYjK2DLbg= Received: from PH7P220CA0040.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32b::24) by PH7PR12MB5783.namprd12.prod.outlook.com (2603:10b6:510:1d2::9) 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:43:42 +0000 Received: from SN1PEPF00036F43.namprd05.prod.outlook.com (2603:10b6:510:32b:cafe::7e) by PH7P220CA0040.outlook.office365.com (2603:10b6:510:32b::24) 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:43:41 +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 SN1PEPF00036F43.mail.protection.outlook.com (10.167.248.27) 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:43:41 +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:43:31 -0500 From: Venkat Kumar Ande To: CC: , Venkat Kumar Ande , Subject: [PATCH v2 02/25] net/axgbe: reset link when the link never comes back Date: Tue, 7 May 2024 18:12:42 +0530 Message-ID: <20240507124305.2318-2-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: SN1PEPF00036F43:EE_|PH7PR12MB5783:EE_ X-MS-Office365-Filtering-Correlation-Id: 946f1cf0-c2f8-4046-e5ea-08dc6e935374 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?+0p2OqyY2Jp1CX20F2N6ixl/2Y8tva22XNpE9nmTtR6h+H6wotWO4ZKuQJ4R?= =?us-ascii?Q?kVOSdYulNa2knXrXqdYTrCP6vESFJtgEQVBty7Da794KsJTb/BEWrDHmRKJv?= =?us-ascii?Q?HXpeOrJXkq6zzZq06XqgcybjsOpMFt7bQ/LcNemPY3b5WdFrP1gTUy39aSDA?= =?us-ascii?Q?IBJ+JLTf6irFBD9rqFx8RVl7Xa/K641m3svy9dCVI5RGSnN6GMcd3hu75FkR?= =?us-ascii?Q?Z1ByvajDBWuMGehUb3p7pKvBw3/C5+682IFm+N/TK2ww30OMd+oIU/qnEXyE?= =?us-ascii?Q?b+VQhgDVrC7+CNtLx8q23d+3JYXR43aoeHIoLsYrh7UiQ0+9req6OdtxL9hi?= =?us-ascii?Q?aXpuVMVXs/qhTWb2gBNXsnyG4D1/XFZoDikVxV+hsyaPTIL6kmYabhpdA2Hz?= =?us-ascii?Q?9wSGswffPtUikd0n39JStSVJ/k3pTp9MmPkFdWbf4b5pQccaYXSaDe2vAOhB?= =?us-ascii?Q?XcV/uxhM+pCSt9eR8++/uy4m9BZmEWKagnioDg6Tgk5vkPEXftGs0wVFSxn3?= =?us-ascii?Q?pQFarfDYAAjwDeFLmVr1Fg1ZoMxYgXatQX0/BiF7ZG4t0YocVCf3GgITQVDm?= =?us-ascii?Q?zonGGOm+OimE/MhyktubiWQkG8Jb3+vO89TfxTUFN+Woo7/+AhsKc2WY/DNx?= =?us-ascii?Q?RkHoB9wfzo+FcJQCbHr4HN0Ef7swvv0vO1g6CBOFA0jvP1yw9vwqIAGIxTZ9?= =?us-ascii?Q?SefW9NXRDB5pDG163DXKOcC4GMVsHHNNuCJFAvnvVcuCbdrCqHod9a2ML1JO?= =?us-ascii?Q?but4r8JF1L4UZ7rQTyFveiKKltqEpUF/c9RokQpsZcwPapDE8GrRoTXJum42?= =?us-ascii?Q?vn3Q9Bh4SpfGCRiW6xKNhLVsWtor0zEVxdL0Z5rT3HbPjYNVEf3ocf4J3Jx0?= =?us-ascii?Q?9BgsaJ//itUg9er/29kAO3ym33xxEV34fLbSpQAQt7ZZE1kM1/Eyl/EEUFOA?= =?us-ascii?Q?q5Z5PWR8MeuYgRRuoi9UmfL45X9GtC6aISj7CuGo6pi0VgLuozb5U/LNfG31?= =?us-ascii?Q?Db2iH2PQBTIp54B7ePhk6IiAj+ltb8KcIg9OEypEWHRvzFwLbnWtdxaimZE1?= =?us-ascii?Q?tNIJ7q/LgYuoRFLLJ05tfKTnmESRz3IMd0C4rUEcWNROGDMjTOCWphjyKUH+?= =?us-ascii?Q?IMsRNFWn0A/8h36ny2NoOuidpYs56HDAUGHuxc4nYQ5JIEwPVgv5jv6DKh+C?= =?us-ascii?Q?EZV+1xumbaJWDdWHVt3bMCunvo6atWa87boFL9QoScFQSCMWxn0MeQLh2GSc?= =?us-ascii?Q?7c0TQDYJH/pDxHNcV5grd57+903eWc/SOBa6BIh3j8sQD0OpUpKaIkJkgnFM?= =?us-ascii?Q?aRtPWWwyFhN9Gco4IMUv+PgBSiEG4XVKDnnmcSSk/AEWgOpZ1LC0332rGndT?= =?us-ascii?Q?HO769e1zEPMJxAdBOAbiWyt5Vz0W?= 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:43:41.8560 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 946f1cf0-c2f8-4046-e5ea-08dc6e935374 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: SN1PEPF00036F43.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5783 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 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 --- 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