From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.208.67 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796107756; b=E+sRm2bg/6L6PbGGwfB3GAfv1snEb3yymHGZeYS25CSifOO6WPnfBrbPaHN9IXcC83Cd nj5JM5s40iqSOjIur8kkJK96NpATLVV9ZgtK5AruABHni1SARejVbiFHk1KPHpK9dpgPL K3/fenK/FOoM4p2ME1xwTOCt61VmHhSX8kbEk9vCKrB2/pgkaz7iA5SHL4vwCfEWa2z/+ Epl+1HdblVsfMrB86PHNG/ppB2bKyY086dCe2vHqSW9LyNuA1gP5Q9F5eclqYwDJt+ggD fVaFCBG260DFfyE6Svo46zsOePgGVDCwGr77mitSqBHzEerpc0KZ+uBmyEeH2Z2PXbQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107756; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: From:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:CC:X-Mailer: X-Originating-IP:X-ClientProxiedBy:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=ghJEN4id3r36LeahSHuLVTFbGiTurzqrsxckCd9sDX0=; b=gAJiqiT5yXLDMFKCfiGvdoBAal2W70t1gAaIub7gRulw9BmT12dJ5ZhvtHI+BSEE7mEl ZZX0XvrWWkpW8KbtBl9T0UazifFmOgLdOTM7HuE6ZFzg9ib6bQSXyOp4Omg0KpjF1RNCh kWJi3l2ZYt5o/qg+JngePK1uOhfJZZQSd28ZoSjiUOiWNKsGSmSdAKx/Fy43nUtBDvT+E uCfF5TisQQiCOg7rgeQPw3DhXRXX0aNwSbJWy0PzCoV7o2B/2sISVmxztJL6hACVtqtSP /X4fdk9MAonqQigVgs/X25SOkp6JXOGkeJ0PCTLaDtyfNueXLz0iNmnqiWDpob53tQQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=U++fttz9; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.208.67 Received: from PH0PR06CU001.outbound.protection.outlook.com (mail-westus3azon11011067.outbound.protection.outlook.com [40.107.208.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 542B1606A33E for ; Tue, 1 Dec 2026 06:49:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 542B1606A33E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=U++fttz9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gtskep/e2W75vQs/YKA9X8sXDOL3HNfu6J/pUhInessptg7M47ouMei/2+PnUKjAwt0wz2TjO+UYPH2D1qEMT5QlFFllc9KgJ674WYO/46qjJju3ZOOlBThmNbj/y/oQYBFp1XO33d5HMNAXYz2kpW/f8gUFmZG4bunegbZQeyC4SwLgtJ1ConV/4oKTTdwy7Wu15L1qsjSOTqNc6XlV+y9yFr9F0K5TWUY91zgsKm4bc+t+oKxDGLhM54gZY8sfmHVRLT3AsiGbACDzcEXsuvQf5aYc1gsowVY7zKloGqgz4cNR7YBoqA3eww3fFLqUBe8nMDK20AHPNWHf/ug4zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ghJEN4id3r36LeahSHuLVTFbGiTurzqrsxckCd9sDX0=; b=vRG3fYBiy8dj0laNIZ13+5S3QgcF3YJ/N93zN69+zK3NggvgoaqpsoQ9GwjC3juVGT6HNgSHPXC+FCgnSnHG69jXhjYMoY0gjTG+qLRvDgFlLAMsTGLXw4jsG0wtWE2xV49O1GWt6N3c7CZYuN9TgDyKHL60TuGc/wBd4Hk+gl+D851WXU7uv5OOZDnBPMJFMXOcY1/sa1kDYIr7/R+dOnIPV8grMtxgvqjIcY2pwnAJywxPA/fvJT9Z53lmuEqb4CA6VmyYORHdvCuLlSMMvTwxR6Uus59eVxAqG8LJ9fcYSt3/eqfu37JdtsYQPQ8mUeaaRAGr2vNr1vsb/wX/6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lunn.ch 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=ghJEN4id3r36LeahSHuLVTFbGiTurzqrsxckCd9sDX0=; b=U++fttz9XjQs1UN0pK2e5RgH1e7kBo89o2FywaDGQDRodMnTY330tikyj/jRU3HSn1K/6MVu/IPde+9E/+RWzQ8BG/a2SQ5SfNQfgmWXlNdhoQO3AmgP2dPKJ599HgESKi7xX+S2kMAfrXgwawuFpM51Farl+holpahcZbFkwGw= Received: from CH0P220CA0011.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::13) by IA1PR12MB7496.namprd12.prod.outlook.com (2603:10b6:208:418::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Tue, 1 Dec 2026 06:49:11 +0000 Received: from CH2PEPF00016D4C.namprd02.prod.outlook.com (2603:10b6:610:ef:cafe::6a) by CH0P220CA0011.outlook.office365.com (2603:10b6:610:ef::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.8 via Frontend Transport; Tue, 1 Dec 2026 06:49:11 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; 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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CH2PEPF00016D4C.mail.protection.outlook.com (10.167.244.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 06:49:10 +0000 Received: from SCSEJOYNER01.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 00:49:07 -0600 From: Eric Joyner Subject: [PATCH net-next v7 0/6] ionic: FEC reporting fixes and .get_fec_stats handler Date: Mon, 30 Nov 2026 22:48:52 -0800 Message-ID: <20261130-ionic-get-fec-stats-v7-0-730c1672f561@amd.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/3XOz2rDMAwG8FcpPs/Bkv/FO+09xg6uLbceNBlJC C0l7z6Rw5qM9ig+fT/pLkYaKo3i/XAXA811rH3Hg387iHSO3YlkzTwLVOhUC0ZyXpM80SQLJTl OcRplCMprF5wJqhXc/Bmo1OuqfoqOVzu6TuKLk3Mdp364redmWPNV9hoQjEJowKIPEiS/lZrv/ tbR8BEvuUn9ZRVmfLRe/TMjA6CLIp+RvMK9oP8EAPVC0FLJIy+UbHVW0e8FsxHAPRcMCxltihQ KUPtPsFuhfS5YFlJIisjpXEzaC24joH0uOBYgHk1IHhlSD2FZll8usymX/AEAAA== X-Change-ID: 20260814-ionic-get-fec-stats-990736964908 To: CC: Brett Creeley , Andrew Lunn , "David S. Miller" , "Jakub Kicinski" , Paolo Abeni , Simon Horman , Vadim Fedorenko , "Nikhil P. Rao" , Eric Joyner , Eric Dumazet X-Mailer: b4 0.14.3 X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00016D4C:EE_|IA1PR12MB7496:EE_ X-MS-Office365-Filtering-Correlation-Id: 8518cac5-c8ab-4b26-7622-08df4f77347d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700016|82310400026|1800799024|23010399003|11063799006|6133799003|261009223027099003|18002099003|13003099007|10067099003|261026140227099003|56012099006|261102123227099003|261026121527099003|261028144727099003|261021135927099003|261021123027099003|261022105027099003|261021121427099003; X-Microsoft-Antispam-Message-Info: 0IT+fvZslMvGwqzsrUu1qOzt7jPpLedKv9tPo+iwb75vT0Fn6Rs/FQjXgN16lLpYmTD8EAZzwR5hqa/g5S6cZNQFzUSMGtCMyJiYmp9h4NUVvzZnfSosC9b64Cv2YnVwc89u5/BUPuR8aGbzQj2Sr5P+ontgvOYCBPNRyJYD+ZjMEyDPur8N/H15VRTvt5tRE99K5stqOCu76mz7jPEz3oWHcKo0fTk8dNivgBHVGakYWMW4DIxKEluOjvzswpnodezZw/kox5kOGc08qxgvi7QWywqGkSbFWWxRdUhFlxYdXmrL3oMj3bnEQZA57SoJ4RFYr3ag7S0gJsYYyEKPF0GkjRJtu33kR0tzyBVzx3Bf0FY1xKck+Egj3hjwZHCUUHtmmifvq7x/tJ4JvG9Wdq5tsLdUidkgysVQlGZ/EemJKm3Pv7te0mLYYonwPNrCVFnq1pciJOtoSFkiLCQ/b1Dy3lmbBOpO9AustIhL/LKbn4zcvYt1jAzniYQzpehKbDp9Oabvr1wUUG07yenyBNhOA+WRPRam2ZbWilqLWoKPR/3rmUH0PvQ0SoKya+J51budbeVf6OjFfn8xqkSeGmz6T+JUjzGCcxU+8yxUsy6C5nxan/D+AnlC86xJq+AyrOkf0ntqy/m0NXHWHKGNhQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700016)(82310400026)(1800799024)(23010399003)(11063799006)(6133799003)(261009223027099003)(18002099003)(13003099007)(10067099003)(261026140227099003)(56012099006)(261102123227099003)(261026121527099003)(261028144727099003)(261021135927099003)(261021123027099003)(261022105027099003)(261021121427099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sajVrFJF2CkRiE4Kt//RavDGDfCYgKKfnUS2VMHXdaH+e/8KB6HsLinfzBdZcdyGDCbSuJO0eNiWpHA/zcJJLIjFp/7mxLvBkc4mWJtp31ASY2AvXtlJec75f5ROGLIxr8REBdPFtixHWnnVjbGGJjr5dgMswD88Ii316iELd2WWhuQ44plp9jOAWcd9CEaPdxNCMP7u4Wr/HW4x/KRnzl7e5vxTvDadeoCYBcMf/onPvZQO4gOn+NbiDplCcF3s0Opm1qZt0NamSSD30JmzcOc5Vr/kjjYd6iB42VvE00G8Qxh/P0msiGFaLHSTZ5kxZL6J1V4zQ42UU9vrit6ZX9a1suMEsWxqetnGcLvngL5XFTkb4op4KoNnldvafbl8OEyfmcxQXKx6bYdBOdo7H4mg4J4bFbIE2HdVFhUm2+KRWyXm0YJaifYmaF2P1gko X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 06:49:10.9680 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8518cac5-c8ab-4b26-7622-08df4f77347d 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF00016D4C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7496 Add a .get_fec_stats ethtool handler, and fix the FEC reporting it depends on. Patch 1 makes the driver write the IONIC_STAT_INVALID markers in extra_stats, and take the ethtool -S snapshot of that block, one counter at a time, so a reader that tests a single counter cannot see a torn value. Patch 2 adds FEC off to the supported and advertised link modes. Firmware does not report which FEC modes a port supports, so the supported list holds every mode an ionic device can use, and firmware rejects a request for a mode the port cannot run. Patches 3-5 fix ionic_get_fecparam(). fec->fec reported the constant set of supported modes instead of the configured mode, which is Auto while autoneg is enabled, and fec->active_fec reported the requested mode instead of the operational one. Patches 2, 3 and 5 have Fixes: tags, but the later patches build on the lines they change, so they are sent to net-next with them rather than to net. The bugs only affect what ethtool reports. Patch 6 adds the handler. It reports statistics only while the active FEC mode is RS. The port_info lifetime problem that the AI review raised on v1 and v2 is fixed in net-next by commit d90d1a768b3b ("ionic: fix port_info use-after-free on firmware recovery"). Claude was used while developing this series, to investigate the review questions and to help write the code changes and commit messages. The series was tested on AMD Pensando NICs: ethtool --show-fec with and without statistics, the FEC link modes, and ethtool -S, before and after PCI resets run while those queries were looping. Signed-off-by: Eric Joyner --- ionic_get_link_ksettings() still advertises the configured FEC mode while autoneg is enabled, as it has since the driver was added; firmware does not report the FEC modes it advertises, and changing that report is left out of this series. Changes in v7: - rebase on net-next - patch 1: - add a Fixes: tag (netdev AI review of v6) - wrap a line over 80 columns - patches 3-6: - report ETHTOOL_FEC_AUTO as the configured FEC mode while autoneg is enabled (netdev AI review of v6) - fill fec and active_fec in ionic_get_fec_modes(), which reads config.an_enable once, and gate the statistics in patch 6 on its active mode; this replaces ionic_active_fec_type() - drop Vadim's Reviewed-by, since these patches changed - patch 6: - rename a parameter to keep lines within 80 columns - v6 was sent by Brett; if patchwork still lists it as New, it is superseded by this version - Link to v6: https://lore.kernel.org/r/20261125-ionic-get-fec-stats-v6-0-1ab49c729c00@amd.com Changes in v6: - rebase on net-next - patch 1: - take the ethtool -S snapshot of extra_stats one counter at a time with READ_ONCE() too, and retitle the patch (netdev AI review of v5) - patch 2: - read config.fec_type once in ionic_get_link_ksettings() - drop the comment that repeated the commit message - describe the devices generically in the commit message - patch 4: - read config.fec_type once in ionic_get_fecparam() (netdev AI review of v5) - patch 5: - drop the comment that repeated the commit message - patches 5 and 6: - pass the configured FEC type to ionic_active_fec_type() so that it is read once (netdev AI review of v5) - Link to v5: https://patch.msgid.link/20261118-ionic-get-fec-stats-v5-0-c9c0ee63df4c@amd.com Changes in v5: - Patch 2: say that firmware leaves the supported FEC types in the port identity unset (netdev AI review of v4). - Link to v4: https://lore.kernel.org/r/20261116-ionic-get-fec-stats-v4-0-d25cae9f1e87@amd.com Changes in v4: - Add patch 2, which reports FEC off as a supported link mode (netdev AI review of v3). - Patch 5: with autoneg off, report the configured FEC mode as active, so firmware that predates status.fec_type no longer reports forced-FEC links as FEC off, and add a Fixes: tag (netdev AI review of v3). - Patch 6: gate the statistics on the same active FEC mode as patch 5. - Patch 6: explain why an RS check is enough for the histogram (netdev AI review of v3). - Rebase onto current net-next. - Link to v3: https://lore.kernel.org/r/20261104-ionic-get-fec-stats-v3-0-b261fd53d0a7@amd.com Changes in v3: - Read each counter with READ_ONCE() and drop the struct copy of extra_stats (netdev AI review of v2). - Report statistics based on status.fec_type, the operational FEC mode, instead of config.fec_type, matching the active FEC mode that patch 4 reports. - Add patches 1-4, which fix the FEC reporting the handler depends on. Patches 1-4 are by Nikhil, who is also a Co-developed-by on patch 5. - Drop Vadim's Reviewed-by from v1, since the code has changed. - Rebase onto current net-next. - Link to v2: https://lore.kernel.org/r/20260814-ionic-get-fec-stats-v2-1-13f0e7d2e702@amd.com Changes in v2: - Latch each histogram bin into a local before testing it against IONIC_STAT_INVALID, so the sentinel check and the store cannot be folded into two separate reads of the firmware-updated DMA buffer. - Explain in the commit message why the RS FEC check gates every reported counter rather than just the histogram: they all come from the RS decoder, including fec_corrected_bits_total despite its name. - Rebased onto current net-next. - Link to v1: https://lore.kernel.org/r/20260731214021.15279-1-eric.joyner@amd.com --- Eric Joyner (2): ionic: report FEC off as a supported link mode ionic: Add .get_fec_stats ethtool handler Nikhil P. Rao (4): ionic: access the extra_stats counters one at a time ionic: report the configured FEC mode in ethtool_fecparam.fec ionic: map the FEC type through a helper in ionic_get_fecparam() ionic: report the operational FEC mode from ethtool --show-fec .../net/ethernet/pensando/ionic/ionic_ethtool.c | 138 ++++++++++++++++++--- drivers/net/ethernet/pensando/ionic/ionic_main.c | 10 +- drivers/net/ethernet/pensando/ionic/ionic_stats.c | 8 +- drivers/net/ethernet/pensando/ionic/ionic_stats.h | 2 + 4 files changed, 141 insertions(+), 17 deletions(-) --- base-commit: d35a725a7c96504f7deece4dfaa83bee6a98fe0e change-id: 20260814-ionic-get-fec-stats-990736964908 Best regards, -- Eric Joyner