【Trex】Trex初始化配置和server/client的启动

Trex初始化配置和server/client的启动

第二章 Trex初始化配置和server/client的启动



一、Trex初始化配置

可以用lspci命令查看网卡的在位情况。下面的01:00.0/01:00.1/05:00.0/05:00.1分别代表网卡的接口。

[root@localhost v2.95]# lspci
01:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
01:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
03:00.0 PCI bridge: Texas Instruments XIO2001 PCI Express-to-PCI Bridge
04:02.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8169 PCI Gigabit Ethernet Controller (rev 10)
05:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
05:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)

切换到trex解压的目录,开始配置要使用的接口。Trex最少需要两个接口,也就是端口对的概念。如果只有一个可用的口,那可以采用dummy来占位。实际的环境已经升级到最新的v2.95,后续就用这个版本来举例。

[root@Trex85 v2.97]# ./dpdk_setup_ports.py -t
+----+------+---------+-------------------+-----------------------------------------------+---------+----------+----------+
| ID | NUMA |   PCI   |        MAC        |                     Name                      | Driver  | Linux IF |  Active  |
+====+======+=========+===================+===============================================+=========+==========+==========+
| 0  | -1   | 00:1f.6 | 30:d0:42:f1:cb:5f | Ethernet Connection (11) I219-LM              | e1000e  | em1      | *Active* |
+----+------+---------+-------------------+-----------------------------------------------+---------+----------+----------+
| 1  | -1   | 04:00.0 | a0:36:9f:89:88:16 | I350 Gigabit Network Connection               | igb     | p1p1     |          |
+----+------+---------+-------------------+-----------------------------------------------+---------+----------+----------+
| 2  | -1   | 04:00.1 | a0:36:9f:89:88:17 | I350 Gigabit Network Connection               | igb     | p1p2     |          |
+----+------+---------+-------------------+-----------------------------------------------+---------+----------+----------+
| 3  | -1   | 06:00.0 | a0:36:9f:89:88:14 | I350 Gigabit Network Connection               | igb     | p7p1     |          |
+----+------+---------+-------------------+-----------------------------------------------+---------+----------+----------+
| 4  | -1   | 06:00.1 | a0:36:9f:89:88:15 | I350 Gigabit Network Connection               | igb     | p7p2     |          |
+----+------+---------+-------------------+-----------------------------------------------+---------+----------+----------+
| 5  | -1   | 0a:00.0 | 08:57:00:ef:62:48 | RTL-8100/8101L/8139 PCI Fast Ethernet Adapter | 8139too | p2p1     |          |
+----+------+---------+-------------------+-----------------------------------------------+---------+----------+----------+

#再用如下命令初始化配置,按照提示输入,最终生成默认的配置文件/etc/trex_cfg.yaml.
[root@localhost v2.95]# ./dpdk_setup_ports.py -i

[root@Trex85 v2.97]# cat /etc/trex_cfg.yaml
### Config file generated by dpdk_setup_ports.py ###

- version: 2
  interfaces: ['01:00.0', '01:00.1']
  port_info:
      - dest_mac: b4:96:91:86:59:9a # MAC OF LOOPBACK TO IT'S DUAL INTERFACE
        src_mac:  b4:96:91:86:59:98
      - dest_mac: b4:96:91:86:59:98 # MAC OF LOOPBACK TO IT'S DUAL INTERFACE
        src_mac:  b4:96:91:86:59:9a

  platform:
      master_thread_id: 0
      latency_thread_id: 1
      dual_if:
        - socket: 0
          threads: [2,3,4,5,6,7,8,9,10,11]

如果要用到IPv6的接口,添加stack: linux_based。仅仅构造IPv6的报文发送是不需要的。

- version: 2
  interfaces: ['01:00.0', '01:00.1', '05:00.0', '05:00.1']
  stack: linux_based
  port_info:

二、启动server和client

1.启动server

参数的具体含义可以用命令查看 : ./t-rex-64 -h
–vlan 是用82599es的芯片网卡要带的,其他的可以不带

[root@Trex85 v2.97]# ./t-rex-64 -i --stl --vlan --ipv6
Starting Scapy server.... Scapy server is started
Trying to bind to vfio-pci ...
Trying to compile and bind to igb_uio ...
ERROR: We don't have precompiled igb_uio.ko module for your kernel version.
Will try compiling automatically...
Success.

