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 9839F43FC9 for ; Tue, 7 May 2024 14:44:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93059433C9; Tue, 7 May 2024 14:44:03 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2049.outbound.protection.outlook.com [40.107.243.49]) by mails.dpdk.org (Postfix) with ESMTP id 10266433B5; Tue, 7 May 2024 14:43:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wr4n9HV6jr78jL5fSsA0Va+KZs/Xcroc3/3H2GM1OGu0yRsfJP554BClXtVQwzSbX/UTYSqMg8imUe/NwV1SSGGwSx4XoDP6KKnzW+y+Nj/iT4lZuLH6DF+y8jxo+YNXjlQGdnvkYjp3YRHwfUaiPEx1waxIiPz5E2/BjZSx9dkXbY7PPKjS43bthTngagzBkAfgL73DvG81j5AjFzwLScGVPpt7ViEiZBylmeKCKmVA++SAJUILDFUzj+N3F8mX4xb16DYsEdkrwffIhilMq/X9tiMkuCuoIdOtBSRqi9BPfWauyLrXUcZfLwdsToZuj4C2+MI0oNc2B+7cGqPG0A== 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=ZUnhPzYLKuVcGpGBnxJS1cBfprUXJ9apRrKC8j12efw=; b=VucGwapG8q0UFCTWeKqFRjloiQKPbLP3jL8J1f70OxZO5EFfCunAYsOLBwCVIQ0EemCLJY+IEZg2bOdausEtpKtf1P+p+Pnkhf8vyQ5a89AcP7IAtTh1esa1y6CtrUukFj+Q465eEAZIh0LYc+ybHFQDpeF2honF/MjcrI4E2GkYZ7OtIYbxOjnqW2He2tgRtYcaylBiNpfDQILGD7R9ttMUiGnHewx79+BPPr2nVKUEzx+wJ42c8Frbd0nzpXNBLIOMv148+b8bB1K/UjHNl2b8ZfOMnHO64D2fVMrXOH2h5JZkO/MKTxT7vXjBXXOZfaJm5ydeUuAmxOd5ukIMKA== 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=ZUnhPzYLKuVcGpGBnxJS1cBfprUXJ9apRrKC8j12efw=; b=vXQ2rFUsN/Nt37qkvzNVg7d0yO+5PWC8fuGGfcmB+FY2j6KbEbk6UeHeYFujMUutyWYSBcWRPy8XnCTFEX/zFTDtM/qtAqihDYpSDPcHJ+M6DLDRqJ1T+jHPP7M2N8HAf1gSRXLyPf7IGBkqfz6ldqM2+rE3cLo59NASh+JZyPY= Received: from SA9PR13CA0038.namprd13.prod.outlook.com (2603:10b6:806:22::13) by DM4PR12MB6638.namprd12.prod.outlook.com (2603:10b6:8:b5::5) 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:53 +0000 Received: from SN1PEPF00036F3E.namprd05.prod.outlook.com (2603:10b6:806:22:cafe::36) by SA9PR13CA0038.outlook.office365.com (2603:10b6:806:22::13) 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:53 +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 SN1PEPF00036F3E.mail.protection.outlook.com (10.167.248.22) 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:53 +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:51 -0500 From: Venkat Kumar Ande To: CC: , Venkat Kumar Ande , Subject: [PATCH v2 08/25] net/axgbe: fix the SFP codes check for DAC cables Date: Tue, 7 May 2024 18:12:48 +0530 Message-ID: <20240507124305.2318-8-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: SN1PEPF00036F3E:EE_|DM4PR12MB6638:EE_ X-MS-Office365-Filtering-Correlation-Id: 3de74de1-1bf8-4b46-bdc4-08dc6e935a61 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|36860700004|376005|82310400017; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?QxzFVT+t9DOs5wFh8yGEGxjlftXCpxmDrrgqPYJ9FzOQuNZDVOJVSW/colee?= =?us-ascii?Q?dzEaKUnBG7m/VrRcY4uvk1n86g60kf7RUnfLnbSH1qldV+chKSPJ+MntD+vu?= =?us-ascii?Q?JHTBp8SOJWMrDAqrcE4tWEBXzAc6wgCxVtbMc8sXSi3kZVg+5GiqCgPaNPer?= =?us-ascii?Q?Qz2b4BjR6aBy7AELryh/omlHBWF7mjCRlX54eixlizXvECHvwev0/b/EYUKr?= =?us-ascii?Q?r6drLlLk5HGOfnh5akbtq4kc1jiDOm3C8xXA8hwL9vgEAmkRmy17TYAQATqi?= =?us-ascii?Q?odPyjALDE/F0R6vtoMjXwbye0oIQCGeVCJXG7oxIrOX3y4n/zoq/Zy/sJPG9?= =?us-ascii?Q?ewmrv2FTqvxO+9WvPYm1t7Q1LFn8u53+Jqs4CBZtbjSPXdLoP3WteG5zr47Y?= =?us-ascii?Q?macTL91Qt1RZWt87SWL4goh5g+xo0ViU/mkwPlIfzJLhR3yN+vKNSq6fETtm?= =?us-ascii?Q?uaf0UPzxo7r4I+3YFD6f/X6yHavptoZhV4raLrLMr6tBhIMPlXvxaPe+Kb8l?= =?us-ascii?Q?GNuUkMjrrLL7EgZWJu0zpiddTLOn34sNupKvwmhkX5HVDVcQPkgpaLC8f0uf?= =?us-ascii?Q?hT1VbEF75QsQMaDH4vYYbhPXxE85fqV0v2m5a6pbPpYdOQDLXql21HYROecH?= =?us-ascii?Q?/W5JwV9w7zoNT1ngMdIeWfEtj8Df3HRzJFXdqdSBIpohSWkgLvhbnPylYtVv?= =?us-ascii?Q?z0raYfEwRjIN69DhHnOfbQ1jhVZo4k153pkIf44NHLqFNn4aj4B1mxaedQbG?= =?us-ascii?Q?EzFWIWku2+V8LV1wDeYv5GPmyck7JoXGe9HColfwo2UmqdqavYlgWyLz8DBq?= =?us-ascii?Q?A7mnicZs+UN1aIPIKoCCrqro5vLqBHM8ZcVDEaOyPVVTOT0LbgcOhxtOyQhF?= =?us-ascii?Q?f7KkvldLak85cgeI5VmATQXkBg3nxZoNZTgx4eu9Yf81fPI4iHxdpJNgL3Jm?= =?us-ascii?Q?HY4AdE6ZiBh40MhVmY+Jvcjzz26IKj7pYbO+A6KsCFwV4lYmLlU9pzIKpskN?= =?us-ascii?Q?5mf+D3JP+R4/M3iaLHdlKqoDcroKe8iEAxbE3q7GNbploxualXy7CyGDMqgq?= =?us-ascii?Q?EELaEwKLV2O2qWbH/Sipxa88yIAajKSeeQKokqW16G+e8WVFGRAuZrwk9xgE?= =?us-ascii?Q?VW+irOVwx4SVgp/hLPi3XfkftivhtpSpUT2n0d4XAYpa8ibDjNFeUOh1Lsc8?= =?us-ascii?Q?MKxpL/OgLRUhP3nagMTSooWPNDMfs/0zMTsQU3ZWsTV0IyqmyUCZPXsOGnUX?= =?us-ascii?Q?r2YAlFgokkoZhW8t6dNfjgnVKJlmtt8jo//FKm9LwERn0jTRJPexEqSsXMpx?= =?us-ascii?Q?s8+NJcfXQ9IMm9BsFOmbTMXqcjss7TOo8U1dO1vuj/jFtbofttXHrlAy+kCW?= =?us-ascii?Q?r6o3Pij6Y7wPkxev/pFWo2mrjnrd?= 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)(1800799015)(36860700004)(376005)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 12:43:53.4433 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3de74de1-1bf8-4b46-bdc4-08dc6e935a61 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: SN1PEPF00036F3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6638 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 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 --- 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 9c2ae7bba0..d4c4a89517 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