Table of Contents
Introduction
BlueField's Ethernet BlueField2 SmartNIC solutions combine Arm® processing power with advanced network offloads to accelerate a multitude of security, networking and storage applications.
Based on the BlueField BlueField2 system-on-chip (SoC) programmable network engine, BlueField BlueField2 SmartNICs integrate Mellanox ConnectX®-5 6 Dx network controller with Arm multicore processors and cryptology options to deliver an innovative and high-performance programmable platform. Through this article, you will be able to quickly set up a simple test lab which will allow you to experiment and explore BlueField BlueField2 SmartNIC capabilities. The setup includes a bare metal server hosting BlueField BlueField2 25GbE SmartNIC connected back-to-back to another bare metal server with ConnectX-5 6 Dx NIC.
License
N/A
How to use this document
this document is used to guide how to install the OVS-DPDK into SmartNIC and integrate it with the server
Deployment Architecture
The following diagram shows the physical configuration between the BlueField BlueField2 SmartNIC and the ConnectX-5 6 Dx NIC.
...
Pre-Installation Requirements
...
Minimum Hardware Requirements
Qty.
Item
Comments
2 | x86 servers running CentOS |
8. |
2 | Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz/ 40 cores / 2 numa / 320G memory Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz/ 40 cores/ 2 numa / 320G memory | |
1 | ConnectX-6 Dx NIC (FW: 22.29.1016) | - |
1 | BlueField2 25GbE SmartNIC with Arm processor (FW: 24.29.1016) | ARM A72 8 cores / single numa / 16G memory/ 25G bandwidth |
1 | 25GB/s SFP28 networking cable | - |
1 | QSA28 Adapter |
Module | - | |
1 | UART-to-USB cable | For SmartNIC USB console access |
1 | Mini USB Type B cable | For SmartNIC USB Console Access |
1 | bfb image to be loaded on the |
BlueField2 SmartNIC Arm. | Image contains:
|
|
|
|
|
|
|
- Insert ConnectX-5 6 Dx NIC into Server A
- Insert BlueField BlueField2 SmartNIC into Server B
- Connect the SmartNIC UART cable from SmartNIC to its hosting Server B USB port #1
- Connect Mini USB cable from SmartNIC to its hosting Server B USB port #2
- Insert QSA28 Adapter Module into Server B 100GBB 25GB port
- Connect one of the SmartNIC ports to the ConnectX-5 6 Dx using 25GB cable
- Connect both servers to a management LAN
...
- Use automatic FM update during MLNX_OFED installation ONLY if the current BlueField BlueField2 FW version is 1824.24.1000 (GA) or 29.1016 or above. In case its older, manually burn the FW after MLNX_OFED installation.
- In case you plan to run DPDK on the host itself, install MLNX_OFED with "--dpdk --upstream-libs" flags
- The "BlueField" flag is not required in some of the MLNX_OFED versions and OS releases
OVS-DPDK
- In R3, We've open-sourced a fork of DPDK based Open vSwitch, which supports the VXLAN decap/encap full offload: https://github.com/bytedance/ovs-dpdk, and In R4, we used the Mellanox version which is in the process of open source
- The code is fully compatible with upstream Open vSwitch, you can follow the same procedures to build them from the source. See the link: http://docs.openvswitch.org/en/latest/intro/install/
- Or you can use the ansible scripts in the Akaino Gerrit to install both BlueField BlueField2 Card and OVS-DPDK. Currently, the scripts are not available, as the scripts work by relying on many company's internal services. We are refactoring the code that you can use it in your own SmartNIC setups.
...
|
Note
- Use an automatic FM update during MLNX_OFED installation ONLY if the current BlueField BlueField2 FW version is 18is 24.24.1000 (GA) 29.1016 or above. In case its older, manually burn the FW after MLNX_OFED installation.
- In case you plan to run DPDK on the host itself, install MLNX_OFED with "--dpdk --upstream-libs" flags
- The "BlueField" flag is not required in some of the MLNX_OFED versions and OS releases
- Enable SR-IOV on FW (Optional):
|
- Uncomment the following line in /etc/modprobe.d/rshim.conf to set the default RShim access method to the SmartNIC:
...
options rshim backend_driver=rshim_usb
- Download and install RShim driver to communicate with BlueField2 SmartNIC, including packages required.
rpm -Uvh rshim-<version-number>.x86_64.rpm -force |
Note: Before start the driver, guarantee that old version of kernel modules are unloaded if there has.
rmmod rshim_net systemctl start rshim |
Note
- When this line is commented, the first available driver will be used.
- When the mini USB cable is not used, the driver should be rshim_pcie
- Create a file named ifcfg-tmfifo_net0 under /etc/sysconfig/network-scripts/ directory, with the following content:
...
- ifcfg-tmfifo_net0 is the network interface used for IP communication between the x86 host and the SmartNIC with rshim _net driver.
- Enable ip forwarding and set a NAT rule to allow the SmartNIC OS to communicate with the outer world via the host management interface:
...
sysctl -w net.ipv4.ip_forward=1
systemctl enable iptables
systemctl start iptables
iptables -F
iptables -t nat -A POSTROUTING -o <host_mgmt_interfac> -j MASQUERADE
service iptables save
- The oob_net0 interface on BlueField2 ARM can be used for management interface and a connection to outside. The configuration for it can be as below:
NAME="oob_net0" |
- Disable Disable Firewall and Network Manager services
...
- Reboot the server. Once the server is up again, run some configuration sanity tests:
- To verify BlueField BlueField2 FW version:
|
- To verify RShim modules are loadeddriver is working:
|
- To identify the backend active RShim driver:
...
|
- Download the BlueField BlueField2 Quick Start bfb image: httpshttp://www.mellanox.box.com/s/q44f501xq1e29yb1bjpsb9vzgqs89a76
- Place the bfb image on the host and load it on the BlueField SmartNIC using the following command:
...
cat /home/CentOS7.5ALT-aarch64-QuickStart.bfb > /dev/rshim0/boot
Use one of the console access methods described in the "SmartNIC Management Methods" section below to follow the image installation process.
When bfb image installation process is completed, connect to the SmartNIC with the console or SSH, as described below, and test connectivity from the SmarNIC OS to the outer world.
- SmartNIC Management Methods
To manage the SmartNIC from the hosting server, use one of the following methods
Access Credentials: root\centos
...
- downloads/BlueField/BlueField-3.5.0.11563/BlueField-3.5.0.11563_install.bfb
- Place the bfb image on the host and load it on the BlueField2 SmartNIC using the following command:
|
Note: CentOS based bfb is not officially supported.
Use one of the console access methods described in the "SmartNIC Management Methods" section below to follow the image installation process.
When bfb image installation process is completed, connect to the SmartNIC with the console or SSH, as described below, and test connectivity from the SmarNIC OS to the outer world.
- SmartNIC Management Methods
To manage the SmartNIC from the hosting server, use one of the following methods
Access Credentials: root\centos
Console over USB-Serial / Serial Port properties: Rate 115200, HW Flow Control OFF.
|
Console over USB (rshim_usb) / Serial Port properties: Rate 115200, HW Flow Control OFF
minicom -D /dev/rshim0/console |
SSH (rshim_net)
|
Note: SmartNIC OS is configured to obtain internet access via its hosting server.
Basic SmartNIC Management Operations
How-to soft reset the SmartNIC via host server:
Issue the following command on the server:
|
Follow the boot process using console access:
|
Console over USB (rshim_usb) / Serial Port properties: Rate 115200, HW Flow Control OFF
Note: This is not a power cycle of the SmartNIC.
How-to load BlueField2 SmartNIC OS image from the hosting server:
Place bfb image on the server
Issue the following command on the server:
|
|
Follow the installation and boot process using the console
...
SSH (rshim_net)
...
ssh root@192.168.100.2
Note
SmartNIC OS is configured to obtain internet access via its hosting server.
Basic SmartNIC Management Operations
How-to soft reset the SmartNIC via host server:
Issue the following command on the server:
...
echo "SW_RESET 1" > /dev/rshim0/misc
access:
|
SmartNIC Modes
BlueField2 SmartNIC can operate in two modes:
SEPERATED_HOST (default mode)
In this mode, both the x86 hosting server and the SmartNIC Arm OS act as separated entities; Both can use and communicate with each other or the network via the ConnectX-6 Dx module of the SmartNIC.
EMBEDDED
In this mode, the x86 hosting server communicates with the outer world only through the SmartNIC Arm.
Note
In order to identify the SmartNIC current mode, issue the following commands on the x86 hosting server:
|
Switching to EMBEDDED Mode from SEPERATED_HOST Mode
On the x86 host:
Enable EMBEDDED mode:
|
Reboot.
Verify:
|
On the Arm:
Issue the following commands to enable ECPF parameters (applied per port):
Note: The ECPF parameters will be available for setting only after completing the previous steps.
|
Follow the boot process using console access:
...
minicom -D /dev/ttyUSB0
Note
This is not a power cycle of the SmartNIC.
How-to load BlueField SmartNIC OS image from the hosting server:
Place bfb image on the server
Issue the following command on the server:
...
cat <image>.bfb > /dev/rshim0/boot
Follow the installation and boot process using the console access:
...
minicom -D /dev/ttyUSB0
SmartNIC Modes
BlueField SmartNIC can operate in two modes:
SEPERATED_HOST (default mode)
In this mode, both the x86 hosting server and the SmartNIC Arm OS act as separated entities; Both can use and communicate with each other or the network via the ConnectX-5 module of the SmartNIC.
EMBEDDED
In this mode, the x86 hosting server communicates with the outer world only through the SmartNIC Arm.
Note
In order to identify the SmartNIC current mode, issue the following commands on the x86 hosting server:
|
Switching to EMBEDDED Mode from SEPERATED_HOST Mode
On the x86 host:
Enable EMBEDDED mode:
...
x86_host #mst start
x86_host #mlxconfig -d /dev/mst/mt41682_pciconf0 s INTERNAL_CPU_MODEL=1
Reboot.
Verify:
...
x86_host#mst start
x86_host#mlxconfig -d /dev/mst/mt41682_pciconf0 q | grep -i model
On the Arm:
Issue the following commands to enable ECPF parameters (applied per port):
Note
The ECPF parameters will be available for setting only after completing the previous steps.
...
Snic#mst start
Snic#mst status -v
Snic#mlxconfig -d /dev/mst/mt41682_pciconf0 s ECPF_ESWITCH_MANAGER=1 ECPF_PAGE_SUPPLIER=1
Snic#mlxconfig -d /dev/mst/mt41682_pciconf0.1 s ECPF_ESWITCH_MANAGER=1 ECPF_PAGE_SUPPLIER=1
|
Reboot the x86 host.
Verify configuration:
Once the procedure is completed, issue the following command on both the x86 host and the Arm:
|
On x86 host: the output should list two network devices.
|
On Arm: following devices should be listed:
|
Reboot the x86 host.
Verify configuration:
Once the procedure is completed, issue the following command on both the x86 host and the Arm:
...
/opt/mellanox/iproute2/sbin/rdma link
On x86 host: the output should list two network devices.
|
On Arm: the output should list four representors:
...
1/1: mlx5_0/1: state ACTIVE physical_state LINK_UP netdev rep0-ffff
2/1: mlx5_1/1: state ACTIVE physical_state LINK_UP netdev rep0-0
3/1: mlx5_2/1: state DOWN physical_state DISABLED netdev rep1-ffff
4/1: mlx5_3/1: state DOWN physical_state DISABLED netdev rep1-0
Issue the following commands on the Arm to see the correlation between the PCI device and its representors:
...
mst start
mst status -v
PCI devices:
------------
DEVICE_TYPE MST PCI RDMA NET NUMA
BlueField(rev:0) NA 03:00.1 mlx5_3,mlx5_2 net-eth2,net-rep1-ffff -1
BlueField(rev:0) NA 03:00.0 mlx5_1,mlx5_0 net-rep0-ffff,net-eth1 -1
|
Issue the following commands on the Arm to see the correlation between the PCI device and its representors:
|
Note: The pf0hpf / pf1hpf are the PF representors facing the x86 host.
Switching to SEPERATED_HOST Mode from EMBEDDED Mode
On the x86 host:
Enable SEPERATED_HOST mode:
|
Reboot.
Verify:
|
Testing Traffic in EMBEDDED Mode
In Embedded mode, traffic from the x86 server hosting the SmartNIC to the remote x86 server hosting the ConnectX-6 Dx is going via the SmartNIC Arm.
Follow the configuration steps below to test it.
On the Arm
Stop OVS:
|
Verify hugetlbfs is mounted:
|
if not, mount it:
|
Set Hugepages:
|
Verify hugepages were allocated (look for HugePages_Total and Free):
|
Identify the SmartNIC PCI device ID:
|
Configure OVS-DPDK:
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem=4096 ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-extra="-w 03:00.0,representor=[0,65535]" ovs-vsctl add-br dpdkbr0 -- set bridge dpdkbr0 datapath_type=netdev -- set bridge dpdkbr0 fail-mode=standalone ovs-vsctl add-port dpdkbr0 p0 -- set Interface p0 type=dpdk options:dpdk-devargs=0000:03:00.0 ovs-vsctl add-port dpdkbr0 pf0hpf -- set Interface pf0hpf type=dpdk options:dpdk-devargs="0000: |
Note
The rep0-0 / rep1-0 are the representors facing the x86 host and the rep0-ffff / rep1-ffff are the representors facing the network.
Switching to SEPERATED_HOST Mode from EMBEDDED Mode
On the x86 host:
Enable SEPERATED_HOST mode:
...
x86_host #mst start
x86_host #mlxconfig -d /dev/mst/mt41682_pciconf0 s INTERNAL_CPU_MODEL=0
Reboot.
Verify:
...
x86_host#mst start
x86_host#mlxconfig -d /dev/mst/mt41682_pciconf0 q | grep -i model
Testing Traffic in EMBEDDED Mode using DPDK
In Embedded mode, traffic from the x86 server hosting the SmartNIC to the remote x86 server hosting the ConnectX-5 is going via the SmartNIC Arm.
DPDK application is used to forward the traffic and bypass Arm OS kernel. Follow the configuration steps below to test it.
On the Arm
Stop OVS:
...
systemctl stop openvswitch
Verify hugetlbfs is mounted:
...
mount | grep -i hugetlbfs
if not, mount it:
...
mount -t hugetlbfs nodev /dev/hugepages
Set Hugepages:
...
echo 4 > /sys/kernel/mm/hugepages/hugepages-524288kB/nr_hugepages
Verify hugepages were allocated (look for HugePages_Total and Free):
...
cat /proc/meminfo | grep -i huge
Identify the SmartNIC PCI device ID:
...
lspci | grep -i mellanox
Start testPMD application while probing the representors (pci device is 03:00.0):
cd /usr/bin/
./testpmd -w
03:00.0,representor=[ |
65535] |
" systemctl restart openvswitch |
testpmd> start
Set IPs on both x86 host and ConnectX-5 6 Dx host and test connectivity with ping (it will be forwarded by the Arm DPDK)
On the ConnectX-5 6 Dx external host start iperf server:
...
On the x86 host, start iperf client:
|
While the test is running, you can check traffic statistics on Arm testPMD:
...
testpmd> show port stats all
Bare Metal Deployment Guide
...
- Check that the latest driver is loaded
- Check that both the SmartNIC and its link are set to the same speed and duplex settings
Maintenance
Blue Print BluePrint Package Maintenance
Software maintenance
...