总结smartNIC的相关知识,虽然没啥用(因为很多东西都是基于netdev interface,而实验上好像是虚拟端口,所以不是一个东西),但是为了以后可能会用,还是记一下。
Agilio smartNIC user guide
文档地址https://help.netronome.com/support/solutions/articles/36000049975-basic-firmware-user-guide
hardware installation
validation
1 | lspci -d 19ee: |
driver and firmware
validating the driver
支持nfp driver的操作系统
operating system | kernel version |
---|---|
Ubuntu 16.04 | 4.11+(PF) |
RHEL 7.4+ | Default |
CentOS 7.4+ | Default |
confirm upstreamed nfp driver
Confirm that your current Operating System contains the upstreamed nfp module
1 | modinfo nfp | head -3 |
confirm thath nfp driver is loaded
1 | lsmode | grep nfp |
smartNIC netdev interfaces
1 | install agilio-nameing-policy package |
validating the firmware
固件的版本和smartNIC能实现的功能有关,固件应该在/lib/firmware/netronome/
固件版本可以通过
1 | ethtool -i "netdev interface" |
upgrading the firmware
upgrading firmware via the netronome repo
通过附录一的配置之后,就可以这样安装
1 | apt-get install agilio-nic-firmware |
upgrading firmware from package installation
从support上下载之后
1 | dpkg -i agilio-nic-firmware-*.deb |
using the linux driver
configuring interface media mode
对于老的内核不支持这样配置的,见附录C
configuring interface link-speed
下面是agilio CX 25G smartNIC的示例
1 | # down respective interface(s) |
setting interface breakout mode
下面的命令只适用于kernel版本4.13之后,为Agilio CX 40G/2x40G SmartNICs的示例
1 | # determine card’s pci address |
confirm connectivity
allocating IP addresses
1 | # assign IP address to interface |
pinging interfaces
1 | # ping IP from host on same subnet |
basic performance test
除了IRQ和RSS的配置之外,就是iperf和iperf3的一些基本用法
set IRQ affinity
IRQ用来平衡核之间的负载
1 | wget https://raw.githubusercontent.com/Netronome/nfp-drv-kmods/master/tools/set_irq_affinity.sh |
样例输出
1 | /nfp-drv-kmods/tools/set_irq_affinity.sh enXXXXnpX |
install iperf
1 | apt-get install -y iperf |
using iperf
1 | # server |
using iperf3
1 | # Server: |
basic firmware features
这节主要介绍用ethtool查看和配置一些smartNIC的接口参数。
multiple queues
smartNIC支持多个TX和RX队列。-I
可以看到当前的队列,-L
可以配置当前的队列。
1 | ethtool -l ens1np0 |
receive side scaling(RSS)
-n
查看,-N
修改,-x
和-X
修改和配置key
1 | ethtool -n ens1np0 rx-flow-hash tcp4 |
view interface parameters
-k
1 | ethtool -k ens1np0 |
一些选项开关列举如下
1 | # rx-checksumming |
install configuring and using dpdk
此处就略过了。
附录内容
- A:netronome repositories,装上面提到的一些应用
- B:安装out-of-tree NFP Driver
- C:使用BSP package(上面提到了kernel较老的时候如何configure interface)
- D:使用dpdk-ns
- E:updating flash
- F:升级kernel
- G:set_irq_affinity.sh Source(前面irq的替代脚本)
key schedule
https://github.com/goodnighthy/KeySched/tree/master/key_schedule
starting and stopping using upstart(ubuntu 14.04 and centos 6)
The RTE (NORMAL MODE) can be started/stopped by calling: start/stop nfp-sdk6-rte
The RTE(DEBUG MODE) can be started/stopped by calling: start/stop nfp-sdk6-rte-debug
The RTE(SIM MODE) can be started by calling: start/stop nfp-sdk6-rte-sim Before using this Upstart configuration set NETRODIR to the SDK6 simulator installation directory in the installed file nfp-sdk6-rte-sim.conf
The Hardware Debug Server can be started by calling: start/stop nfp-hwdbg-srv
To start the job at system ready uncomment the startup line in nfp-sdk6-rte.conf, nfp-sdk6-rte-debug.conf or nfp-hwdbg-srv.conf in /etc/init/.
To check whether the RTE job started correctly and is still running
use: status nfp-sdk6-rte (add -debug for DEBUG MODE or -sim for SIM
MODE) if the status show stop/waiting the RTE has stopped and an error
probably occurred. Look at either the Upstart job log in
/var/log/upstart/nfp-sdk6-rte.log (replace nfp-sdk6-rte with the job
name you started) or look in /var/log/nfp-sdk-rte.log for RTE only logs.
To have a continuous live log open either log with tail -f
starting and stopping using systemd(ubuntu 16.04 and centos/rhel 7)
The RTE (NORMAL MODE) can be started/stopped by calling: systemctl start/stop nfp-sdk6-rte
The RTE(DEBUG MODE) can be started/stopped by calling: systemctl start/stop pnfp-sdk6-rte-debug
The RTE(SIM MODE) can be started/stopped by calling: systemctl start/stop nfp-sdk6-rte-sim Before using this Upstart configuration set NETRODIR to the SDK6 simulator installation directory in the file /usr/lib/systemd/system/nfp-sdk6-rte-sim.service
The Hardware Debug Server can be started/stopped by calling: systemctl start/stop nfp-hwdbg-srv
To start the programs at system startup run the systemctl enable command for the specified service: systemctl enable nfp-sdk6-rte.service
To check whether the RTE service started correctly and is still running use: systemctl status nfp-sdk6-rte (add -debug for DEBUG MODE or -sim for SIM MODE) if the Active status show inactive (dead) the RTE has stopped and an error probably occurred. Look at either the Systemd journal or in the RTE logs for more detail on what error occurred.
For looking in the Systemd journal use the following command: journalctl -u nfp-sdk6-rte replace nfp-sdk6-rte with the service name you are using (ex nfp-sdk6-rte-debug or nfp-sdk6-rte-sim). Add the -f argument to follow the journal for a live log.
For only logs generated by the RTE look /var/log/nfp-sdk-rte.log, for continuous live log open the log with tail -f /var/log/nfp-sdk-rte.log