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 871F944153; Tue, 4 Jun 2024 14:13:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F74A43695; Tue, 4 Jun 2024 14:12:50 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2083.outbound.protection.outlook.com [40.107.95.83]) by mails.dpdk.org (Postfix) with ESMTP id 73841436C4; Tue, 4 Jun 2024 14:12:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SphAuBakzamPklllFPIjzy1jIIfTh8fCAc6nSsR1E1t1eZ15JmemMM05YBfWyebHeulMLDldEZxjm3mmp9olwRwof5X+NH0jP72jdFrgeVYMC6U1JdutrV5F6tvE5vV2Fv17Uh7bdugCe9u8Gh6lonXck8a5rukgvKK9hqSjl8tNm+y01nEnrjU9Hjkdc/yESIzM6U4HMv3SFUVmv50qKGygQ292RVs+71mOs7F3n6tOfZAR010Fo02TfzZc82Fn9OveYiNxmAouFJh/c/a6luQ3SWvTSsSjygcLoUxjzPNUBR60VuYkUhs6Ud+xKKLjxAgCsY2J1JukRU8tq2+Vwg== 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=vP/pRZzs559+E3yunT3SKpB98J+FFrGVX5Yv5XKA39I=; b=OH0cCieIEr8Hf5CNVbawDqIsutnB7d3mXoczh4JZ8hQ/8/vFSII+yfOFd56aD9yUjl4EtahU0ZxRXit1nqhIExL10c9Tbx6Mhlxlj/JlPNsPAuUpomnqX9LU7Q7vHYEToLAMMNZq4qC1EJW0VGLa+JvRzmW3NYr0aYQ4AfaN1fnfob282jFSnxiqQTDfyouQdzUFQkJKz74sd/S0oGcZ1aiI/6kDY0q/LSMglCXmemxaETNs4WwK1pa7GO55H/1aDYHNjAg1/TlYn0Ug2J0Bss5dAvDh21XuFCryebRBIxka0W4t+WImXUPcIIISSBR8kPRqHyEnWqY8d0pAyuBffA== 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=vP/pRZzs559+E3yunT3SKpB98J+FFrGVX5Yv5XKA39I=; b=zWA+TJ1fYnvZQrU1RhDw8tsnBnRpx6+PORsDwlckapL4y8aPgRK0kj18Ty877jpRYUsadXAbDTW0Zci9vLA8yLWhLS4qruxdpEtagi9SfZ/gyygI6R/dT8uHbV7sqHp5HQclV20bgo/1aUAsqI6fkL5PAcIVcS1JNZWr0s1HV+M= Received: from BN9PR03CA0943.namprd03.prod.outlook.com (2603:10b6:408:108::18) by PH8PR12MB7424.namprd12.prod.outlook.com (2603:10b6:510:228::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.24; Tue, 4 Jun 2024 12:12:44 +0000 Received: from BN3PEPF0000B36E.namprd21.prod.outlook.com (2603:10b6:408:108:cafe::76) by BN9PR03CA0943.outlook.office365.com (2603:10b6:408:108::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.28 via Frontend Transport; Tue, 4 Jun 2024 12:12:44 +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:44 +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:42 -0500 From: Venkat Kumar Ande To: CC: , Venkat Kumar Ande , , Selwin Sebastian Subject: [PATCH v3 08/25] net/axgbe: fix the SFP codes check for DAC cables Date: Tue, 4 Jun 2024 17:41:40 +0530 Message-ID: <20240604121157.3052-8-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_|PH8PR12MB7424:EE_ X-MS-Office365-Filtering-Correlation-Id: b3729aa9-2e0a-4ba4-91cf-08dc848fa3c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|36860700004|1800799015|82310400017; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?y4YU7gux+ylPCDNJtVn19IrWxrxPZ11waiXaZCtXmjgTU7fcXSRLgtxxZrjX?= =?us-ascii?Q?GKKQTkcvNE+Gm720eSKcnA6Kra0hZd3KWpjV8pJn3a4Z2U70cLU9RilFMKnG?= =?us-ascii?Q?sRnrnrr3sRq7Rr18zblrhIvnKGTFXIHANSCU30SEFfIXFdEGVk9zSYBg+Rpe?= =?us-ascii?Q?EJZjGQ8W3qqm3NzWpYde1pr0sKgoUrlop1NTQTtvEDlLXdDx1VB9NqMMQbYn?= =?us-ascii?Q?s4lZgwEC9h4F4qxvtCUDHLo8aS+gucvu83GQVzeEQvBE7jVT9F6Lykoj5Uy4?= =?us-ascii?Q?dn2GRE2fiExTdPxtyI/hiq0O8ZlKCk5mjOKTrM09egYrbVcIQak1+xlFQ0MK?= =?us-ascii?Q?wUP4oa8AAtQ8jLjoPx4J8rGSQToGAqE1CP4WMIdzwqVDHPQKG+6jy7BC7y7c?= =?us-ascii?Q?qoLFFmQVWDeStg8IB7l1jDgQ9bIhCtXPHmoOenMl5oi/+kYxdM+3qhNZq7aX?= =?us-ascii?Q?h2nNhTuwY2tZlTTEhAVfMv6TarW1aTv3wP1n5buuraK2E+B9e+zRlF1hezMA?= =?us-ascii?Q?/9u5FyOHscCxJHkTD+ixzvTMeTteur83GG/jbBqoLP3bpiMXkfoYIF2bKo8m?= =?us-ascii?Q?DBtjahKYjrucTELxHu001kG3LCQS+MvEYuG8O5gLWPjdBVnYxWLdMK/dHF+h?= =?us-ascii?Q?F/IaXk6D6lUG8jOmAkE1VN83uLr5RmTSiDMNYxWe3OfM9AW+QUWUJrE3X2wa?= =?us-ascii?Q?pcdsYizLosCxdHK6Qww+pGYoucFyCLQOzgUQI0fkJuDogJec54uQ55a0dpnG?= =?us-ascii?Q?SHHaAZRJblyjtphZpvSwbGBPqJnEb71pazsI+eDqRe+8zO0td/+SUVl/JKSQ?= =?us-ascii?Q?Yf2c0u1QokfncYnTqjnJXeFNYjXPZSmGEzctt0hy2JSNoFupMHB+ZT6PFUl6?= =?us-ascii?Q?Zne1YxjhnKo+i5SciGMNsEdK044YGS1qrCpCdypY2UDDiQXxb61PkXkYkin2?= =?us-ascii?Q?1IIbKfCV0qSTaGNh7y2uvJuwmwrFrckRON5jBrjbBRvYnQeHK82aHbbyZzsg?= =?us-ascii?Q?R786bhtmiBBrSIQx4Gae5NjOpN7B+v4XRU1+3fTBpsDmqC5/a07w/V1AJT5y?= =?us-ascii?Q?OvxMokJ8CUfn50DDp0r52wESBpR0Gk4gHFiJ9D7Z0IEHMAB69fy5ShJAp5AB?= =?us-ascii?Q?Gpo9eIgGRJvvXAAh42Z6sgByZPobnKk0vZTYfU9AiLFT+uji/7FfzyiDFEC9?= =?us-ascii?Q?aRsRJY+OUdahzouKgEQCLERBAz8Jz52dd0hyfcLYu5INRwC0K3LfMuyk/2iw?= =?us-ascii?Q?ZPqrCeErZxGOZK4ZYbwN2snmxKWBV6PiDbldC+GIYl4AaFdNspELm8QusdyY?= =?us-ascii?Q?KCZ85wHxR+Rm7GDLVEiAZs3V2zNHraVSD9yWk666PGZXvTR8lBY9lUSMxXo1?= =?us-ascii?Q?sHtdCnGSgCNNgK4F6Rwnh2gPwGQV?= 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)(376005)(36860700004)(1800799015)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 12:12:44.1926 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3729aa9-2e0a-4ba4-91cf-08dc848fa3c2 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: PH8PR12MB7424 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: Venkat Kumar Ande The current AXGBE code assumes that offset 6 of EEPROM SFP DAC (passive) cables is NULL. However, some cables (the 5 meter and 7 meter Molex passive cables) have non-zero data at offset 6. Fix the logic by moving the passive cable check above the active checks, so as not to be improperly identified as an active cable. This will fix the issue for any passive cable that advertises 1000Base-CX in offset 6. Without the fix the user will not get link UP for few DAC cables. 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_phy_impl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c index bcefbf28f2..10196cae94 100644 --- a/drivers/net/axgbe/axgbe_phy_impl.c +++ b/drivers/net/axgbe/axgbe_phy_impl.c @@ -625,7 +625,10 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata) } /* Determine the type of SFP */ - if (sfp_base[AXGBE_SFP_BASE_10GBE_CC] & AXGBE_SFP_BASE_10GBE_CC_SR) + if (phy_data->sfp_cable == AXGBE_SFP_CABLE_PASSIVE && + axgbe_phy_sfp_bit_rate(sfp_eeprom, AXGBE_SFP_SPEED_10000)) + phy_data->sfp_base = AXGBE_SFP_BASE_10000_CR; + else if (sfp_base[AXGBE_SFP_BASE_10GBE_CC] & AXGBE_SFP_BASE_10GBE_CC_SR) phy_data->sfp_base = AXGBE_SFP_BASE_10000_SR; else if (sfp_base[AXGBE_SFP_BASE_10GBE_CC] & AXGBE_SFP_BASE_10GBE_CC_LR) phy_data->sfp_base = AXGBE_SFP_BASE_10000_LR; @@ -642,9 +645,6 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata) phy_data->sfp_base = AXGBE_SFP_BASE_1000_CX; else if (sfp_base[AXGBE_SFP_BASE_1GBE_CC] & AXGBE_SFP_BASE_1GBE_CC_T) phy_data->sfp_base = AXGBE_SFP_BASE_1000_T; - else if ((phy_data->sfp_cable == AXGBE_SFP_CABLE_PASSIVE) && - axgbe_phy_sfp_bit_rate(sfp_eeprom, AXGBE_SFP_SPEED_10000)) - phy_data->sfp_base = AXGBE_SFP_BASE_10000_CR; switch (phy_data->sfp_base) { case AXGBE_SFP_BASE_1000_T: -- 2.34.1