I was building development environment for DPDK on CX6DX. After installing OFED softwares, I find that I can not set CX6DX to switchdev mode.
output:
# echo switchdev > /sys/class/net/eth20/compat/devlink/mode
bash: echo: write error: Invalid argument
dmesg output:
[ 3622.167092] mlx5_core 0000:45:00.0: E-Switch: Disable: mode(LEGACY), nvfs(2), necvfs(0), active vports(0)
[ 3622.167198] bus: 'auxiliary': remove device mlx5_core.rdma.2
[ 3622.167598] PM: Removing info for No Bus:issm2
[ 3622.167695] PM: Removing info for No Bus:umad2
[ 3622.167805] PM: Removing info for No Bus:uverbs2
[ 3622.171104] PM: Removing info for No Bus:mlx5_2
[ 3623.418766] PM: Removing info for auxiliary:mlx5_core.rdma.2
[ 3623.418803] device: 'mlx5_core.eth-rep.2': device_add
[ 3623.418820] bus: 'auxiliary': add device mlx5_core.eth-rep.2
[ 3623.418839] PM: Adding info for auxiliary:mlx5_core.eth-rep.2
[ 3623.418860] bus: 'auxiliary': __driver_probe_device: matched device mlx5_core.eth-rep.2 with driver mlx5_core.eth-rep
[ 3623.418867] bus: 'auxiliary': really_probe: probing driver mlx5_core.eth-rep with device mlx5_core.eth-rep.2
[ 3623.418876] mlx5_core.eth-rep mlx5_core.eth-rep.2: no default pinctrl state
[ 3623.418898] driver: 'mlx5_core.eth-rep': driver_bound: bound to device 'mlx5_core.eth-rep.2'
[ 3623.418915] bus: 'auxiliary': really_probe: bound device mlx5_core.eth-rep.2 to driver mlx5_core.eth-rep
[ 3623.418926] device: 'mlx5_core.rdma-rep.2': device_add
[ 3623.418933] bus: 'auxiliary': add device mlx5_core.rdma-rep.2
[ 3623.418982] PM: Adding info for auxiliary:mlx5_core.rdma-rep.2
[ 3623.418999] bus: 'auxiliary': __driver_probe_device: matched device mlx5_core.rdma-rep.2 with driver mlx5_ib.rep
[ 3623.419003] bus: 'auxiliary': really_probe: probing driver mlx5_ib.rep with device mlx5_core.rdma-rep.2
[ 3623.419008] mlx5_ib.rep mlx5_core.rdma-rep.2: no default pinctrl state
[ 3623.419022] driver: 'mlx5_ib.rep': driver_bound: bound to device 'mlx5_core.rdma-rep.2'
[ 3623.419035] bus: 'auxiliary': really_probe: bound device mlx5_core.rdma-rep.2 to driver mlx5_ib.rep
[ 3623.421954] mlx5_core 0000:45:00.0: mlx5_cmd_out_err:829:(pid 7722): CREATE_FLOW_GROUP(0x933) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x201c1c), err(-22)
[ 3623.422218] mlx5_core 0000:45:00.0: mlx5_rdma_enable_roce_steering:71:(pid 7722): Failed to create RDMA RX flow group err(-22)
[ 3623.423116] mlx5_core 0000:45:00.0: mlx5_rdma_enable_roce:164:(pid 7722): Failed to enable RoCE steering: -22
[ 3623.424549] bus: 'auxiliary': remove device mlx5_core.rdma-rep.2
[ 3623.424601] PM: Removing info for auxiliary:mlx5_core.rdma-rep.2
[ 3623.424637] bus: 'auxiliary': remove device mlx5_core.eth-rep.2
[ 3623.424662] PM: Removing info for auxiliary:mlx5_core.eth-rep.2
[ 3623.424685] device: 'mlx5_core.rdma.2': device_add
[ 3623.424699] bus: 'auxiliary': add device mlx5_core.rdma.2
[ 3623.424714] PM: Adding info for auxiliary:mlx5_core.rdma.2
[ 3623.424737] bus: 'auxiliary': __driver_probe_device: matched device mlx5_core.rdma.2 with driver mlx5_ib.rdma
[ 3623.424743] bus: 'auxiliary': really_probe: probing driver mlx5_ib.rdma with device mlx5_core.rdma.2
[ 3623.424751] mlx5_ib.rdma mlx5_core.rdma.2: no default pinctrl state
[ 3623.428885] device: 'mlx5_2': device_add
[ 3623.428938] PM: Adding info for No Bus:mlx5_2
[ 3623.437372] device: 'uverbs2': device_add
[ 3623.437402] PM: Adding info for No Bus:uverbs2
[ 3623.437733] device: 'umad2': device_add
[ 3623.437759] PM: Adding info for No Bus:umad2
[ 3623.437806] device: 'issm2': device_add
[ 3623.437829] PM: Adding info for No Bus:issm2
[ 3623.439516] driver: 'mlx5_ib.rdma': driver_bound: bound to device 'mlx5_core.rdma.2'
[ 3623.439543] bus: 'auxiliary': really_probe: bound device mlx5_core.rdma.2 to driver mlx5_ib.rdma
[ 3623.439562] mlx5_core 0000:45:00.0: esw_compat_write:353:(pid 7722): mlx5_core: Failed setting eswitch to offloads
ENV:
$ uname -r
6.1.67
# OFED VERSION
MLNX_OFED_SRC-23.10-1.1.9.0
# compiler version
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-11/root/usr --mandir=/opt/rh/devtoolset-11/root/usr/share/man --infodir=/opt/rh/devtoolset-11/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-11.2.1-20220127/obj-x86_64-redhat-linux/isl-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20220127 (Red Hat 11.2.1-9) (GCC)
ethtool info
# ethtool -i eth20
driver: mlx5_core
version: 23.10-1.1.9
firmware-version: 22.31.2912 (ALI0000000017)
expansion-rom-version:
bus-info: 0000:45:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes
# ethtool -i eth21
driver: mlx5_core
version: 23.10-1.1.9
firmware-version: 22.31.2912 (ALI0000000017)
expansion-rom-version:
bus-info: 0000:45:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes
Setup before trying to set switchdev:
# 1. set steering_mode to dmfs
# cat /sys/class/net/eth20/compat/devlink/steering_mode
dmfs
# cat /sys/class/net/eth21/compat/devlink/steering_mode
dmfs
# 2. set VF
# cat /sys/class/net/eth20/device/sriov_numvfs
2
# 3. unbound VF
# ibdev2netdev
...
mlx5_2 port 1 ==> eth20 (Up)
mlx5_3 port 1 ==> eth21 (Up)
# VFs do not show up, but exist.
# lspci | grep "Virtual Function"
45:00.2 Ethernet controller: Mellanox Technologies ConnectX Family mlx5Gen Virtual Function
45:00.3 Ethernet controller: Mellanox Technologies ConnectX Family mlx5Gen Virtual Function