/usr/local/python3/bin/python3 dpdk_nic_bind.py --bind=igb_uio 0000:04:00.0 0000:04:00.1 0000:06:00.0 0000:06:00.1
The ports are bound/configured.
Starting  TRex v2.97 please wait  ...
 set driver name net_e1000_igb
 driver capability  : TCP_UDP_OFFLOAD  TSO  SLRO
 set dpdk queues mode to DROP_QUE_FILTER
 Number of ports found: 4
zmq publisher at: tcp://*:4500
 wait 10 sec ..........
port : 0
------------
link         :  link : Link Up - speed 1000 Mbps - full-duplex
promiscuous  : 0
port : 1
------------
link         :  link : Link Up - speed 1000 Mbps - full-duplex
promiscuous  : 0
port : 2
------------
link         :  link : Link Up - speed 100 Mbps - full-duplex
promiscuous  : 0
port : 3
------------
link         :  link : Link Up - speed 100 Mbps - full-duplex
promiscuous  : 0
 number of ports         : 4
 max cores for 2 ports   : 1
 tx queues per port      : 3
 -------------------------------
RX core uses TX queue number 1 on all ports
 core, c-port, c-queue, s-port, s-queue, lat-queue
 ------------------------------------------
 1        0      0       1       0      2
 2        2      0       3       0      2
 -------------------------------

启动后server窗口就保持实时刷新的状态,一直开着就行了。另外在新链接上开启client。

-Per port stats table
      ports |               0 |               1 |               2 |               3
 -----------------------------------------------------------------------------------------
   opackets |               0 |               0 |               0 |               0
     obytes |               0 |               0 |               0 |               0
   ipackets |               0 |               0 |               0 |               0
     ibytes |               0 |               0 |               0 |               0
    ierrors |               0 |               0 |               0 |               0
    oerrors |               0 |               0 |               0 |               0
      Tx Bw |       0.00  bps |       0.00  bps |       0.00  bps |       0.00  bps

-Global stats enabled
 Cpu Utilization : 0.0  %
 Platform_factor : 1.0
 Total-Tx        :       0.00  bps
 Total-Rx        :       0.00  bps
 Total-PPS       :       0.00  pps
 Total-CPS       :       0.00  cps

 Expected-PPS    :       0.00  pps
 Expected-CPS    :       0.00  cps
 Expected-BPS    :       0.00  bps

 Active-flows    :        0  Clients :        0   Socket-util : 0.0000 %
 Open-flows      :        0  Servers :        0   Socket :        0 Socket/Clients :  -nan
 drop-rate       :       0.00  bps
 current time    : 24.3 sec
 test duration   : 0.0 sec

2.启动client

默认是用python3来启动的,也可以通过加参数–python2强制使用Python2来运行client。
遇到任何疑惑都随时加个-h就能获取详细的帮助。

[root@248 v2.95]# ./trex-console

Using 'python3' as Python interpeter


Connecting to RPC server on localhost:4501                   [SUCCESS]


Connecting to publisher server on localhost:4500             [SUCCESS]


Acquiring ports [0, 1, 2, 3]:                                [SUCCESS]


Server Info:

Server version:   v2.95 @ STL
Server mode:      Stateless
Server CPU:       2 x Intel(R) Xeon(R) CPU E3-1245 v3 @ 3.40GHz
Ports count:      4 x 10Gbps @ Ethernet Controller X710 for 10GbE SFP+

-=TRex Console v3.0=-

Type 'help' or '?' for supported actions

trex>

第一个命令就是portattr查看端口的情况

trex>portattr
Port Status

     port       |          0           |          1           |          2           |          3
----------------+----------------------+----------------------+----------------------+---------------------
driver          |       net_i40e       |       net_i40e       |       net_i40e       |       net_i40e
description     |  Ethernet Controlle  |  Ethernet Controlle  |  Ethernet Controlle  |  Ethernet Controlle
link status     |          UP          |          UP          |          UP          |          UP
link speed      |       10 Gb/s        |       10 Gb/s        |       10 Gb/s        |       10 Gb/s
port status     |         IDLE         |         IDLE         |         IDLE         |         IDLE
promiscuous     |         off          |         off          |         off          |         off
multicast       |          on          |          on          |          on          |          on
flow ctrl       |         none         |         none         |         none         |         none
vxlan fs        |          -           |          -           |          -           |          -
--              |                      |                      |                      |
layer mode      |       Ethernet       |       Ethernet       |       Ethernet       |       Ethernet
src IPv4        |          -           |          -           |          -           |          -
IPv6            |         off          |         off          |         off          |         off
src MAC         |  6c:fe:54:25:2f:d0   |  6c:fe:54:25:2f:d1   |  6c:fe:54:25:2f:d2   |  6c:fe:54:25:2f:d3
---             |                      |                      |                      |
Destination     |  6c:fe:54:25:2f:d1   |  6c:fe:54:25:2f:d0   |  6c:fe:54:25:2f:d3   |  6c:fe:54:25:2f:d2
ARP Resolution  |          -           |          -           |          -           |          -
----            |                      |                      |                      |
VLAN            |          -           |          -           |          -           |          -
-----           |                      |                      |                      |
PCI Address     |     0000:01:00.0     |     0000:01:00.1     |     0000:01:00.2     |     0000:01:00.3
NUMA Node       |          0           |          0           |          0           |          0
RX Filter Mode  |    hardware match    |    hardware match    |    hardware match    |    hardware match
RX Queueing     |         off          |         off          |         off          |         off
Grat ARP        |         off          |         off          |         off          |         off

