Driver Usage and Configuration
Note that the FreeBSD interface name has changed from mlx5en to mce. Note that ifconfig and sysctl commands were updated accordingly.
To assign an IP address to the interface, run:
#> ifconfig mce<N> <ip>
Note:
To check driver and device information:
#> pciconf -lv | grep mlx
#> flint -d pci0:<x>:0
:0
q
Example:
#> pciconf -lv | grep mlx -C 3
mlx5_core0@pci0
:33
:0
:0
: class
="0x020000"
card=0x001415b3
chip=0x101315b3
rev=0x00
hdr=0x00
vendor = 'Mellanox Technologies'
device = 'MT27620 Family'
class
= network
subclass = ethernet
mlx5_core1@pci0
:33
:0
:1
: class
="0x020000"
card=0x001415b3
chip=0x101315b3
rev=0x00
hdr=0x00
vendor = 'Mellanox Technologies'
device = 'MT27620 Family'
class
= network
#> flint -d pci0:33
:0
:0
: q
Image type: FS3
FW Version: 12.12
.0610
FW Release Date: 3.9
.2015
Description: UID GuidsNumber
Base GUID: e41d2d03006094ec 20
Base MAC: 0000e41d2d6094ec 20
Image VSD:
Device VSD:
PSID: MT_2190110032
#> flint -d pci0:6
:0
:0
dc | grep Description
;;Description = ConnectX-4
VPI adapter card; EDR IB (100Gb/s) and 100GbE; dual-port QSFP28;
PCIe3.0
x16; ROHS R6
#>sysctl -a
Example:
sysctl -a | grep Mellanox
dev.mlx5_core.1
.%desc: Mellanox Ethernet driver (3.0
.0
-RC2)
dev.mlx5_core.0
.%desc: Mellanox Ethernet driver (3.0
.0
-RC2)
version:
dmesg:
#> dmesg
Example:
Mlx5_core0: INFO: firmware version:
12.12
.2008
sysctl:
#> sysctl -a
Example:
dev.mlx5_core.
0
.hw.fw_version:12.12
.2008
To query stateless offload status:
#> ifconfig mce<x>
Note:
#> ifconfig mce<x> [rxcsum|-rxcsum] [txcsum|-txcsum] [tso|-tso] [lro|-lro]
Note:
#> sysctl -a | grep coalesce_mode
Example:
#> sysctl -a | grep coalesce_mode
dev.mce.0
.conf.rx_coalesce_mode: 1
dev.mce.1
.conf.rx_coalesce_mode: 1
coalesce mode '0' indicates interrupt timer is resetting with each interrupt event.
coalesce mode '1' indicates interrupt timer is resetting with each received packet.
#> sysctl -a | grep tx_coalesce_usecs
#> sysctl -a | grep rx_coalesce_usecs
To query and modify values for number of received packets between interrupts:
#> sysctl -a | grep tx_coalesce_pkts
#> sysctl -a | grep rx_coalesce_pkts
Example:
#> sysctl -a | grep rx_coalesce_usecs
dev.mce.1
.conf.rx_coalesce_usecs: 3
dev.mce.0
.conf.rx_coalesce_usecs: 3
#> sysctl -a | grep rx_coalesce_pkts
dev.mce.1
.conf.rx_coalesce_pkts: 32
dev.mce.0
.conf.rx_coalesce_pkts: 32
To query ring size values:
#> sysctl -a | grep mce| grep _size
Example:
#> sysctl -a | grep mlx | grep _size
dev.mce.1
.conf.rx_queue_size: 1024
dev.mce.1
.conf.tx_queue_size: 1024
dev.mce.1
.conf.rx_queue_size_max: 8192
dev.mce.1
.conf.tx_queue_size_max: 8192
#> sysctl dev.mce.<N>.conf.rx_queue_size=[N]
#> sysctl dev.mce.<N>.conf.tx_queue_size=[N]
Note:
To obtain device statistics:
#> sysctl -a | grep mce | grep stat
#> sysctl dev.mce.<N>.conf.debug_stats=1
#> sysctl -a | grep mce | grep stats
To show out of receive buffers counter:
sysctl dev.mce.<N>.vstats.rx_out_of_buffer
dev.mce.<N>.vstats.rx_out_of_buffer: 0
To verify support for Rx/Tx pause frames:
ifconfig
#> ifconfig media: Ethernet autoselect (100GBase-CR4 <full-duplex,rxpause,txpause>)
sysctl
#> sysctl dev.mce.<N>.rx_pauseframe_control dev.mce.<N>.rx_pauseframe_control:
1
#> sysctl dev.mce.<N>.tx_pauseframe_control dev.mce.<N>.tx_pauseframe_control:1
To enable/disable Rx/Tx pause frames:
ifconfig
To enable Rx/Tx pause frames, run:
ifconfig mce<N> mediaopt txpause,rxpause
To disable Rx/Tx pause frames, run:
ifconfig mce<N> -mediaopt txpause,rxpause
sysctl
sysctl dev.mce.<N>.rx_pauseframe_control=
1
sysctl dev.mce.<N>.tx_pauseframe_control=1
0 = disable, 1 = enable
To show all supported media:
#> ifconfig -m mce<x>
supported media:
media autoselect
media 50GBase-CR2 mediaopt full-duplex
media 25GBase-SR mediaopt full-duplex
media 25GBase-CR mediaopt full-duplex
media 100GBase-LR4 mediaopt full-duplex
media 100GBase-SR4 mediaopt full-duplex
media 100GBase-CR4 mediaopt full-duplex
media 40Gbase-LR4 mediaopt full-duplex
Note:
The list of supported media is different in ConnectX-4 and ConnectX-4 Lx.
To set new media:
#> ifconfig -m mce<x> media <y> mediaopt full-duplex
Note:
When updating the media, make sure to choose the right cable type.
Once the driver is loaded, both ports will be activated, meaning that an ifnet will be created for each port.