-
Notifications
You must be signed in to change notification settings - Fork 39
Controlling LEDs
The leds-mlxcpld
kernel module is in charge of providing standard sysfs access
to the LEDs on Mellanox switches. Hence, in order to control the LEDs, one must
make sure that the module is compiled and loaded.
Module compilation is controlled via the CONFIG_LEDS_MLXCPLD
config option.
To verify whether the module is loaded, the following command can be used:
$ lsmod | grep leds-mlxcpld
If the module is not loaded, it can be loaded using:
$ modprobe leds-mlxcpld
When installing the provided .iso
file according to the
instructions, the module will be automatically loaded on boot
via /etc/modules-load.d/mlxleds.conf
.
To control the LEDs' status from user space, the sysfs interface can be used. For every LED and every color, there exist a directory named:
/sys/class/leds/<driver>:<LED name>:<LED color>
For example, on a Spectrum machine, the following directories are created:
$ ls /sys/class/leds/
mlxcpld:fan1:green
mlxcpld:fan1:red
mlxcpld:fan2:green
mlxcpld:fan2:red
mlxcpld:fan3:green
mlxcpld:fan3:red
mlxcpld:fan4:green
mlxcpld:fan4:red
mlxcpld:psu:green
mlxcpld:psu:red
mlxcpld:status:green
mlxcpld:status:red
Controlling or querying the brightness of a specific LED and color can be done
via the <LED dir>/brightness
file. This file contains integer values that vary
from 0 to <LED dir>/max_brightness
value.
For example, to set the status
LED to be green, the following commands can be
used:
$ cd /sys/class/leds
$ echo 0 > mlxcpld\:status\:red/brightness
$ cat mlxcpld\:status\:green/max_brightness > mlxcpld\:status\:green/brightness
The kernel LEDs infrastructure allows connecting certain LEDs to certain
triggers. To control a LED trigger, the <LED dir>/trigger
file can be used.
To list all available triggers, use the command:
$ cat <LED dir>/trigger
For example, to make a led blink, the timer
trigger can be used. Once the
following command is ran:
$ echo timer > <LED dir>/trigger
Tthe files delay_on
and delay_off
are added under <LED dir>
. With those
two files, it is possible to set the LED frequency and duty-cycle, as the
delay_on
sets the number of miliseconds that the LED will be in ON state, and
the delay_off
sets the number of miliseconds that the LED will be in OFF
state. Hence, the total frequency is 1.0/(delay_on + delay_off) KHz
.
Note: To use the timer trigger, one must make sure that the ledtrig-timer
module is loaded. In the provided .iso
file, the module is loaded on startup.
Installation
System Maintenance
Network Interface Configuration
- Switch Port Configuration
- Netdevice Statistics
- Persistent Configuration
- Quality of Service
- Queues Management
- How To Configure Lossless RoCE
- Port Mirroring
- ACLs
- OVS
- Resource Management
- Precision Time Protocol (PTP)
Layer 2
Network Virtualization
Layer 3
- Static Routing
- Virtual Routing and Forwarding (VRF)
- Tunneling
- Multicast Routing
- Virtual Router Redundancy Protocol (VRRP)
Debugging