tar xvfz ixgbe-5.13.4.tar.gz
wireshark@dell:~/ixgbe-5.13.4/src$ make
Sudo make install
wireshark@dell:~/ixgbe-5.13.4/src$ sudo modinfo /home/wireshark/ixgbe-5.13.4/src/ixgbe.ko
#放开sfp限制
sudo modprobe ixgbe allow_unsupported_sfp=1
#ubuntu
sudo apt install dpdk
wireshark@dell:/opt/trex/v2.61$ sudo find / -name dpdk-devbind.py
/usr/bin/dpdk-devbind.py
wireshark@dell:/opt/trex/v2.61$ sudo /usr/bin/dpdk-devbind.py -b ixgbe 01:00.0
wireshark@dell:/opt/trex/v2.61$ sudo /usr/bin/dpdk-devbind.py -b ixgbe 01:00.1
#CentOS 7.9
yum install dpdk
sudo modprobe ixgbe allow_unsupported_sfp=1
#三种常用intel网卡的绑定
[root@localhost v2.92]# ./dpdk_nic_bind.py -b igb 08:00.0
[root@localhost v2.92]# ./dpdk_nic_bind.py -b igb 08:00.1
[root@localhost v2.87]# ./dpdk_nic_bind.py -b ixgbe 06:00.0
[root@localhost v2.87]# ./dpdk_nic_bind.py -b ixgbe 06:00.1
[root@localhost v2.97]# ./dpdk_nic_bind.py -b i40e 03:00.0
[root@localhost v2.97]# ./dpdk_nic_bind.py -b i40e 03:00.1
#清除网卡绑定
sudo ./dpdk_setup_ports.py -l
Trying to bind to igb_uio ...
/usr/bin/python dpdk_nic_bind.py --bind=igb_uio 0000:01:00.0 0000:01:00.1
shutdown
lspci
reboot
[root@localhost v2.95]# ethtool -i em1
driver: e1000e
version: 3.2.6-k
firmware-version: 0.13-4
expansion-rom-version:
bus-info: 0000:00:19.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no
shutdown
lspci
reboot
>>> os.chdir("/home/test/v2.87/automation/trex_control_plane/interactive/trex/examples/stl")
>>> import stl_path
>>> from trex.stl.api import *
>>> from trex_stl_lib.api import *
>>> c = STLClient(server = '127.0.0.1')
>>> c.connect()
>>> ver = c.get_server_version()
>>> print(ver)
{u'build_date': u'Dec 30 2020', u'version': u'v2.87', u'built_by': u'hhaim', u'mode': u'STL', u'build_time': u'12:31:52'}
>>> c.acquire(ports = [0,1])
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/root/v2.87/automation/trex_control_plane/interactive/trex/common/trex_api_annotators.py", line 51, in wrap2
ret = f(*args, **kwargs)
File "/root/v2.87/automation/trex_control_plane/interactive/trex/stl/trex_stl_client.py", line 393, in acquire
raise TRexError(rc)
TRexError: Port 0 : *** port is already owned by another session of 'root'
Port 1 : *** port is already owned by another session of 'root'
>>> c.disconnect()
每次重启都要重新编译ko文件
找到编译完成的文件,拷贝一份到相应的目录下
安装Trex GUI
下载trex-stateless-gui-v4.5.6.tgz到新建的目录gui并解压
tar -xvzf trex-stateless-gui-v4.5.6.tgz