From: mike.marciniszyn@gmail.com
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
Alexander Duyck <alexanderduyck@fb.com>,
Jakub Kicinski <kuba@kernel.org>,
kernel-team@meta.com, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Russell King <linux@armlinux.org.uk>,
Daniel Golle <daniel@makrotopia.org>, Kees Cook <kees@kernel.org>,
Simon Horman <horms@kernel.org>,
Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>,
Jacob Keller <jacob.e.keller@intel.com>,
Lee Trager <lee@trager.us>,
Mohsin Bashir <mohsin.bashr@gmail.com>,
Alok Tiwari <alok.a.tiwari@oracle.com>,
Chengfeng Ye <dg573847474@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Andrew Lunn <andrew@lunn.ch>
Cc: mike.marciniszyn@gmail.com, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH net-next 1/3] leds: trigger: netdev: Extend speeds up to 100G
Date: Wed, 20 May 2026 16:03:35 -0400 [thread overview]
Message-ID: <20260520200337.204431-2-mike.marciniszyn@gmail.com> (raw)
In-Reply-To: <20260520200337.204431-1-mike.marciniszyn@gmail.com>
From: "Mike Marciniszyn (Meta)" <mike.marciniszyn@gmail.com>
Add 25G, 40G, 50G, and 100G as available speeds to the netdev LED trigger.
Signed-off-by: Mike Marciniszyn (Meta) <mike.marciniszyn@gmail.com>
---
drivers/leds/trigger/ledtrig-netdev.c | 46 ++++++++++++++++++++++++++-
include/linux/leds.h | 4 +++
2 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c
index 12cb3311ea22..3c758a4cbaec 100644
--- a/drivers/leds/trigger/ledtrig-netdev.c
+++ b/drivers/leds/trigger/ledtrig-netdev.c
@@ -128,6 +128,22 @@ static void set_baseline_state(struct led_netdev_data *trigger_data)
trigger_data->link_speed == SPEED_10000)
blink_on = true;
+ if (test_bit(TRIGGER_NETDEV_LINK_25000, &trigger_data->mode) &&
+ trigger_data->link_speed == SPEED_25000)
+ blink_on = true;
+
+ if (test_bit(TRIGGER_NETDEV_LINK_40000, &trigger_data->mode) &&
+ trigger_data->link_speed == SPEED_40000)
+ blink_on = true;
+
+ if (test_bit(TRIGGER_NETDEV_LINK_50000, &trigger_data->mode) &&
+ trigger_data->link_speed == SPEED_50000)
+ blink_on = true;
+
+ if (test_bit(TRIGGER_NETDEV_LINK_100000, &trigger_data->mode) &&
+ trigger_data->link_speed == SPEED_100000)
+ blink_on = true;
+
if (test_bit(TRIGGER_NETDEV_HALF_DUPLEX, &trigger_data->mode) &&
trigger_data->duplex == DUPLEX_HALF)
blink_on = true;
@@ -337,6 +353,10 @@ static ssize_t netdev_led_attr_show(struct device *dev, char *buf,
case TRIGGER_NETDEV_LINK_2500:
case TRIGGER_NETDEV_LINK_5000:
case TRIGGER_NETDEV_LINK_10000:
+ case TRIGGER_NETDEV_LINK_25000:
+ case TRIGGER_NETDEV_LINK_40000:
+ case TRIGGER_NETDEV_LINK_50000:
+ case TRIGGER_NETDEV_LINK_100000:
case TRIGGER_NETDEV_HALF_DUPLEX:
case TRIGGER_NETDEV_FULL_DUPLEX:
case TRIGGER_NETDEV_TX:
@@ -373,6 +393,10 @@ static ssize_t netdev_led_attr_store(struct device *dev, const char *buf,
case TRIGGER_NETDEV_LINK_2500:
case TRIGGER_NETDEV_LINK_5000:
case TRIGGER_NETDEV_LINK_10000:
+ case TRIGGER_NETDEV_LINK_25000:
+ case TRIGGER_NETDEV_LINK_40000:
+ case TRIGGER_NETDEV_LINK_50000:
+ case TRIGGER_NETDEV_LINK_100000:
case TRIGGER_NETDEV_HALF_DUPLEX:
case TRIGGER_NETDEV_FULL_DUPLEX:
case TRIGGER_NETDEV_TX:
@@ -396,7 +420,11 @@ static ssize_t netdev_led_attr_store(struct device *dev, const char *buf,
test_bit(TRIGGER_NETDEV_LINK_1000, &mode) ||
test_bit(TRIGGER_NETDEV_LINK_2500, &mode) ||
test_bit(TRIGGER_NETDEV_LINK_5000, &mode) ||
- test_bit(TRIGGER_NETDEV_LINK_10000, &mode)))
+ test_bit(TRIGGER_NETDEV_LINK_10000, &mode) ||
+ test_bit(TRIGGER_NETDEV_LINK_25000, &mode) ||
+ test_bit(TRIGGER_NETDEV_LINK_40000, &mode) ||
+ test_bit(TRIGGER_NETDEV_LINK_50000, &mode) ||
+ test_bit(TRIGGER_NETDEV_LINK_100000, &mode)))
return -EINVAL;
cancel_delayed_work_sync(&trigger_data->work);
@@ -433,6 +461,10 @@ DEFINE_NETDEV_TRIGGER(link_1000, TRIGGER_NETDEV_LINK_1000);
DEFINE_NETDEV_TRIGGER(link_2500, TRIGGER_NETDEV_LINK_2500);
DEFINE_NETDEV_TRIGGER(link_5000, TRIGGER_NETDEV_LINK_5000);
DEFINE_NETDEV_TRIGGER(link_10000, TRIGGER_NETDEV_LINK_10000);
+DEFINE_NETDEV_TRIGGER(link_25000, TRIGGER_NETDEV_LINK_25000);
+DEFINE_NETDEV_TRIGGER(link_40000, TRIGGER_NETDEV_LINK_40000);
+DEFINE_NETDEV_TRIGGER(link_50000, TRIGGER_NETDEV_LINK_50000);
+DEFINE_NETDEV_TRIGGER(link_100000, TRIGGER_NETDEV_LINK_100000);
DEFINE_NETDEV_TRIGGER(half_duplex, TRIGGER_NETDEV_HALF_DUPLEX);
DEFINE_NETDEV_TRIGGER(full_duplex, TRIGGER_NETDEV_FULL_DUPLEX);
DEFINE_NETDEV_TRIGGER(tx, TRIGGER_NETDEV_TX);
@@ -521,6 +553,10 @@ static umode_t netdev_trig_link_speed_visible(struct kobject *kobj,
CHECK_LINK_MODE_ATTR(2500);
CHECK_LINK_MODE_ATTR(5000);
CHECK_LINK_MODE_ATTR(10000);
+ CHECK_LINK_MODE_ATTR(25000);
+ CHECK_LINK_MODE_ATTR(40000);
+ CHECK_LINK_MODE_ATTR(50000);
+ CHECK_LINK_MODE_ATTR(100000);
}
return 0;
@@ -533,6 +569,10 @@ static struct attribute *netdev_trig_link_speed_attrs[] = {
&dev_attr_link_2500.attr,
&dev_attr_link_5000.attr,
&dev_attr_link_10000.attr,
+ &dev_attr_link_25000.attr,
+ &dev_attr_link_40000.attr,
+ &dev_attr_link_50000.attr,
+ &dev_attr_link_100000.attr,
NULL
};
@@ -668,6 +708,10 @@ static void netdev_trig_work(struct work_struct *work)
test_bit(TRIGGER_NETDEV_LINK_2500, &trigger_data->mode) ||
test_bit(TRIGGER_NETDEV_LINK_5000, &trigger_data->mode) ||
test_bit(TRIGGER_NETDEV_LINK_10000, &trigger_data->mode) ||
+ test_bit(TRIGGER_NETDEV_LINK_25000, &trigger_data->mode) ||
+ test_bit(TRIGGER_NETDEV_LINK_40000, &trigger_data->mode) ||
+ test_bit(TRIGGER_NETDEV_LINK_50000, &trigger_data->mode) ||
+ test_bit(TRIGGER_NETDEV_LINK_100000, &trigger_data->mode) ||
test_bit(TRIGGER_NETDEV_HALF_DUPLEX, &trigger_data->mode) ||
test_bit(TRIGGER_NETDEV_FULL_DUPLEX, &trigger_data->mode);
interval = jiffies_to_msecs(
diff --git a/include/linux/leds.h b/include/linux/leds.h
index b16b803cc1ac..bf31c246d9e2 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -607,6 +607,10 @@ enum led_trigger_netdev_modes {
TRIGGER_NETDEV_LINK_2500,
TRIGGER_NETDEV_LINK_5000,
TRIGGER_NETDEV_LINK_10000,
+ TRIGGER_NETDEV_LINK_25000,
+ TRIGGER_NETDEV_LINK_40000,
+ TRIGGER_NETDEV_LINK_50000,
+ TRIGGER_NETDEV_LINK_100000,
TRIGGER_NETDEV_HALF_DUPLEX,
TRIGGER_NETDEV_FULL_DUPLEX,
TRIGGER_NETDEV_TX,
--
2.43.0
next prev parent reply other threads:[~2026-05-20 20:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 20:03 [PATCH net-next 0/3] dd LED support for fbnic mike.marciniszyn
2026-05-20 20:03 ` mike.marciniszyn [this message]
2026-05-20 20:16 ` [PATCH net-next 1/3] leds: trigger: netdev: Extend speeds up to 100G Andrew Lunn
2026-05-20 20:03 ` [PATCH net-next 2/3] net: eth: fbnic: Store max_speed from firmware dialog mike.marciniszyn
2026-05-20 20:03 ` [PATCH net-next 3/3] net: eth: fbnic: Add led support mike.marciniszyn
2026-05-20 20:37 ` Andrew Lunn
2026-05-21 14:05 ` Mike Marciniszyn
2026-05-20 20:14 ` [PATCH net-next 0/3] dd LED support for fbnic Andrew Lunn
2026-05-21 11:03 ` Lee Jones
2026-05-21 11:59 ` Andrew Lunn
2026-05-21 13:33 ` Lee Jones
2026-05-21 14:13 ` Mike Marciniszyn
2026-05-21 14:28 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260520200337.204431-2-mike.marciniszyn@gmail.com \
--to=mike.marciniszyn@gmail.com \
--cc=alexanderduyck@fb.com \
--cc=alok.a.tiwari@oracle.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=andriy.shevchenko@linux.intel.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=dg573847474@gmail.com \
--cc=dimitri.daskalakis1@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=kees@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=lee@kernel.org \
--cc=lee@trager.us \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavel@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox