From patchwork Sat Sep 23 13:48:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13396753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04CF1CE7A89 for ; Sat, 23 Sep 2023 13:49:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Dq/t+e526i+v9FIKqGQb//FS36PMHeiyBAxQeoQXj2Q=; b=s3Jp7Yi86joFXP qR2APos2jKkG9wB1QhUJbvFVjBXvBmtnjAqH08S/pWTlz4F0MHyw9YjXwBo84TbPXuv+Uv5V1Id+j wBSdJxMg6c4WjMllxTSFW0NL7sgIY0EUUHavJ9mJxygOtkEiXhwAuR6teRA5AAex2XIcZ8VRnpiOr 11J+MYjtR0AcAvN6XMI99toUt7Lu9zZZFLfEZvHCjGxBUwPOnH+tz9a08lQ8510XEfds6BNnScuMP k9ROhnnb5xwaFtYYls32LrFAnq6+cjyliYy8kegLMXpEFW5H6dsM0X0n4tvoFJzQiuWkmuz7vRiOR 9xkZ8me4LefOmbapu0pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qk30x-00B38Q-2K; Sat, 23 Sep 2023 13:49:43 +0000 Received: from mail-vi1eur05on2061d.outbound.protection.outlook.com ([2a01:111:f400:7d00::61d] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qk30t-00B33X-09 for linux-phy@lists.infradead.org; Sat, 23 Sep 2023 13:49:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MX19dRYCCAvt+C31gYhl6SEeH0e8k66R0BeQTWoKL+CaRdgxNG8Dot0pBmLXpV1TeC3eDi+GnIjoexFJN0RWOL1EWpcHkmZYEGqpGds+kJB697+MYHw4vz4caWqtsQUr3L59MllAffbTzzHW+VbQMLc3MNijfUfMWxUo11JRnqKmDj/ERYYlhwx8mIJOFQXyFPZHNrOtZW5g3cBzTqnT+4wq2y/g16XCaFDbq0Mq4pI0giHIu9rVz0GAT7rPgyw5X3jza7AhIRHVcZKy236zMq3jkYXB95Y3VZm2EzaYteN2D0yR5SOkW8tjCEmGkYvodiTbvm17IGIDWzTEK4osUA== 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=XGVOAf2flIf4A1Jltg+syV089a2DDSocHMXzvwBipd4=; b=MIjIAXE8EfCJgUhycXjzLDS/MXzO8k5lUOcPT0Ai3a9Kq6skbc1p4tWoLZedI+7/ABvxfMvUOmxFsNtFl3gxvHiJlL1cdXQqLxXlQBCAYuidj+rCG4XsTYm4j6bvh1N95GAxqjAKjxcp+IWwLv24k2cpCLEtujNpWjDdNcUXs5IdNQ0djRqfczOZICzjeM9ijUx4wR6cUNNcY/Hr1eDkFLHzD7HD67kmRQhTFAI22/CjtWaQ+nM8CmtBb1Y/0RiN30uCsSR/kmnrDvvRz5e1Zdrq4zfgg7z1qG+M7Xk/ziOLj1gKA2ZLvjPjxinnFsnCFOx351OOhRRXaijLfS5Ncg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XGVOAf2flIf4A1Jltg+syV089a2DDSocHMXzvwBipd4=; b=bzBZwSUVEU7E0WsOJKZsw9Y6RivIxT8HpeUYwReY0mhFbeTfmZPPI4g2F5ksS/d2vYYivG5Hu46M/+VetJVw/JebdEUYo9pKlDJqmKuhC3twsNtxiqDminGyHP/fuVy+86EZvigMJp5wMQrNUFiyNmx9SgzbYnQx5dRK4GbVOlQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AS1PR04MB9454.eurprd04.prod.outlook.com (2603:10a6:20b:4d9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.21; Sat, 23 Sep 2023 13:49:28 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::568a:57ee:35b5:e454]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::568a:57ee:35b5:e454%3]) with mapi id 15.20.6813.024; Sat, 23 Sep 2023 13:49:28 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org Cc: "Russell King (Oracle)" , Heiner Kallweit , Andrew Lunn , Florian Fainelli , Madalin Bucur , Ioana Ciornei , Camelia Groza , Li Yang , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sean Anderson , Maxime Chevallier , Vinod Koul , Kishon Vijay Abraham I Subject: [RFC PATCH v2 net-next 05/15] net: add 25GBase-KR-S and 25GBase-CR-S to ethtool link mode UAPI Date: Sat, 23 Sep 2023 16:48:54 +0300 Message-Id: <20230923134904.3627402-6-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230923134904.3627402-1-vladimir.oltean@nxp.com> References: <20230923134904.3627402-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: FR3P281CA0165.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::10) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AS1PR04MB9454:EE_ X-MS-Office365-Filtering-Correlation-Id: beb9c323-d5aa-413c-ffad-08dbbc3be7c8 X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aScDlhiZPYZZWaIqMboVwCNoi/PnzVoRpL0fQyBc1lqLuhn38r++tZv8F5F0JkWcojut6WCJii16XSKl9ojzAAGGEAZYdWktth8X7FRGr4rzrok09sjTQqSj+etEN3e3NJ2kTaM3hpzh3xWdhRXwWNNZ5MhRkWbz0kGWIG18mqESG7xLhLcB7RFX7hlQdy0AzSfC8GFDs3wbxD4U+C6xNbZEVn4bw9/QOPpji43vpUsRhotnBGw9fF5qKFn861ovXoO9mPoWgabCTnOdqeZXhyhjGN9xaxgEjiw+oz2gj1MnMJ+fk3YEUODDvizg8PoHyhTQnI7MVRxux8vj9DRZYuquhnYpVuZ6NSHovxaZQMlIse0I8ROM/kaVVZi+TE5Omat1sIZlnosMkSEcdKq1EMioTzjraWUujreoytZ05ZmqEv72DhIUAy/CtjIBCj9RhMti5Irsf9ytPfKdit0VFgZ+BAbcdjT8PnSsj824QGyAcNwSHADWcuatgolv7aDf0OzS+qIQlolL+CR+52obyb6UUox+lwiW2zTqp2oQCCUiBCrct4ktnuOkHLTQuJ+3Gp9afFSt9OVb92zSdqXqxDgMpOLgdbtMS+PuleSPi2kcgbP654SlbIO39/0hY46T X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(346002)(39860400002)(136003)(396003)(376002)(230922051799003)(1800799009)(451199024)(186009)(66556008)(52116002)(2616005)(6506007)(6512007)(316002)(5660300002)(19627235002)(66946007)(38350700002)(6666004)(478600001)(1076003)(66476007)(26005)(44832011)(2906002)(4326008)(36756003)(41300700001)(7416002)(54906003)(38100700002)(6486002)(8936002)(86362001)(8676002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tKAqdbXgjELMXUcx5HeY9DyqHUXLmjzZ5DMNg9+IDPomuv6e1YwkMYu3AQhf1XQ8aa/b+ulWUOX8HJlDxsLZfMoOiCHjJcsCbtEaEIB4pu9X9a9cG/V6yIpUCQ2RQLmHcXtAe/befk1SYQ0X28KUlSSgcXKF9O0QuUkDPBTA/FjP8zIFs0X0zSVozlj00Pd8vSRRJGVKjKX9CT2ju7YM4xbyJ60zCTL5Am2BXI9aG/lGOfYrtP+MGpHVT5MCEDKqk7UV84+7ebJ3WY93HN0RVWX71jUfvsUUDqkVfut064f4Uv/VVF+CMGDxrmuAQDHwZWZfqZ03quzV5+CzB0fMlEEzQUEU0+XJvp2W22eyJwKmp5p9pXV8X8p7+PnQDfYhzQG656cz7wa3cn/0wdUWk3s6cgU77k9N5c9gSjyM6enBhbba8/ED4cDCrr4t7TImCiF7Y7fSgPClm5D58s6atu05CQFqyuPjc4RG2t2KdEGbjJY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SwP8/3XEJHr7I4Z8OEfkDiVbYGdqIrQYDNHeym/qnlHHKQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: beb9c323-d5aa-413c-ffad-08dbbc3be7c8 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2023 13:49:28.2780 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pUlkhqZ2XSs7POPSSZt2fx10qTxsAgZtjBOhFxrGYbKhGc46NaJnh6Y0DvKvXDzHYvp0t5v4cGculQDD5nAzVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9454 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230923_064939_102716_484CA95A X-CRM114-Status: GOOD ( 14.14 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Some relevant quotes from IEEE 802.3-2018: Clause 73.6.4 Technology Ability Field: | 25GBASE-KR-S abilities are a subset of 25GBASE-KR abilities, and | likewise 25GBASE-CR-S abilities are a subset of 25GBASE-CR abilities. | To allow interoperation between 25GBASE-KR-S and 25GBASE-KR PHY types, | and between 25GBASE-CR-S and 25GBASE-CR PHY types, a device that | supports 25GBASE-KR or 25GBASE-CR should advertise both A9 and A10 | ability bits during auto-negotiation. Definition 1.4.93 25GBASE-CR-S: | IEEE 802.3 Physical Layer specification equivalent to 25GBASE-CR without | support for the RS-FEC sublayer specified in Clause 108. Definition 1.4.96 25GBASE-KR-S: | IEEE 802.3 Physical Layer specification equivalent to 25GBASE-KR | without support for the RS-FEC sublayer specified in Clause 108. Because Linux already has link modes for the full 25GBase-CR and 25GBase-KR, it makes a lot more sense to increase interoperability in the way that IEEE recommends, by being able to advertise the subsets too. Some of the existing drivers which could make use of this, based on a keyword search, are: NFP_MEDIA_25GBASE_KR_S, NFP_MEDIA_25GBASE_CR_S HINIC_25GE_BASE_KR_S, HINIC_25GE_BASE_CR_S ICE_PHY_TYPE_LOW_25GBASE_KR_S, ICE_PHY_TYPE_LOW_25GBASE_CR_S Signed-off-by: Vladimir Oltean --- drivers/net/phy/phy-core.c | 2 +- include/uapi/linux/ethtool.h | 2 ++ net/ethtool/common.c | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c index 966c93cbe616..5f4e2a120abb 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c @@ -13,7 +13,7 @@ */ const char *phy_speed_to_str(int speed) { - BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 102, + BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 104, "Enum ethtool_link_mode_bit_indices and phylib are out of sync. " "If a speed or mode has been added please update phy_speed_to_str " "and the PHY settings array.\n"); diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index f7fba0dc87e5..421eb57fb6e9 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -1787,6 +1787,8 @@ enum ethtool_link_mode_bit_indices { ETHTOOL_LINK_MODE_10baseT1S_Full_BIT = 99, ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100, ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101, + ETHTOOL_LINK_MODE_25000baseCR_S_Full_BIT = 102, + ETHTOOL_LINK_MODE_25000baseKR_S_Full_BIT = 103, /* must be last entry */ __ETHTOOL_LINK_MODE_MASK_NBITS diff --git a/net/ethtool/common.c b/net/ethtool/common.c index f5598c5f50de..2b3ddea465af 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c @@ -211,10 +211,13 @@ const char link_mode_names[][ETH_GSTRING_LEN] = { __DEFINE_LINK_MODE_NAME(10, T1S, Full), __DEFINE_LINK_MODE_NAME(10, T1S, Half), __DEFINE_LINK_MODE_NAME(10, T1S_P2MP, Half), + __DEFINE_LINK_MODE_NAME(25000, CR_S, Full), + __DEFINE_LINK_MODE_NAME(25000, KR_S, Full), }; static_assert(ARRAY_SIZE(link_mode_names) == __ETHTOOL_LINK_MODE_MASK_NBITS); #define __LINK_MODE_LANES_CR 1 +#define __LINK_MODE_LANES_CR_S 1 #define __LINK_MODE_LANES_CR2 2 #define __LINK_MODE_LANES_CR4 4 #define __LINK_MODE_LANES_CR8 8 @@ -223,6 +226,7 @@ static_assert(ARRAY_SIZE(link_mode_names) == __ETHTOOL_LINK_MODE_MASK_NBITS); #define __LINK_MODE_LANES_DR4 4 #define __LINK_MODE_LANES_DR8 8 #define __LINK_MODE_LANES_KR 1 +#define __LINK_MODE_LANES_KR_S 1 #define __LINK_MODE_LANES_KR2 2 #define __LINK_MODE_LANES_KR4 4 #define __LINK_MODE_LANES_KR8 8 @@ -374,6 +378,8 @@ const struct link_mode_info link_mode_params[] = { __DEFINE_LINK_MODE_PARAMS(10, T1S, Full), __DEFINE_LINK_MODE_PARAMS(10, T1S, Half), __DEFINE_LINK_MODE_PARAMS(10, T1S_P2MP, Half), + __DEFINE_LINK_MODE_PARAMS(25000, CR_S, Full), + __DEFINE_LINK_MODE_PARAMS(25000, KR_S, Full), }; static_assert(ARRAY_SIZE(link_mode_params) == __ETHTOOL_LINK_MODE_MASK_NBITS);