-
Notifications
You must be signed in to change notification settings - Fork 39
Hardware Messages Monitoring
The driver communicates with the device using Ethernet packets called
Ethernet Management Datagrams (EMADs). As of Linux 4.8, it has
become possible to monitor all messages sent between the driver and the
device using a kernel tracepoint called devlink:devlink_hwmsg
.
For debugging, EMADs can be recorded to a PCAP file and dissected using Wireshark.
This page describes how to record the packets and dissect them.
Using devlink-hwmsg.py
it is possible to hook on the
devlink:devlink_hwmsg
tracepoint and record events into a PCAP file.
Hardware message packets contain data in a custom TLV-based format. The
tool bwz.py
can be used to filter the data based on values inside
individual TLV fields, and to slice the data (i.e., omit some TLV
records or remove the TLV headers altogether).
The scripts may be found in the following repository in
Debugging/EMADs
folder:
switch$ git clone https://github.com/Mellanox/mlxsw.git
Connect to the switch and run:
switch$ ./devlink-hwmsg.py | ./bwz.py -s buf -w emad.pcap -t 1
This command will record the EMADs into emad.pcap
with LINKTYPE=1
(i.e., Ethernet) in the PCAP header.
bwz
depends on pcapy
, a Python package for processing PCAP files.
devlink-hwmsg
depends on python3-perf
package.
It is also possible to record EMADs using the emadump
utility, as
explained here.
This phase should be done once.
- Download the latest stable release of Wireshark
- Open Wireshark, click Help → About Wireshark
- Go to 'Folders' tab
- Copy the EMAD dissector to 'Personal Plugins' or 'Global Plugins' folder
- Reopen Wireshark or use Ctrl+Shift+L to reload Lua plugins
- Go to 'Plugins' tab
- Make sure that
emad_dissector
appears in the list
- Open Wireshark, click File → Open
- Choose the PCAP file
Install the latest stable release of Wireshark:
$ sudo dnf install wireshark
-
Download the EMAD dissector
-
Instruct Wireshark to use the EMAD dissector and dissect
emad.pcap
$ wireshark -X lua_script:emad_dissector.lua -r emad.pcap
At this point a window similar to the one above should be presented.
Wireshark allows filtering packets by their fields. For example, it is
possible to filter all the EMADs with a specific register ID:
NOTE: A full list of the available protocols and fields is available
through the menu View → Internals → Supported Protocols:
More information appears in Wireshark documentation.
General information
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