Page MenuHomeFreeBSD

iflib: Create led(4) devices
Needs ReviewPublic

Authored by kbowling on Oct 9 2021, 3:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 20, 8:25 PM
Unknown Object (File)
Fri, Sep 19, 5:26 PM
Unknown Object (File)
Sep 15 2025, 10:19 AM
Unknown Object (File)
Sep 11 2025, 8:30 PM
Unknown Object (File)
Aug 14 2025, 11:56 PM
Unknown Object (File)
Aug 14 2025, 11:11 PM
Unknown Object (File)
Aug 3 2025, 3:28 AM
Unknown Object (File)
Jul 26 2025, 5:35 PM

Details

Reviewers
markj
shurd
Group Reviewers
Intel Networking
iflib
Summary

If the driver defines an led_func, have the framework create them during attach.

PR: 246885
Reported by: Jose Luis Duran <jlduran@gmail.com>

Test Plan

Tested on I350:
echo "f3" > /dev/led/igb0
echo "0" > /dev/led/igb0

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Jose submitted a variant where the driver (e1000 in this case) calls the iflib_led_create() function in its post attach. I am open to either approach if anyone has any thoughts one way or the other.

I prefer this approach.

Regardless of which patch you choose, on my home router (2 i211-based NICs), identifying /dev/led/igb0 works, but /dev/led/igb1 do not.

Nevertheless, the LED devices are created as well. Thank you!

Seems ok. This kind of reflection looks a bit hacky but I see it used elsewhere. Probably we should have some kobj.h helper to do it.

sys/net/iflib.c
5253

And on the next line too.

5257