Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2160185rdb; Thu, 7 Dec 2023 22:58:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJUbm+VpQYDYPrQsAgUwB81ORzrmbdTfD1gMiXh1PXIwwK4Ec6+2Z1xb04Bmsf+v7ANT7O X-Received: by 2002:a62:4dc7:0:b0:6ce:2731:5f7d with SMTP id a190-20020a624dc7000000b006ce27315f7dmr2877803pfb.60.1702018711641; Thu, 07 Dec 2023 22:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702018711; cv=none; d=google.com; s=arc-20160816; b=ro/gr5QbrTm0HE2R9QxCZUr+zkhx/D+WUJYcFiuWjROwUF3T/iHKzwTiJb8bSOuOXh rPjSSFzJAqLnMSwmhAmN76lSM+l4JzTLSUp2N4S4uepetN2pQA6qXDnBGAkXdGaemnkD fEZSIPEHElthluxOgzaw6aNF9CiZNdryDTkML6uXSozzXAyOgZ/7OWjn4lIa/U2RSfDR SgtXgJYjC84Z0SHZr26IYn3zW6VObgQxyndwMMugZklt4dABMVlBxpp3fohY2vafrsW0 iOwNGUNOZkcIUcioIVNl5WjVaKf4k6Q95zYdHO9yPIUzcR0LhBI/Hi6z8NcWDG29fzhA y8Tw== ARC-Message-Signature: i=1; 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:subject:cc:to:from:date :dkim-signature; bh=D1RZ9hLc3AGxJWDhEZZHjr4QnouB/x9cVgMdajXxhGs=; fh=qHBprZ1lLE8AYUSHe+ygp9cggropn+Uat3teG5cm9lQ=; b=SGevERh1sqEiUfKKNULd3ZPKwbpj9z5fpOZvddClBAKqAivtzcSJNJpafMe6jrhfTu V3fFOhJQ1dOl76g4zFHN2SCBRDfzvbzuKXSIAFVcTMq5w/eXWhfG23ac+7bqM1x4Mfw2 1I1MCdOan+ND46G6T2xCgRazNUxrCJ/zr1rWYCzJkNNXWI5iz9kTNK40jhLNZyA+LreD IQXxHQ4RmySgd2Q1f5vn1nmgpyFecy+RYoMfCuWIYLIZFkjZaytQvq6HHEkSOBCuCxC8 CszR03prnTGbO5eICGuB9lxNNEftqZ6zvWL9baV5T2twb3mw9IBPn61yB8BFJlue3jeL i6Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=poAC46PK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j25-20020a632319000000b005b8f24e6525si1033550pgj.81.2023.12.07.22.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 22:58:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=poAC46PK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 56A66836E245; Thu, 7 Dec 2023 22:58:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233137AbjLHG6G (ORCPT + 99 others); Fri, 8 Dec 2023 01:58:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233070AbjLHG6D (ORCPT ); Fri, 8 Dec 2023 01:58:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226BC1724 for ; Thu, 7 Dec 2023 22:58:10 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0810C433C7; Fri, 8 Dec 2023 06:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702018689; bh=GMos9O4HmmM+U55/J8+WlvlVh/uZHHlzuooomDAHT8c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=poAC46PKgZhBiAFlrbze1CMXAMTKpwovQsFdJgOEkVmN7GQu2TDRfmUPf2AQwHWlH /ltyjzWd2/4XtT6kOALILrTKGzZDC1lfoxJsseDAKV1Kpd+wIFGr0A/kqzizofxPNH OF/O9+bD8mzuE9+tbQ5cgYrWesJYMKUdHiqesRvRssMTJaSkwkuaDb1Xtv3OEHTguz XlI2+YnDRUIAJ7hxsJqWtO6XzwItfBxmpl9x1qG65JaJcY3GOxr9Gu+5MEB8UzAKk/ og1GQzvJy+IJm9LNkS68ooB6lwUJtl8WkbFO67PyeK6Ly9OhgssdWURyDZ35lE0bka LigbPHxmusB6g== Date: Fri, 8 Dec 2023 07:58:04 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Andrew Lunn Cc: Daniel Golle , Lee Jones , Pavel Machek , Jakub Kicinski , Christian Marangi , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH v3 1/2] leds: trigger: netdev: extend speeds up to 10G Message-ID: <20231208075804.4f8559e6@dellmb> In-Reply-To: References: <99e7d3304c6bba7f4863a4a80764a869855f2085.1701143925.git.daniel@makrotopia.org> <20231207172923.62ce530e@dellmb> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 22:58:29 -0800 (PST) On Thu, 7 Dec 2023 18:11:29 +0100 Andrew Lunn wrote: > On Thu, Dec 07, 2023 at 05:29:23PM +0100, Marek Beh=C3=BAn wrote: > > On Tue, 28 Nov 2023 04:00:10 +0000 > > Daniel Golle wrote: > > =20 > > > Add 2.5G, 5G and 10G as available speeds to the netdev LED trigger. > > >=20 > > > Signed-off-by: Daniel Golle > > > Reviewed-by: Andrew Lunn =20 > >=20 > > So what will happen when there are more speeds? Will we create a > > separate file for each speed? > >=20 > > Will we have a separate sysfs file for 10, 100, 1000, 2500, 5000, > > 10000, 20000, 25000, 40000, 50000, 56000, 100000, 200000, 400000, > > 800000 ? > >=20 > > These are all speeds from include/uapi/linux/ethtool.h. > >=20 > > Maybe we should have reused ethtool link mode bits, or something... =20 >=20 > That gets pretty ugly. The bits are not in any logical order, since > they just get appended onto the end as needed. >=20 > > Also, the files should only be present if the requested speed is > > supported by the net device. So if 2500 mbps is not supported, there > > should no be link_2500. =20 >=20 > Yes, this would be nice. We have the information in the phy_setting > settings[] table in phy-core.c. What if the netdev does not have a PHY? The MAC also has speed information. Maybe create a function bool dev_supports_speed(netdev, speed) ? Marek