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 2FCFA43FC9 for ; Tue, 7 May 2024 14:44:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6191C433CC; Tue, 7 May 2024 14:44:05 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2087.outbound.protection.outlook.com [40.107.236.87]) by mails.dpdk.org (Postfix) with ESMTP id 77D50433B8; Tue, 7 May 2024 14:43:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ngd0vihhvaiSKYuMf9VwJKfcnLoWQWdyaoqOGBAdbu9GSryVJ8uIjBpxABeZ9xPOhMua5qVzxV7lx/dOgHsQPtUx9vqyVEX6YtXYOM17ZHURtR9A65j48z0GlaQOo/L/4XMI79FbVj7Q+/x/Edu4QaJTBtYFVMbzqXWOkyOEGxh2RpDfSw6b02nsXFPSx6uXKaolA3ee5X55ZlcW3eykBmmd+qKl8D7zISs4B6rwNETiLvRkk23kd7O6xa1XgvX7XAJC5b+gdnXPdvoOCA7aAL+tVj1Y+P6BF4X2UItVp4iMraF291OXSrT0jW4NeAItu9CmEYo+qr2wi7r4zoL8yw== 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=9KcyhoDkRwo6jfboYdJ8C8hazj3+nUQxbbb1yoL521U=; b=Wx65IUS1K/3mMD1CnYe/FoH/H915kBFfjlpylkqDxC5LZnosjjrUl+MNpP+PF1QRMhhMX5I6mkaQVBcuSbBdSoX2NpjwUbyqT7VtLYd812s85N/GaNLa7L2t8YrNaAn6Vp2d3P/rI2vm5QG2ARG1H6eS+r4MDBcqleztXIReRSflLP7zv1W9/I9XdTqzBIbeigdNzBsx+oKffH6v1k78AejxHHkrHJEgcN1KZnKe/SiU6qdVqe/k1Kbnzk6V8ypqTVqwdYuxgiaeYcron79FnyoV8nUvhMuOmbEs4qHbwLQUK+LtqjGi5/OcKsDbc/bFJJKfzwftGX4CQOStKh7irw== 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=9KcyhoDkRwo6jfboYdJ8C8hazj3+nUQxbbb1yoL521U=; b=2aqic2r35FjGAxmfT/7RhsB+WvW0JwcDyUjqus3E9VhF0F406SFsbzy7Vrdo5R8SLZXSYlYiuN2anGGSWvobs7gQm4PD8QiXJ1JxnVg2FQyeDZvT4SLAGSkWh+knueu55Lxb2RwaFoTcwYUyxZ4U6CC/p6s7V7qxYaUa9/O7fS8= Received: from PH7PR17CA0066.namprd17.prod.outlook.com (2603:10b6:510:325::15) by DM6PR12MB4283.namprd12.prod.outlook.com (2603:10b6:5:211::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.43; Tue, 7 May 2024 12:43:56 +0000 Received: from SN1PEPF00036F3D.namprd05.prod.outlook.com (2603:10b6:510:325:cafe::7f) by PH7PR17CA0066.outlook.office365.com (2603:10b6:510:325::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.43 via Frontend Transport; Tue, 7 May 2024 12:43:55 +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 SN1PEPF00036F3D.mail.protection.outlook.com (10.167.248.21) 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:55 +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:53 -0500 From: Venkat Kumar Ande To: CC: , Venkat Kumar Ande , Subject: [PATCH v2 09/25] net/axgbe: fix logic around active and passive cables Date: Tue, 7 May 2024 18:12:49 +0530 Message-ID: <20240507124305.2318-9-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: SN1PEPF00036F3D:EE_|DM6PR12MB4283:EE_ X-MS-Office365-Filtering-Correlation-Id: 7daf96df-34c1-4369-a71d-08dc6e935bc1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|1800799015|36860700004|82310400017; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?eaN/sjo7mmobuFqtZ/h9pPUDvEkRZmsP8QV4bUjrN4iMX/6CCODBYXinZdoz?= =?us-ascii?Q?uflPDFzjA3ojgLh1IL7WD2gt7/Rvr2MhRuUDKFFR+9xRezJCn4cUPW/qjRDa?= =?us-ascii?Q?n9wH0A1h0glwDZMaqj6DxHrXEtpGCM1c0f6QDwb25wEHe8ptTaV+OZlpRLNb?= =?us-ascii?Q?ll3ZySq5taEK0h4WGkpE5M0UiURi5nWD6EMc0KJOQJBSrIASpqzCTNI4QmJg?= =?us-ascii?Q?dJnO1793Y16F2UdasvA+JqOezaxdQtiSeGMNx8m3jvC67F/WdxWSaSZTnACT?= =?us-ascii?Q?vURar6nb78lCK3dm0GQRC/t6Y/li5YKjVunHp9G8m7hutD6/Dmeb12vMXW4W?= =?us-ascii?Q?MZO0SsWobrc7xDxzm3xzVwX6Je15hI/mlEuUlYIVhxdSnW/WQQq1ppRZxcxi?= =?us-ascii?Q?/Ma9E3Sol2UYY/YxHHVp5WW8wGTNvvsVXf53yNwALSGYh8/5dCko3t8UmZCI?= =?us-ascii?Q?Wf/DXskhuyPoxqsK7JQ9iv9MQlpVOcw+w0MNtZ9bFP5rMtTohuPqmb49NdFV?= =?us-ascii?Q?OxAAvZDXPfnOGmip1Qmg7Y0fNcHGWCeUasq1fI3Rs5e1Z9ZURRYBk8zQ55fU?= =?us-ascii?Q?T4xJsA9Wq8MmICMEPyRdiuOoXkztNlQndax7yP3LhWqACrBnQC090FRhnNln?= =?us-ascii?Q?9VDj7GX2muiZmQk2ydErqrKjEcvupNVgshT+6CNZPJVVLK/j7qfTpN5svExg?= =?us-ascii?Q?RrwaZJmZe4+VjTX2/aFOGuxdmJXk5T5eoTmYfHKEMKF34ZRn23uWkIr27dVy?= =?us-ascii?Q?m1tlBuHAIRTiKBjEZqBOWG/ihPjnJLxX4eFUOWTeGAIBoQdcZLTLYWnj5LzL?= =?us-ascii?Q?HK0Bqnw5PLbKdUNsPMidbRqCVSbp+tB2q2hJxXd27V/7g5c3HHwNUcOvqZKI?= =?us-ascii?Q?ggfjR4DCVpDdpbvCD/rfobyG7D59BurK1tAdIEWCOsU15JqNhzjyq0YAIFF/?= =?us-ascii?Q?gbJPMSVVdrOt4ZsJ670z732Rn29TDi2lDBLilQdGKoWReh1LMYjwsh4wdP0s?= =?us-ascii?Q?KWT8PXb7V9m3J8y7cDw+NocPwDiPXzMyFaaWJ5ewJdkISIQzQkLQ95rDKFaV?= =?us-ascii?Q?5zlj96Y95qumTfCcafUQlJU0/CDVroA5qdV73iXwG9DnADvFVQ0lcFsnd7Ux?= =?us-ascii?Q?4zNmNAQtEClGBILYvBxkeregZs3dTWc0lEV3gcNnpcII9gxtAQ2178+ZsqsL?= =?us-ascii?Q?ZzVTkcE+EZOpoya29vytVKpsClzwtKWUA8pB8KyyuktqTJ+J4vPrXuf9eU5X?= =?us-ascii?Q?yhRTwse1E6X8hgx29imdf7AMkHL7PFtIZIPfoV3t5xF3pySBGA0wmlUzv6iG?= =?us-ascii?Q?nB3x6kq1Wf07PQ3ftO1QHVH67Ndr45UAliDIDKCQZxOntZrUrpe+NFZJuNgn?= =?us-ascii?Q?piLlKBR78+eIKvVdfdhFtNAnMJBM?= 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)(1800799015)(36860700004)(82310400017); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 12:43:55.7808 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7daf96df-34c1-4369-a71d-08dc6e935bc1 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: SN1PEPF00036F3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4283 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 SFP+ active and passive cables are copper cables with fixed SFP+ end connectors. Due to a misinterpretation of this, SFP+ active cables could end up not being recognized, causing the driver to fail to establish a connection. Introduce a new enum in SFP+ cable types, XGBE_SFP_CABLE_FIBER, that is the default cable type, and handle active and passive cables when they are specifically detected. 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c index d4c4a89517..8b66def631 100644 --- a/drivers/net/axgbe/axgbe_phy_impl.c +++ b/drivers/net/axgbe/axgbe_phy_impl.c @@ -69,6 +69,7 @@ enum axgbe_sfp_cable { AXGBE_SFP_CABLE_UNKNOWN = 0, AXGBE_SFP_CABLE_ACTIVE, AXGBE_SFP_CABLE_PASSIVE, + AXGBE_SFP_CABLE_FIBER, }; enum axgbe_sfp_base { @@ -616,16 +617,18 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata) axgbe_phy_sfp_parse_quirks(pdata); - /* Assume ACTIVE cable unless told it is PASSIVE */ + /* Assume FIBER cable unless told otherwise */ if (sfp_base[AXGBE_SFP_BASE_CABLE] & AXGBE_SFP_BASE_CABLE_PASSIVE) { phy_data->sfp_cable = AXGBE_SFP_CABLE_PASSIVE; phy_data->sfp_cable_len = sfp_base[AXGBE_SFP_BASE_CU_CABLE_LEN]; - } else { + } else if (sfp_base[AXGBE_SFP_BASE_CABLE] & AXGBE_SFP_BASE_CABLE_ACTIVE) { phy_data->sfp_cable = AXGBE_SFP_CABLE_ACTIVE; + } else { + phy_data->sfp_cable = AXGBE_SFP_CABLE_FIBER; } /* Determine the type of SFP */ - if (phy_data->sfp_cable == AXGBE_SFP_CABLE_PASSIVE && + if (phy_data->sfp_cable != AXGBE_SFP_CABLE_FIBER && 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) -- 2.34.1