Useful Commands/Hardware

From Fundamental Ramen
Jump to navigation Jump to search

Banchmark

Test read performance of device on root mount point

# TODO
sudo hdparm -tT $(df -h | awk '/\/$/ { print $1 }')
/dev/md0:
 Timing cached reads:   4286 MB in  2.00 seconds = 2143.42 MB/sec
 Timing buffered disk reads: 574 MB in  3.00 seconds = 191.08 MB/sec

Read Hardware Information

List PCI Devices

lspci -k
06:00.1 Class 0200: Device 1077:8070 (rev 02)
        Subsystem: Device 7053:1002
        Kernel driver in use: qede
07:00.0 Class 0200: Device 8086:15e4 (rev 11)
        Subsystem: Device 8086:0000
        Kernel driver in use: ixgbe

Device ID could be search here:

https://devicehunt.com/

Display Ethernet card information

ethtool -i eth4
driver: qede
version: 8.33.9.0 [storm 8.33.8.0]
firmware-version: mbi 8.30.29 [mfw 8.30.18.0]
bus-info: 0000:06:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes

List USB Devices

lsusb
|__usb1          1d6b:0002:0404 09  2.00  480MBit/s 0mA 1IF  (Linux 4.4.59+ xhci-hcd xHCI Host Controller 0000:00:15.0) hub
  |__1-2         051d:0002:0106 00  1.10  1.5MBit/s 2mA 1IF  (APC Back-UPS ES 550G FW:843.K4 .D USB FW:K4  4B1621P13816  )
  |__1-4         f400:f400:0100 00  2.00  480MBit/s 200mA 1IF  (Synology DiskStation 7F008C199FCA6095)
|__usb2          1d6b:0003:0404 09  3.00 5000MBit/s 0mA 1IF  (Linux 4.4.59+ xhci-hcd xHCI Host Controller 0000:00:15.0) hub
  |__2-1         0b95:1790:0100 ff  3.00 5000MBit/s 496mA 1IF  (ASIX Elec. Corp. AX88179 00000000000008)

List loaded kernel modules

lsmod

Module name of Ethernet Cards

Linux built-in driver listed here:

https://www.kernel.org/doc/html/latest/networking/device_drivers/ethernet/index.html

Information of popular cards:

Chipset Speed kernel
module
bonding
balance-alb
RoCE
Mellanox ConnectX-3 Pro EN 40G mlx4
Intel X710 40G i40e
Intel X540/X550 10G ixgbe
Marvell QLogic QL41xx 10G/25G qede
Marvell AQtion AQC107 10G atlantic atlantic(vendor)
Marvell AQtion AQC111U 5G atlantic
Marvell AQtion AQC112U 2.5G atlantic
Realtek RTL8156 2.5G r8152(vendor) r8152(DSM)
Realtek RTL8153 1G r8152
ASIX AX88179 1G ax88179_178a(vendor) X

Kernel drivers were placed in this directory /lib/modules.

These commands can list ethernet drivers.

Commands
# Goto ethernet directory than list.
cd /lib/modules/$(uname -r)/kernel/drivers/net/ethernet
find . -name '*.ko*'

# Or list directly.
find /lib/modules/$(uname -r)/kernel/drivers/net/ethernet -name '*.ko*'
Output
...
./intel/i40e/i40e.ko.xz
./intel/iavf/iavf.ko.xz
./intel/ice/ice.ko.xz
./intel/igb/igb.ko.xz
./intel/igbvf/igbvf.ko.xz
./intel/igc/igc.ko.xz
./intel/ixgbe/ixgbe.ko.xz
./intel/ixgbevf/ixgbevf.ko.xz
./mellanox/mlx4/mlx4_core.ko.xz
./mellanox/mlx4/mlx4_en.ko.xz
./mellanox/mlx5/core/mlx5_core.ko.xz
...