VPP/QuickTrexSetup

From fd.io
< VPP
Revision as of 22:36, 7 December 2016 by Dbarach (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Quick trex setup

  • Ensure that the host can build vpp
  • Clone trex source from gerrit.fd.io:
git clone https://gerrit.fd.io/r/trex
  • Build trex; artifacts in .../scripts
cd linux_dpdk
./b configure  (only once)
./b build
  • Make sure that the igb_uio module is installed
# cd .../scripts  

# insmod ko/src/igb_uio.ko
  • Use scripts/dpdk_nic_bind.py to bind interfaces to the igb_uio driver
  • Create /etc/trex_cfg.yaml, edit the interface list / number of queues to match interfaces bound in the previous step
- version       : 2 # version 2 of the configuration file 
  interfaces    : ["01:00.0","01:00.1"]  
  port_limit      : 2 # number of ports to use valid is 2,4,6,8,10,12 
  • Run the trex server
./t-rex-64 -i
  • Run the trex console
./trex-console

Configure ports

  • Set up ip4 source and dest addresses e.g. on two ports
trex>portattr -p 0 --ipv4 16.0.0.1
Applying attributes on port(s) [0]:                          [SUCCESS]

trex>portattr -p 1 --ipv4 48.0.0.1
Applying attributes on port(s) [1]:                          [SUCCESS]

trex>portattr -p 1 --dest 48.0.0.2
Applying attributes on port(s) [1]:                          [SUCCESS]
Resolving destination on port(s) [1]:                        [SUCCESS]
Port 1 - Recieved ARP reply from: 48.0.0.2, hw: 90:e2:ba:5a:9e:1d

trex>portattr -p 0 --dest 16.0.0.2
Applying attributes on port(s) [0]:                          [SUCCESS]
Resolving destination on port(s) [0]:                        [SUCCESS]
Port 0 - Recieved ARP reply from: 16.0.0.2, hw: 90:e2:ba:5a:9e:1c

Run traffic

start -f stl/udp_1pkt_simple.py -m 4mpps

To watch port stats, use the "tui" command. Tui needs a large xterm. It will complain if the xterm isn't large enough.

trex> tui

Global Statistics

connection   : localhost, Port 4501                  total_tx_L2  : 4.62 Gb/sec                    
version      : v2.11                                 total_tx_L1  : 6.06 Gb/sec                    
cpu_util.    : 28.5% @ 1 cores (1 per port)          total_rx     : 4.62 Gb/sec                    
rx_cpu_util. : 0.0%                                  total_pps    : 9.02 Mpkt/sec                  
async_util.  : 0.1% / 1.91 KB/sec                    drop_rate    : 0.00 b/sec                     
                                                     queue_full   : 0 pkts                         

Port Statistics

   port    |         0         |         1         |       total       
----------------------------------------------------------------------
owner      |              root |              root |                   
link       |                UP |                UP |                   
state      |      TRANSMITTING |      TRANSMITTING |                   
speed      |           10 Gb/s |           10 Gb/s |                   
CPU util.  |             28.5% |             28.5% |                   
--         |                   |                   |                   
Tx bps L2  |         2.31 Gbps |         2.31 Gbps |         4.62 Gbps 
Tx bps L1  |         3.03 Gbps |         3.03 Gbps |         6.06 Gbps 
Tx pps     |         4.51 Mpps |         4.51 Mpps |         9.02 Mpps 
Line Util. |           30.32 % |           30.32 % |                   
---        |                   |                   |                   
Rx bps     |          0.00 bps |         4.62 Gbps |         4.62 Gbps 
Rx pps     |          0.00 pps |         9.02 Mpps |         9.02 Mpps 
----       |                   |                   |                   
opackets   |         158312807 |         158312781 |         316625588 
ipackets   |                 1 |         316531433 |         316531434 
obytes     |       10132019648 |       10132017984 |       20264037632 
ibytes     |                64 |       20258012096 |       20258012160 
tx-bytes   |          10.13 GB |          10.13 GB |          20.26 GB 
rx-bytes   |              64 B |          20.26 GB |          20.26 GB 
tx-pkts    |      158.31 Mpkts |      158.31 Mpkts |      316.63 Mpkts 
rx-pkts    |            1 pkts |      316.53 Mpkts |      316.53 Mpkts 
-----      |                   |                   |                   
oerrors    |                 0 |                 0 |                 0 
ierrors    |                 0 |                 0 |                 0