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 BC3DA44153; Tue, 4 Jun 2024 14:13:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D09B436CA; Tue, 4 Jun 2024 14:12:57 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2053.outbound.protection.outlook.com [40.107.236.53]) by mails.dpdk.org (Postfix) with ESMTP id 5D228436C3; Tue, 4 Jun 2024 14:12:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ellKUg/8vp7r+r6EYg6KiWOEiWDJ5SNkX9+9FxtIGr8tEkPnlgC7thnwIBxicD8WQ/FmFID7g5A3UDvVBoLDWkTVlmnJ5YQGBrfGfwyyyi3nTT9A/ihfDYTqC3Lu0a8CiF03N30L9fM/QcyBJXK2LVnYJ2Z7g9LKhrh95BjjADDcDSr+4GDKCjYLHPtmVAuiDCds9qbrvuRo+jddzkUTNz7guN+A1Z+ewx0bH3vbHVDqv0xod93Rwhm/KP3ULTSPUOVTMKY8Xrc5uqEtbtmhSo4LojBL0JjtfYQg2qnXgusv0vU4wLijw2jU2gI5GsHxfspiWAW4K9I0feimUUjioA== 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=hFXkrK5Bn4vYn0Bj3YMg69XLvPwJQ+ncmS0bGJfJgrc=; b=l8AKB0TkWC34O87EWIFb8EkbhKPTRcpWmBKiGeciwBXPZbQuqS6CCI6HKFTybCuSTmBknqBdhf9SWkP021OpMwSwNEIx/nKDvNFQ9FX4kHEHyZtmrGeHzf3jmRsXz/KKPPRhjXUNSagNIY/+Vhwoz/Em5I2bkOazlq1gXem7p1oT1nC8FrTQzpry3gsarSlyk2J40/AXowjcxORig5MmoJ59qx47ufihUUBEYTcSKCFtlmh3RNqNsk+/NXO6C7oG7yFBTh5Ft3n7TBfMJtwqd/9k7hfc+rQ3A+fmMWCkUARgHmvA415YnwNdUKdmlIVDmvk0sBBa7VzQA/c+gfCipA== 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=hFXkrK5Bn4vYn0Bj3YMg69XLvPwJQ+ncmS0bGJfJgrc=; b=y407tavunvYhRBr8CTDO4wlE/b+4KVk5EdJD4CxOjwbswHbCC0NhKOv3NA7++JYOYHTuYKh71kGDLPVlYrSJq+g2N1brrkXZoi6c9DzK4IfImsGA1nKL+huivAJHcNzqLj4zUY9oRlZLE5vEWvPSiV4ORve24hDeL4HEkJF0pA0= Received: from BL1PR13CA0365.namprd13.prod.outlook.com (2603:10b6:208:2c0::10) by SA1PR12MB8966.namprd12.prod.outlook.com (2603:10b6:806:385::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Tue, 4 Jun 2024 12:12:52 +0000 Received: from BN3PEPF0000B371.namprd21.prod.outlook.com (2603:10b6:208:2c0:cafe::a6) by BL1PR13CA0365.outlook.office365.com (2603:10b6:208:2c0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.14 via Frontend Transport; Tue, 4 Jun 2024 12:12: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 BN3PEPF0000B371.mail.protection.outlook.com (10.167.243.168) 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:47 +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:45 -0500 From: Venkat Kumar Ande To: CC: , Venkat Kumar Ande , , Selwin Sebastian Subject: [PATCH v3 09/25] net/axgbe: fix logic around active and passive cables Date: Tue, 4 Jun 2024 17:41:41 +0530 Message-ID: <20240604121157.3052-9-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: BN3PEPF0000B371:EE_|SA1PR12MB8966:EE_ X-MS-Office365-Filtering-Correlation-Id: 578aca36-935d-4d00-104f-08dc848fa572 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|36860700004|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?7nZ73RLkgBwzRRXBuHNWqu+S2tS8epl/eAvbUD69ZZrXyr35VxRxAKT+XsIh?= =?us-ascii?Q?1LOPmGiClTsfEl5X7u9+vYfdj/CI2IwTujOAhTGI8SKdvlcXN+t7ap9ZCiqD?= =?us-ascii?Q?DeonUAvIqpzNa6qA+q88SHeEjWBHB7LeeyidqkvAMcMj5yp0rZq/4clveNh7?= =?us-ascii?Q?WQqrQiy2FGnr1Xb3EFcjujXcTqVV5L8CIgtfaw8RUVhIIPKbu4+r757RmrCD?= =?us-ascii?Q?xVt/MGR9nibUffwR9F75beWKHjd8chceTzGoXOHPlRvuuMfTDwN6kvtrUeeJ?= =?us-ascii?Q?I4lXZ9Rk49xjLGkp/SMTr64RpYONM0pAA8+b8L5To9do6RvGs9Xlxch12tff?= =?us-ascii?Q?cl4q3Z3uQTJ8T3EUNmiK7P7orvCUvnW42u2eLsFeUrDwv3hvLG8kgowGRzh6?= =?us-ascii?Q?0XU4vvNP4M454dTtBaV0Vyib7RKRHcnP3TFfaQ3NTTr4P651i6WxrDkJOdLa?= =?us-ascii?Q?wIPunugpSh0zxcI0Yuf1wBA3Rt9acrMm2fEACXtO61E634ZU8ycfxHt6gP00?= =?us-ascii?Q?YHv7+yWWvvqF4dsM4F911uSZJ+V4Cpc920K8RhCaKPOVOrNGprbtxOvppui6?= =?us-ascii?Q?4p8zYy3t0PuyJZFbltmwmHO8o/SYMZlo/daAxqhSPJxv43LsxPdv0EpDm0Mz?= =?us-ascii?Q?gIqBPLLGs+C4DCINfXIrspssTrJxxjVQJVYGQOQu+cesqMlRN5YiHliWf6hV?= =?us-ascii?Q?Sx3UfUO5FjQfIdMGG5rlWDvl5S+y/0U+YRnMgqlxW9eduNYWRy33YnutNVRp?= =?us-ascii?Q?a3L+JBfu2/+71Ex53KDPF9qeKnmWFdf1pHx58NWOt8yIOsN8tmU0nJ5l6TnD?= =?us-ascii?Q?cTjnQjLHtsDAn6IbubML8c/oQaPHzn5ViCjQRZClrA6WmnIFSI4ty3xgShit?= =?us-ascii?Q?SZg/ZB67w19eLbW6L8LCXh9zZlsk9cg51ZjYO1qhfOXMs6OxjftHzjbSSgL1?= =?us-ascii?Q?F2TM9CYkvGwYpS+ycPnOoDH8epW6SpiXJaYBSHY/cf9Xxh3eGZid8O95XHDd?= =?us-ascii?Q?W0MvsD217BnwQylnevQTFuhuC6uE+iQQBBimLITL94mF3SleVen2f2HkKoNb?= =?us-ascii?Q?NNX8qgDMXJX5vMTsCEe+HZ56kt2gf4ieb2/PJdsfhwfZnFl3J48JPepPof0i?= =?us-ascii?Q?mTSxagPcLbWkyuENR46MMZ1zaLYFh2ohf0FdwF6ZTUgEiLmv+zcmMRR0XI94?= =?us-ascii?Q?ql8nxcUfqCujXySFRJKRD4L2jhxExxnehg+69+ys5lUJT2V5fXG0eBBgo3Ke?= =?us-ascii?Q?yFRwHoSXnOnFzZTGlg19yBxjDpLCRn40nGuucrUQp0bB2qhaEYVxmrOo8x3s?= =?us-ascii?Q?prjoAKvdqyRdLelhawCcZXnS1SmFaML56vEeFCzNMNsTFjmcgHx+vBpSbAH9?= =?us-ascii?Q?/FC8tSHCWkRdBiN1tbUYtKGf7YCI?= 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)(82310400017)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 12:12:47.0204 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 578aca36-935d-4d00-104f-08dc848fa572 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: BN3PEPF0000B371.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8966 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 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 Acked-by: Selwin Sebastian --- 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 10196cae94..d9585a7404 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