From patchwork Thu Dec 8 16:22:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 31431 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp293196wrr; Thu, 8 Dec 2022 08:30:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf7TIuDBoyierngwNvfcciSxThw1aXGphwh+OvAcU9KyBT4fwAZdtBnP7wmynbRCKi/H9ACA X-Received: by 2002:a17:90a:7885:b0:20a:d81d:a8 with SMTP id x5-20020a17090a788500b0020ad81d00a8mr107313109pjk.177.1670517007947; Thu, 08 Dec 2022 08:30:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670517007; cv=pass; d=google.com; s=arc-20160816; b=Hm5Ss0Xp6iFt3A5tB+/V84OeTXBWq76M/vzlnyzfqPPMj/T1u9Nuu+X0L/TxQnkGSD KKlBQNXUh7QwL6IIgPWmA8d/PPvJ6UVaiGS+gjdYe7gdxNKbty86kTSaZH3aeuFUCit+ gpwujP2Gq4YEVYGP9GGmWvpse7jlFv01C1ydsQHByCPWLyyu8tGO9AHgy5tDttLtiaEa 75eElfFRyyLXUxJmePEzKLEuEFA1yNs2u3+zhC5jaNOEY0e/CwuMDS9GQ0aYyWVL1WxL MIBXGgkGCoDgz8jzskk/9KJwNyYoKaCi96232r2J1Ss/85rpKOdPIAfReZd0EjrihCtk t8cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XGv1bUKoON/7BDuP65fPZTgki1lAzvgeqvNzRq3dW7M=; b=cBydJax3cu8nF+0FNCVOufCPnvoY5AcAQ1GG1YkCJxU1LJPLyzTZugfiuc1V8ZsG+2 zyrHvmkLL7yXF8ytj81PQW0cTvzzRWg4S0sBC3jU9MD8zBo5YoXzJgbO9bIXN/22P++X E6AmdIPOgtEDFPAOZFHzhmP0dWi+ZT8T0h6kxzx1JBcTTm5chh0gL3ku7b/s4Ylr1jBi s7Z8nGIBm5m1nq07rIOL5Ve/AUfbyRXTxBpyZEyMRBQqLPIzOptls78FV1L/wo+Qo2v1 bLGM7+6/LQAu+an4+s4jPGdRWSZ84BVTKdSJe2YMCS+PrdmxUFNBSkDM51vmcblF1J26 I5SA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5Q2UZrUE; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h22-20020a056a001a5600b0056b81818621si65062pfv.157.2022.12.08.08.29.54; Thu, 08 Dec 2022 08:30:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5Q2UZrUE; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbiLHQXS (ORCPT + 99 others); Thu, 8 Dec 2022 11:23:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbiLHQXQ (ORCPT ); Thu, 8 Dec 2022 11:23:16 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2065.outbound.protection.outlook.com [40.107.237.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F1FC45EF1; Thu, 8 Dec 2022 08:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dFIt2AcBL6qUY/zqF6H2WRuXGBKLLATapmTvJswda5M4iakFPoxdI9YK6csdmRdQZdpb7VcIzWIg5h9KAGieeODzUg3dFW7sNqCaS943yHp6J5B3SooG9XTmO8LYM36Lr8w/GafbV/REptQBzaSWU1FV8CAiX3qqrVoIvxLjUucBHNKO+XVx1EGCYN8ZJz+IY8WfmGDs+o/i6LL0Wk3FMDtmLfql9CAnC6eEcVV0BEQkiaJ4kuhkgttIy9OY8hdHWvdJNrA7dQPcV2x4aRZE3CiTYDXS3pYkptoar7Amjsp2BwNerBusPlmi9pQ6bp5lfjutHN8aDfVmJZonlmJ6tg== 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=XGv1bUKoON/7BDuP65fPZTgki1lAzvgeqvNzRq3dW7M=; b=VbAyM/UgQhLo3/3cd9gX1Xjq2Xpiw2Snqd/zp3l4FpcoNXhaU0mnbFPekSDgW1ZP4wkhBbNskph42VIBHs2jN0JyCmmknydVIc8X4Hoygn1JeLxtmopPD/bcxbLZfxteGhIJfBE5AEMClCAL/H/VKKmA+4k6q52Qyd/DcNiSr9mmBdLX0YIAaxr/o7RDlpkotQe1LXFDCtXtVAZF8+6yNIZU6TQaXmMydbGzzcJVYvvBIDJIYQgexVMZe2GElXW7+muQpFzkhRwgrYt6DeMOhWStHrXf4cLia1++0PudjnUsyFxIOTEizv78uVfQ9TqP6G1Ne1DhkFb8pch7PsW4wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.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 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=XGv1bUKoON/7BDuP65fPZTgki1lAzvgeqvNzRq3dW7M=; b=5Q2UZrUE7fU16Fz6PeQ0hY4g26k6dcsvokLdADLY+cQ45TxZwAAXHGrC70WW0IU7kHG1nZKwrzoYsvZiGGdVixxUIEC2xeChRJ735aVCLgMRH7ejtayO6z7NBYJuE7j9U4RIFpytDYrOKkwbEumRSg0CdHWakj6IQen0uzt7T3E= Received: from BN9PR03CA0628.namprd03.prod.outlook.com (2603:10b6:408:106::33) by CH0PR12MB5331.namprd12.prod.outlook.com (2603:10b6:610:d6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.16; Thu, 8 Dec 2022 16:23:09 +0000 Received: from BN8NAM11FT100.eop-nam11.prod.protection.outlook.com (2603:10b6:408:106:cafe::1d) by BN9PR03CA0628.outlook.office365.com (2603:10b6:408:106::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Thu, 8 Dec 2022 16:23:08 +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 BN8NAM11FT100.mail.protection.outlook.com (10.13.177.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.16 via Frontend Transport; Thu, 8 Dec 2022 16:23:08 +0000 Received: from tlendack-t1.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.2375.34; Thu, 8 Dec 2022 10:23:07 -0600 From: Tom Lendacky To: , CC: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shyam Sundar S K Subject: [PATCH net 1/2] net: amd-xgbe: Fix logic around active and passive cables Date: Thu, 8 Dec 2022 10:22:24 -0600 Message-ID: <55a23ec3393c505d2420fc81190898f5e6a4ff93.1670516545.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT100:EE_|CH0PR12MB5331:EE_ X-MS-Office365-Filtering-Correlation-Id: 36774a75-84ff-4e8e-420e-08dad9387e6e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C9Q0uOSmNYyY5sFmFzckElzxgxw01ovtwyKlQ2O0pWQ7Xzmi0FgMOl0XbeZ2O6zhHdCzcE44oXWtfJ70WnEXwZXKOdviVkaFQZ7/co64PRQTzr3U8e4jJLuDlCp6Pgh7om4HT+AzQI2T+G+v9/0NdaV6Lfd9T6SbdF3MrAGlcDX7go6couUlm/cldw1JZ/KFs+/GnMQJmKqQdz6TaDvOvdAvQulHPI5XAuRZrhyNd6riM50pULpuHJ57kaKUT7uivb+xD5p6W/uOrun64IZ3UlYM8XPmdUOkqtjjYNlckgYMpOWhETtUdYKsis0Y3paoc4RzcAPmwU8wloGJIUsXSMnt9cOLADEL3r59SutZbMFQmAZ8xxImMtcUpgBg4/basDXZeco+odY4gOfDKbJthNwmPreaUlmxqtBJvqmQFvns6hxkKCuncxXuLRCqON0VaqFxHNEqU4tiC2IvMg6o+sHYfpwFd/rw7jOE8Y5I2fhPInNkY8VwQ3b6n3aQ5RljVLI20ak5PX8cMbwrugHk9WfK4TuavwCFULqtTDz+1JR3G0V2Td6IE8zh0cIeCVIChsur7ZOw54XaIoTWv0WPFl5ZPuCp6RrglXR8X7m1TgR+2T2PCc8Ye5WyZsJ07jDH/SkZoYKoZ7Mjft4y96IyvEUJOpQB3D6U4jmwqJ3XoxI5I38zSs3ueWhRJ4uJXQ9o3mVjGTVCbmnfIQ8XJPhIme2BIzUxGn6L8TGoo3JlqU8= 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:(13230022)(4636009)(346002)(376002)(39860400002)(136003)(396003)(451199015)(40470700004)(46966006)(36840700001)(5660300002)(7696005)(36860700001)(47076005)(426003)(316002)(8936002)(4326008)(110136005)(40460700003)(2616005)(40480700001)(54906003)(70206006)(70586007)(186003)(16526019)(26005)(86362001)(8676002)(336012)(81166007)(356005)(36756003)(41300700001)(82740400003)(83380400001)(6666004)(2906002)(478600001)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2022 16:23:08.8428 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36774a75-84ff-4e8e-420e-08dad9387e6e 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: BN8NAM11FT100.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5331 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751664042446499407?= X-GMAIL-MSGID: =?utf-8?q?1751664042446499407?= 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: abf0a1c2b26a ("amd-xgbe: Add support for SFP+ modules") Signed-off-by: Tom Lendacky --- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 4064c3e3dd49..868a768f424c 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -189,6 +189,7 @@ enum xgbe_sfp_cable { XGBE_SFP_CABLE_UNKNOWN = 0, XGBE_SFP_CABLE_ACTIVE, XGBE_SFP_CABLE_PASSIVE, + XGBE_SFP_CABLE_FIBER, }; enum xgbe_sfp_base { @@ -1149,16 +1150,18 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata) phy_data->sfp_tx_fault = xgbe_phy_check_sfp_tx_fault(phy_data); phy_data->sfp_rx_los = xgbe_phy_check_sfp_rx_los(phy_data); - /* Assume ACTIVE cable unless told it is PASSIVE */ + /* Assume FIBER cable unless told otherwise */ if (sfp_base[XGBE_SFP_BASE_CABLE] & XGBE_SFP_BASE_CABLE_PASSIVE) { phy_data->sfp_cable = XGBE_SFP_CABLE_PASSIVE; phy_data->sfp_cable_len = sfp_base[XGBE_SFP_BASE_CU_CABLE_LEN]; - } else { + } else if (sfp_base[XGBE_SFP_BASE_CABLE] & XGBE_SFP_BASE_CABLE_ACTIVE) { phy_data->sfp_cable = XGBE_SFP_CABLE_ACTIVE; + } else { + phy_data->sfp_cable = XGBE_SFP_CABLE_FIBER; } /* Determine the type of SFP */ - if (phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE && + if (phy_data->sfp_cable != XGBE_SFP_CABLE_FIBER && xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000)) phy_data->sfp_base = XGBE_SFP_BASE_10000_CR; else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR) From patchwork Thu Dec 8 16:22:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 31433 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp296037wrr; Thu, 8 Dec 2022 08:35:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf653thQIWNbRSjox3JX1jV734m6S6CNk2+2kFGRdZjgOnT76lwwy6i0CslvadNIAw9FXuvZ X-Received: by 2002:a05:6402:1f08:b0:461:d21a:c0f3 with SMTP id b8-20020a0564021f0800b00461d21ac0f3mr4069516edb.71.1670517300341; Thu, 08 Dec 2022 08:35:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670517300; cv=pass; d=google.com; s=arc-20160816; b=dlcNWMtLuCNbFz2SRf1E0BBmgikOcKTdDUU0fTrEXCrBj7SGareexFNApat+5nmjZL 9UJG2qFyG4g0VZOKb2VmitPJCM3hy5QybGs4CwrxsVBWKIjIOWbqtognPtEMsCFdjZVU UVjg0XV/k5L4OOQ+7dH7CPom96GFWZ1zqkLUkaeSKgquEbjcDSGlG59zcuk0solDlm03 WgEuykqWFMvIiWjIPb5zxTfq6ftqreWp9O8HA7T3nyYp2PsnvAmJfbEeGwcbLjsEFh7J XtV/xrNkpYAqzsOcVFe96ZvQ4TAxIUMTRtkqDpr33cATxC5nlyhafY6/vPCfuYM9xqwa iAGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JbVzym4Jv78LRek8QcLM5pbOxGAzKmP7hVg17ZiAMZQ=; b=duVD3o3LV5OBiUFR6hpsZG+o9zfZJKvv2mNxnnCm4XreoF169V4SoNa/8z6UarWpc1 0beiS0g8PiNrU5pLddaQXXrIX24EFgLw+7kceGfPOdn66CDCXMxHkQisoN/d+tiHMdko r1C8BJLKputKdUxDUnC2/qTdOzlaF0p4Zsvgjs5F/z5laDKrxLDb1IkFWRnBCBd963Qj t33huUb75GlSiWBPx5RBfwirlg0JKPHKIHebhESVtOliRD60DdFlP/RMIBYuJf+ADdHZ DlsiafU/0vYjTSg84NtvB+0Wcq+vyllsMQURQFGhq+B19U0vkI9L4vYXHXdQ3yXhpuTk tRZw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=lBvhTxEU; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji22-20020a170907981600b007c118b2d91dsi5756554ejc.248.2022.12.08.08.34.37; Thu, 08 Dec 2022 08:35:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=lBvhTxEU; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230115AbiLHQZx (ORCPT + 99 others); Thu, 8 Dec 2022 11:25:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbiLHQZu (ORCPT ); Thu, 8 Dec 2022 11:25:50 -0500 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2064.outbound.protection.outlook.com [40.107.100.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DAD66A76C; Thu, 8 Dec 2022 08:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gCw7f8qGmrnB7saR6Q0O2pLHbJY2FSMtbEdOwxuQ/l9Kq84jYvIoqLaulIG8XZDKwCl1LzBINvHgHnbh8At1VetfThKl1+BzHsxEMMVvfT0OFjTQ4FAI7oA3ZfXLiTMFchA8ZOQPJtBMSdIpiYjHSPgvrA8hApt7LbjRIF7XQDJfIAxbIY927HMaXMvcww+02mbop66kBw5+CrLyX0mNeYfz1ynbnleQqHvVXZom5Fe/f554+xTqFjVDK8b3qvGieoYVDxLK00lrFG+8SMrf1XB6FqN1JKSSIJt1/ub2+8oRzia57tv95UDvGg1A2tC9SqYtmsFzQNPgt2LVDx6efg== 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=JbVzym4Jv78LRek8QcLM5pbOxGAzKmP7hVg17ZiAMZQ=; b=N6Bm2MZQzvFsUwQlg6Uey8EcR2hGbbMtl54UgRkUqFgmNNeeeHyL9u3Y63i2AiMiC8V5HPKITKYU4/TLaLuQcc2Jt/lRasdeIFeFCbHdSRMgzvPXFGKa8pgLLmUHnUod9w9hToHQqMzxT3QgRwynSw0RNGqWRdoxA54/bnXwoANdXLmL4TyQpauedOWj3LmO8ti3iaJ7Tp5NVzR6h35O94akIZeDhAbXj00Coj4ezfAe4mDK//k62XHoYy4GRjpcNMADCFP/J67nDUW6pJvwdxFogPjx4rboBga0RNgcYdjuVRuVoUt5H9+xtNGRMeTPEWE3fTTt64taIfVjKJFBkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.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 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=JbVzym4Jv78LRek8QcLM5pbOxGAzKmP7hVg17ZiAMZQ=; b=lBvhTxEUvH/J04ZRYI9D4WeUNw4h2TCu6TCHUtzzbw2+TsrqazN2hOqM0hew7fIYEaf0rGNxHatVy7dEtW64+Z76hyhBF0snxIIRf6t8b0Fm+kBKGKEHmalCOhv2L3tCYBL9DjWrEcXSoBu9PKMIT2YsP6oGyl9fGQOwhH3lPhU= Received: from BN0PR03CA0013.namprd03.prod.outlook.com (2603:10b6:408:e6::18) by CH0PR12MB5283.namprd12.prod.outlook.com (2603:10b6:610:d6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Thu, 8 Dec 2022 16:25:47 +0000 Received: from BN8NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e6:cafe::9a) by BN0PR03CA0013.outlook.office365.com (2603:10b6:408:e6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.16 via Frontend Transport; Thu, 8 Dec 2022 16:25:47 +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 BN8NAM11FT011.mail.protection.outlook.com (10.13.176.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.17 via Frontend Transport; Thu, 8 Dec 2022 16:25:47 +0000 Received: from tlendack-t1.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.2375.34; Thu, 8 Dec 2022 10:23:23 -0600 From: Tom Lendacky To: , CC: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shyam Sundar S K Subject: [PATCH net 2/2] net: amd-xgbe: Check only the minimum speed for active/passive cables Date: Thu, 8 Dec 2022 10:22:25 -0600 Message-ID: <852265b14d35ee1e508b71d814f7532d12d5cf14.1670516545.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT011:EE_|CH0PR12MB5283:EE_ X-MS-Office365-Filtering-Correlation-Id: 071a3503-8764-4bf2-b69b-08dad938dcc5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gm9UI1VXUmMCUWJvKQy4Jwx2BCDoTYw6sBx5TeFhJidzDuI4P3TpvVqDZZa8/Ona8fc6LfXyNrJ/oyrIdohzWxvJD7Blhraz6aiCIgFZQmc5yiD1tmX3kWRFu3LS1Vm3OS+W4Tcc1WxFyx8QsDHJDchhi9ATSuD+9XjL9j+yspXUxbnsHLMTBBZ8D0ooXrOIre30cXM1+ZwleCgL9J9egv8P5V2PQ0rRFPirKnMfsErRspqZtHY25galE7y+Ds4+R0i+eWVy/FdP2Nn109+OIclnZlTDaz9BFt3Yvqtm+6F0mWIya0spVKFFqbCNWxN+q04f6DpmfzStWPMK3j+qq7LqJqt9NYrvBIqFDPAberNWJoa3Hgox3XJKY/ZGC2/moisB21uU/0p/3u1ZNSVaAZYkYU16UZ8TCuvd3BNUTlFm5aNBTqezzapVmPqtBIRVmPohNBT/k3xfWyQqADX7eKSd88THflgdW2TG9gzaDMZWNaP6+ia0YF+LonPnD2rNYqtwTzLnK0pslYPP+yNtpghsgsn7YbRO4NtUB9+T7Jtgq1MGgbTRNqpw0r1uByyrSeoltZYuomQzZ0WC2XJTFXFJPrKWC3OSqMAVVKtbch/PrpjTWuIMTxiBJv14bHU4cOGA/7gVVUg+dLrhRGqdO7ByKU9V0UgalgF+scfP4BwltOa5lSIU5s4NUuQiQUOdvH37hEeeLr/R3RpYdCJ4Ub44muSVEFJXHUXRHJq9x64= 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:(13230022)(4636009)(376002)(396003)(136003)(39860400002)(346002)(451199015)(36840700001)(40470700004)(46966006)(7696005)(478600001)(82310400005)(41300700001)(5660300002)(36756003)(8936002)(316002)(110136005)(54906003)(70206006)(70586007)(8676002)(86362001)(4326008)(36860700001)(356005)(40480700001)(81166007)(40460700003)(82740400003)(2616005)(336012)(186003)(16526019)(26005)(83380400001)(426003)(47076005)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2022 16:25:47.1218 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 071a3503-8764-4bf2-b69b-08dad938dcc5 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: BN8NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5283 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751664348778616854?= X-GMAIL-MSGID: =?utf-8?q?1751664348778616854?= There are cables that exist that can support speeds in excess of 10GbE. The driver, however, restricts the EEPROM advertised nominal bitrate to a specific range, which can prevent usage of cables that can support, for example, up to 25GbE. Rather than checking that an active or passive cable supports a specific range, only check for a minimum supported speed. Fixes: abf0a1c2b26a ("amd-xgbe: Add support for SFP+ modules") Signed-off-by: Tom Lendacky --- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c index 868a768f424c..c731a04731f8 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c @@ -237,10 +237,7 @@ enum xgbe_sfp_speed { #define XGBE_SFP_BASE_BR 12 #define XGBE_SFP_BASE_BR_1GBE_MIN 0x0a -#define XGBE_SFP_BASE_BR_1GBE_MAX 0x0d #define XGBE_SFP_BASE_BR_10GBE_MIN 0x64 -#define XGBE_SFP_BASE_BR_10GBE_MAX 0x68 -#define XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX 0x78 #define XGBE_SFP_BASE_CU_CABLE_LEN 18 @@ -827,29 +824,22 @@ static void xgbe_phy_sfp_phy_settings(struct xgbe_prv_data *pdata) static bool xgbe_phy_sfp_bit_rate(struct xgbe_sfp_eeprom *sfp_eeprom, enum xgbe_sfp_speed sfp_speed) { - u8 *sfp_base, min, max; + u8 *sfp_base, min; sfp_base = sfp_eeprom->base; switch (sfp_speed) { case XGBE_SFP_SPEED_1000: min = XGBE_SFP_BASE_BR_1GBE_MIN; - max = XGBE_SFP_BASE_BR_1GBE_MAX; break; case XGBE_SFP_SPEED_10000: min = XGBE_SFP_BASE_BR_10GBE_MIN; - if (memcmp(&sfp_eeprom->base[XGBE_SFP_BASE_VENDOR_NAME], - XGBE_MOLEX_VENDOR, XGBE_SFP_BASE_VENDOR_NAME_LEN) == 0) - max = XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX; - else - max = XGBE_SFP_BASE_BR_10GBE_MAX; break; default: return false; } - return ((sfp_base[XGBE_SFP_BASE_BR] >= min) && - (sfp_base[XGBE_SFP_BASE_BR] <= max)); + return sfp_base[XGBE_SFP_BASE_BR] >= min; } static void xgbe_phy_free_phy_device(struct xgbe_prv_data *pdata)