I'm trying to install the TRex Traffic Generator on Ubuntu Server 14.04, but I can't get it to run. I've installed DPDK separately (beforehand) and gotten that to work, but now DPDK's EAL is giving me issues.
I followed the instructions [here](
https://trex-tgn.cisco.com/trex/doc/trex_manual.html). I copied `cfg/simple_cfg.yaml` to `/etc/trex_cfg.yaml` (and changed to include my port numbers). However, when I run `sudo ./dpdk_setup_ports.py -i`, I get this error:
```
EAL: Failed to remap 2 MB pages
PANIC in rte_eal_init():
```
The same error occurs when I run the example command to start TRex:
`sudo ./t-rex-64 -f cap2/dns.yaml -c 4 -m 1 -d 10 -l 1000`
The only thing I can think of is that my NIC is an Intel® 82576 Gigabit Ethernet Controller, which isn't listed as a supported NIC on the guide. Would that be the problem?
I've preemptively included some output that I figure might be helpful in figuring out what is going wrong.
--------------------------------------------------------------------------------
Here is my trex_cfg.yaml file:
```
$ cat /etc/trex_cfg.yaml
- port_limit : 2
version : 2
#List of interfaces. Change to suit your setup. Use ./dpdk_setup_ports.py -s to see available options
interfaces : ["06:00.0","06:00.1"]
port_info : # Port IPs. Change to suit your needs. In case of loopback, you can leave as is.
- ip : 1.1.1.1
default_gw : 2.2.2.2
- ip : 2.2.2.2
default_gw : 1.1.1.1
```
I have hugepages set up and free:
```
$ cat /proc/meminfo | grep -i huge
AnonHugePages: 202752 kB
HugePages_Total: 2048
HugePages_Free: 2048
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
```
I have the ports assigned to DPDK-compatible drivers
```
$ sudo ./dpdk_setup_ports.py -s
Network devices using DPDK-compatible driver
============================================
0000:06:00.0 '82576 Gigabit Network Connection' drv=igb_uio unused=vfio-pci,uio_pci_generic
0000:06:00.1 '82576 Gigabit Network Connection' drv=igb_uio unused=vfio-pci,uio_pci_generic
Network devices using kernel driver
===================================
0000:05:00.0 '82576 Gigabit Network Connection' if=p1p1 drv=igb unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:05:00.1 '82576 Gigabit Network Connection' if=p1p2 drv=igb unused=igb_uio,vfio-pci,uio_pci_generic
Other network devices
=====================
<none>
```
Here are my NICs
```
$ sudo lspci | grep Ethernet
05:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
05:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
06:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
06:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
```
This is the output when I use dpdk_setup_ports:
```
$ sudo ./dpdk_setup_ports.py -i
By default, IP based configuration file will be created. Do you want to use MAC based config? (y/N)n
+----+------+---------+-------------------+----------------------------------+---------+----------+----------+
| ID | NUMA | PCI | MAC | Name | Driver | Linux IF | Active |
+====+======+=========+===================+==================================+=========+==========+==========+
| 0 | -1 | 05:00.0 | 00:1b:21:6c:fc:98 | 82576 Gigabit Network Connection | igb | p1p1 | *Active* |
+----+------+---------+-------------------+----------------------------------+---------+----------+----------+
| 1 | -1 | 05:00.1 | 00:1b:21:6c:fc:99 | 82576 Gigabit Network Connection | igb | p1p2 | |
+----+------+---------+-------------------+----------------------------------+---------+----------+----------+
| 2 | -1 | 06:00.0 | | 82576 Gigabit Network Connection | igb_uio | | |
+----+------+---------+-------------------+----------------------------------+---------+----------+----------+
| 3 | -1 | 06:00.1 | | 82576 Gigabit Network Connection | igb_uio | | |
+----+------+---------+-------------------+----------------------------------+---------+----------+----------+
Please choose 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) : 2 3
Could not run TRex to get info about interfaces, check if it's already running.
stdout: The ports are bound/configured.
Starting TRex v2.27 please wait ...
EAL: Failed to remap 2 MB pages
PANIC in rte_eal_init():
Cannot init memory
6: [./_t-rex-64-o() [0x4815cd]]
5: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f516d889f45]]
4: [./_t-rex-64-o(_Z9main_testiPPc+0x22a) [0x4beb8a]]
3: [./_t-rex-64-o(rte_eal_init+0xe95) [0x6ffd55]]
2: [./_t-rex-64-o(__rte_panic+0xb6) [0x47e7d8]]
1: [./_t-rex-64-o(rte_dump_stack+0x28) [0x700748]]
./t-rex-64: line 60: 23650 Aborted (core dumped) ./_t-rex-64-o $INPUT_ARGS $EXTRA_INPUT_ARGS
```
And this is the output I get when I run t-rex by itself
```
$ sudo ./t-rex-64 -f cap2/dns.yaml -c 4 -m 1 -d 1 -l 10
The ports are bound/configured.
Starting TRex v2.27 please wait ...
EAL: Failed to remap 2 MB pages
PANIC in rte_eal_init():
Cannot init memory
6: [./_t-rex-64-o() [0x4815cd]]
5: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fa42ec71f45]]
4: [./_t-rex-64-o(_Z9main_testiPPc+0x22a) [0x4beb8a]]
3: [./_t-rex-64-o(rte_eal_init+0xe95) [0x6ffd55]]
2: [./_t-rex-64-o(__rte_panic+0xb6) [0x47e7d8]]
1: [./_t-rex-64-o(rte_dump_stack+0x28) [0x700748]]
./t-rex-64: line 60: 24311 Aborted (core dumped) ./_t-rex-64-o $INPUT_ARGS $EXTRA_INPUT_ARGS
```