总结

接下来就是随意探索的时间段了。

TREX说明书: 命令名称: Z1 简便找盘 XINXI 查看硬盘信息 chkresfall检测固件 smt 查看SMART表 csmt 清SMART表 svmod 0x.. 单个备份模块 wrmod 0x.. 写入备份好的单个模块 pg 合并GP pgn 立即合并pg CGLIST 清G CFILE 0X33 清P Depophd 1,X关头 DM 内部低格 rdfl 2;edit 编辑ID wrdir 写01扇区 GSGJQ 格式化固件区 QLGJQ固件区清零 clribilog 清E0-E6 F0-F1的LOG HEADTEST 自动测试当前所有磁头好坏,好的返回OK,坏的返回BAD。 getPEDATA 自动获取PE bin 读E8 E9 E10 tp 校准指针 sf1 从0x01自动开自校准(范围S53. S58) 处理完后,出现COMPLETELY(完成)此时需要手工断电通电一次,校准即开启。校准时候用 POLL 0 命令实时查看进程。 sf2 从0x0e自动开自校准(若sf失败,则用这个跑(范围S53. S58)) 处理完后,出现COMPLETELY(完成)此时需要手工断电通电一次, 校准即开启。校准时候用POLL 0命令实时查看进程。 stop 强制停校准(盘在IDE 1,不是IDE0) rdTRK 自动备份全固件磁道 (范围S53. S58) wrTRKa 自动写全固件磁道 (范围S53. S58) swap58 自动全换SABRE58系列固件(范围S53. S58) swap53 自动全换SABRE53系列固件(范围S53. S58) wr58 自动全写S58系列固件(范围S53. S58) wr53 自动全写S53系列固件(范围S53. S58) sv58 自动全备份S58系列固件(范围S53. S58) sv53 自动全备份S53系列固件(范围S53. S58) wrdir 写dir wrrplist 写35模块 re47 自动配47适配器模块(范围S53. S58) re40 自动配40适配器模块(范围S53. S58) SVLROM 保存128K ROM WRROML 写128K ROM CLRCOLOR 修护色块坏道的命令 CLR0 清零 CLRPW 解密 setPWD 加密 disablePWD 禁用密码 unlockUnit SECURITY UNLOCK Macro erasePrep SECURITY ERASE PREPARE Macro eraseUnit SECURITY ERASE UNIT Macro SMARTSTAT SMART归位 smtRdData SMART数据读取 htl L板测磁头 hlr换L板ROM AdpL自适配L板47 KadpL headnum 砍L板所选磁头适配 svtl uhead 保存L板所选磁头磁道 wrtl uhead 写所选磁头磁道 SVALL 存全固件RPM wrall 写全固件RPM svhawk保存HAWK全固件 wrhawk写HAWK全固件 svthawk保存HAWK磁道 wrthawk写HAWK磁道 initall初始化三项 getadpfrom40 从40拷贝MR适配进47 getadpfrom41 从41拷贝MR适配进47 raidergetadpfrom40 raider系列从40拷贝MR适配进47 raidergetadpfrom41 raider系列从41拷贝MR适配进47 svseqfull SEQ保存全固件 wrseqfull SEQ写全固件 SVBUC BUC保存全固件 WRBUC BUC写全固件 SVRAIDER RAIDER保存全固件 WRRAIDER RAIDER写全固件 kill headnum 这几个系列的砍头 adujst40 调整40模块 fmtcover 格式覆盖 SVORION ORION保存全固件 WRORION ORION写全固件 ORIONadp47 ORION配47 ROYL tp32 32位校准指针 ROYSF 自动开ROYL系列校准(从01开始跑,即第一个DC)处理完后,出现COMPLETELY(完成)此时需要手工断电通电一次,校准即开启。 校准时候用POLL 0命令实时查看进程。 STOPROY 强制停ROY校准 ROYHEADTEST ROY测试磁头 ROYRE47 ROY配ROM ROYMAKEROM ROY配ROM BAKpermovl 备份11号ATA模块 新命令: SF、SFP校准 LDR自动加载11 tpseq 设置校准起始指针 Get_adp_info 获取适配信息 Get_adp_new_info 获取适配信息(新) displayheadmap、hdmap 显示磁头映射 AAJSre40 AAJS盘从47拷贝MR到40 AAJSre47 AAJS盘从40拷贝MR到47 adjust_40(微代码,调用时加.)适配40 adjust_47(微代码,调用时加.)适配47 Adpzeus自适配ZEUS系列47 AdpR R系自适配47 K47 umaxhead UHEAD 砍头且设置47 kadpzeus headnum砍ZEUS所选磁头适配 cutmap uhead 关要砍的头的映射 SETPARM uhead设置所需磁头数的TPICAP getflash读取ROY备份ROM SA并保存 peirom配ROM svall 存全固件RPM,并存ROM.BIN, 11 PERMOVL.BIN, 35 RPLIST.BIN SVFW 保存全固件 SVBASE 存33 40 41 SVROM 保存192K ROM SV2ROM 保存256K ROM SVROMMOD 保存A 47 SVT UHEAD 保存所选磁头磁道 SVMOD OverlayNum 保存单个模块 WRBASE 写33 40 41 WRROMMOD 写A 47 WRROM 写192K ROM WR2ROM 写256K ROM WRALL 全写固件RPM RWRFW 自读自写全固件RPM wrFW 全写固件RPM WRT UHEAD 写入所选磁头磁道 WRTL UHEAD 写入所选磁头磁道 WrMOD BinFileNum 写入单个模块 SETHQ ULCAP设置HQ自定义CAP SETTAG ULCAP设置TAG自定义CAP scap显示CAP STPI显示TPI dpst、dpst1显示流程 EMDL编辑磁盘型号 HT测试头 HDT UHEAD测试所选头 SETLBA ULBA设置自定义LBA setdcm udcm设置自定义DCM setTPI为全部磁头设置TPI setCap为全部磁头设置CAP ST0 UTPI为0头设置TPI ST1 UTPI为1头设置TPI ST2 UTPI为2头设置TPI ST3 UTPI为3头设置TPI ST4 UTPI为4头设置TPI ST5 UTPI为5头设置TPI ST6 UTPI为6头设置TPI ST7 UTPI为7头设置TPI SC0 UCAP为0头设置CAP SC1 UCAP为1头设置CAP SC2 UCAP为2头设置CAP SC3 UCAP为3头设置CAP SC4 UCAP为4头设置CAP SC5 UCAP为5头设置CAP SC6 UCAP为6头设置CAP SC7 UCAP为7头设置CAP RADP读103并重新适配47 REPAIR重建DIR SFLOG查校准LOG CM对比47103 ClrRES prmFileID、ClrR prmFileID、Clrbinfile binfile清空所选模块 CLEARFILE UFILEID清空所选ID模块 CLRPSTLOG清除SPTLOG CLRLIST清除所有缺陷表 kadp3 headnum、kadp2 headnum、kNEW2ROM headnum、knew3 headnum砍所选磁头适配 k0 headnum、k1 headnum、k3 headnum砍头 vp1、vp显示P表 VG显示G表 c4改28走C4 FmtR格式化固件区 cf清空缺陷 sz显示ZONE kz uznum ulba砍所选段位LBA SHOWZONE显示ZONE kZONE uzone砍所选段位 hr换ROM gb搞0B模块 h40换40 固件区 允许输入拉丁字符的拼音 Firmware District 常用指令 1、 关头 Depophd 1,X 2、 配47 Re47 3、 格式化 Fmtunit 4、 启动自校 Sf 5、 备份固件 Sv53,sv58 6、 写全部固件 Wr53,wr58 7、 自动更换替换固件 Swap53,swap58 8、 写01扇区 wrdir 9、 格式化固件区 fmtrsvd 10、 固件区清零 zrcyls 11、 清LOG clribilog sv109t wr109t wr083j sv083j sv218b wr218b adp0 adp1
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值