P4ELTE / t4p4s

Retargetable compiler for the P4 language
http://p4.elte.hu/
Apache License 2.0
119 stars 42 forks source link

Not able to run l2fwd app from examples #7

Closed vitaliy-senchyshyn closed 6 years ago

vitaliy-senchyshyn commented 6 years ago

I'm trying to launch l2fwd app on my machine but always get an error that either port 0 or 1 is not present on the board. The application is built successfully but the execution just fails with the following log:

root@10gbsrv01:~/t4p4s# ./t4p4s.sh v14 examples/l2fwd.p4
Defaulting to launching examples/l2fwd.p4
-------------------- Compiling P4-14 -> C
-------------------- Compiling C -> switch executable
Unknown option --path
Package libdpdk was not found in the pkg-config search path.
Perhaps you should add the directory containing `libdpdk.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libdpdk' found
Unknown option --path
Package libdpdk was not found in the pkg-config search path.
Perhaps you should add the directory containing `libdpdk.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libdpdk' found
  LD l2fwd
  INSTALL-APP l2fwd
  INSTALL-MAP l2fwd.map
-------------------- Running controller
Controller     : dpdk_l2fwd_controller (default for l2fwd)
Controller log : ./build/l2fwd/controller.log
make: 'dpdk_l2fwd_controller' is up to date.
Controller opts: 
-------------------- Running switch
Using 2048 hugepages (sufficient, as 2048 are needed)
DPDK options  : v1model dpdk_default  l2fwd   2cores 2x1ports
DPDK params   :  -c 0x3 -n 1 -- -p 0x3 --config "\"(0,0,0),(1,0,1)\""
Program: ./build/l2fwd/build/l2fwd
Options: -c 0x3 -n 1 -- -p 0x3 --config "\"(0,0,0),(1,0,1)\""
EAL: Detected 6 lcore(s)
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Multi-process socket /var/run/.rte_unix
EAL: Probing VFIO support...
EAL: PCI device 0000:02:00.0 on NUMA socket 0
EAL:   probe driver: 8086:1528 net_ixgbe
EAL: PCI device 0000:02:00.1 on NUMA socket 0
EAL:   probe driver: 8086:1528 net_ixgbe
port 0 is not present on the board
EAL: Error - exiting with code: 1
  Cause: check_port_config failed

The netdevs on my machine are the following:

root@10gbsrv01:~/t4p4s# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 94:de:80:ce:78:20 brd ff:ff:ff:ff:ff:ff
3: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether a0:36:9f:44:25:50 brd ff:ff:ff:ff:ff:ff
4: enp2s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether a0:36:9f:44:25:52 brd ff:ff:ff:ff:ff:ff
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether 02:42:f9:70:2a:19 brd ff:ff:ff:ff:ff:ff

I would like to try the test app with enp2s0f0 and enp2s0f1 interfaces but just can't figure out how to do this. When I've tried to run it with "\"(3,0,0),(4,0,1)\" ports I've got an error that port mask is wrong.

So how should I modify the config in order to make it working?

slaki commented 6 years ago

Hi Vitaliy,

Before using t4p4s, you should assign a dpdk-supported kernel module to the NICs to be used. This can be done by the devbind tool in the folder of your dpdk installation (https://doc.dpdk.org/guides/tools/devbind.html). In addition, hugepages should also be allocated in advance (https://doc.dpdk.org/guides/linux_gsg/sys_reqs.html).

Could you please check if it solves the problem?

vitaliy-senchyshyn commented 6 years ago

It helped, thanks!