[[trex_setup]] == TRex setup [[ofed_install]] === OFED install Install dependencies for OFED TRex: ---- $ apt install libibverbs1 ---- # https://trex-tgn.cisco.com/trex/doc/trex_manual.html#_mellanox_connectx_4_support # https://trex-tgn.cisco.com/trex/doc/trex_appendix_mellanox.html # https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/ # https://sources.debian.org/src/ofed-docs/1.4.2-1/OFED_Installation_Guide.txt/ #Install OFED (needed for Mellanox cards) EDIT: actually not, simply pass "--no-ofed-check" when running TRex... #---- #$ wget https://www.mellanox.com/downloads/ofed/MLNX_OFED-24.10-1.1.4.0/MLNX_OFED_SRC-debian-24.#10-1.1.4.0.tgz -O /tmp/OFED.tgz # #---- [[trex_install]] === TRex install # https://trex-tgn.cisco.com/trex/doc/trex_manual.html#_download_and_installation # https://github.com/cisco-system-traffic-generator/trex-core/wiki # https://github.com/s5uishida/install_trex # https://github.com/s5uishida/simple_measurement_of_upf_performance_6 Install dependencies: ---- # apt install build-essential zlib1g-dev ---- Download TRex: ---- # cd /opt # git clone https://github.com/cisco-system-traffic-generator/trex-core ---- Install newer scapy GTPU module, required to have GTPPDUSessionContainer available: ---- # cd /tmp # wget https://github.com/secdev/scapy/raw/refs/heads/master/scapy/contrib/gtp.py # cp /tmp/gtp.py /opt/trex-core/scripts/external_libs/scapy-2.4.3/scapy/contrib/gtp.py ---- Build TRex: ---- # cd /opt/trex-core/linux_dpdk /* manual step: Remove -Werror line from gcc_flags in trx-core/linux_dpdk/ws_main.py, due to https://github.com/cisco-system-traffic-generator/trex-core/pull/1087 */ # ./b configure # ./b build ---- Install TRex to /opt/trex: ---- # cp -prL /opt/trex-core/scripts /opt/trex ---- [[trex_config]] === TRex configuration Show network devices: ---- # cd /opt/trex/ # ./dpdk_setup_ports.py -s Network devices using DPDK-compatible driver ============================================ 0000:02:00.0 'MT28800 Family [ConnectX-5 Ex]' drv=mlx5_core unused=igb_uio,vfio-pci,uio_pci_generic 0000:02:00.1 'MT28800 Family [ConnectX-5 Ex]' drv=mlx5_core unused=igb_uio,vfio-pci,uio_pci_generic Network devices using kernel driver =================================== 0000:02:00.0 'MT28800 Family [ConnectX-5 Ex]' if=enp2s0f0np0 drv=mlx5_core unused=igb_uio,vfio-pci,uio_pci_generic 0000:02:00.1 'MT28800 Family [ConnectX-5 Ex]' if=enp2s0f1np1 drv=mlx5_core unused=igb_uio,vfio-pci,uio_pci_generic 0000:05:00.0 'I350 Gigabit Network Connection' if=eno1 drv=igb unused=igb_uio,vfio-pci,uio_pci_generic *Active* 0000:05:00.1 'I350 Gigabit Network Connection' if=eno2 drv=igb unused=igb_uio,vfio-pci,uio_pci_generic Other network devices ===================== ---- ---- # ./dpdk_setup_ports.py -t +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ | ID | NUMA | PCI | MAC | Name | Driver | Linux IF | Active | +====+======+=========+===================+=================================+===========+=============+==========+ | 0 | -1 | 02:00.0 | ec:0d:9a:8a:27:52 | MT28800 Family [ConnectX-5 Ex] | mlx5_core | enp2s0f0np0 | | +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ | 1 | -1 | 02:00.1 | ec:0d:9a:8a:27:53 | MT28800 Family [ConnectX-5 Ex] | mlx5_core | enp2s0f1np1 | | +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ | 2 | -1 | 05:00.0 | ac:1f:6b:45:18:fe | I350 Gigabit Network Connection | igb | eno1 | *Active* | +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ | 3 | -1 | 05:00.1 | ac:1f:6b:45:18:ff | I350 Gigabit Network Connection | igb | eno2 | | +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ ---- Generate config interactively: ---- root@gtplab0:/etc/opt/trex# ./dpdk_setup_ports.py -i By default, IP based configuration file will be created. Do you want to use MAC based config? (y/N) +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ | ID | NUMA | PCI | MAC | Name | Driver | Linux IF | Active | +====+======+=========+===================+=================================+===========+=============+==========+ | 0 | -1 | 02:00.0 | ec:0d:9a:8a:27:52 | MT28800 Family [ConnectX-5 Ex] | mlx5_core | enp2s0f0np0 | | +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ | 1 | -1 | 02:00.1 | ec:0d:9a:8a:27:53 | MT28800 Family [ConnectX-5 Ex] | mlx5_core | enp2s0f1np1 | | +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ | 2 | -1 | 05:00.0 | ac:1f:6b:45:18:fe | I350 Gigabit Network Connection | igb | eno1 | *Active* | +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ | 3 | -1 | 05:00.1 | ac:1f:6b:45:18:ff | I350 Gigabit Network Connection | igb | eno2 | | +----+------+---------+-------------------+---------------------------------+-----------+-------------+----------+ Please choose an even number of interfaces from the list above, either by ID, PCI or Linux IF Stateful will use order of interfaces: Client1 Server1 Client2 Server2 etc. for flows. Stateless can be in any order. Enter list of interfaces separated by space (for example: 1 3) : 02:00.0 02:00.1 For interface 02:00.0, assuming loopback to its dual interface 02:00.1. Putting IP 1.1.1.1, default gw 2.2.2.2 Change it?(y/N). For interface 02:00.1, assuming loopback to its dual interface 02:00.0. Putting IP 2.2.2.2, default gw 1.1.1.1 Change it?(y/N). Print preview of generated config? (Y/n) ### Config file generated by dpdk_setup_ports.py ### - version: 2 interfaces: ['02:00.0', '02:00.1'] port_info: - ip: 1.1.1.1 default_gw: 2.2.2.2 - ip: 2.2.2.2 default_gw: 1.1.1.1 platform: master_thread_id: 0 latency_thread_id: 1 dual_if: - socket: 0 threads: [2,3,4,5,6,7,8,9,10,11] Save the config to file? (Y/n) Default filename is /etc/trex_cfg.yaml Press ENTER to confirm or enter new file: Saved to /etc/trex_cfg.yaml. ----