P4ELTE / t4p4s

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

Network card selection options #52

Closed VogelIBR closed 1 year ago

VogelIBR commented 1 year ago

Hi,

Are there configuration options which network card t4p4s should use? I want to use real network cards, e.g., eno34np1

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno33np0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 1c:34:da:6f:c6:6e brd ff:ff:ff:ff:ff:ff
    altname enp1s0f0np0
    inet 128.110.219.112/21 metric 1024 brd 128.110.223.255 scope global eno33np0
       valid_lft forever preferred_lft forever
    inet6 fe80::1e34:daff:fe6f:c66e/64 scope link 
       valid_lft forever preferred_lft forever
3: eno34np1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 1c:34:da:6f:c6:6f brd ff:ff:ff:ff:ff:ff
    altname enp1s0f1np1
4: enp65s0f0np0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 0c:42:a1:dd:5f:d0 brd ff:ff:ff:ff:ff:ff
    inet 10.10.1.1/24 brd 10.10.1.255 scope global enp65s0f0np0
       valid_lft forever preferred_lft forever
    inet6 fe80::e42:a1ff:fedd:5fd0/64 scope link 
       valid_lft forever preferred_lft forever
5: enp65s0f1np1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0c:42:a1:dd:5f:d1 brd ff:ff:ff:ff:ff:ff

I tried changing the network mask to, e.g., 0x4 but t4p4s complains with the following error:

lib_init_hw@ 129 [CORE 0]  !!!! Port 0 is not present on the board
EAL: Error - exiting with code: 1
  Cause: check_port_config failed

Thanks

manuel-simon commented 1 year ago

you have to bind the network card to a DPDK driver first using the dpdk/usertools/dpdk-devbind.py script

VogelIBR commented 1 year ago

Thanks for the reply.

Did I set it wrong?

$dpdk-devbind.py --status

Network devices using DPDK-compatible driver
============================================
0000:41:00.0 'MT27800 Family [ConnectX-5] 1017' drv=vfio-pci unused=mlx5_core
0000:41:00.1 'MT27800 Family [ConnectX-5] 1017' drv=vfio-pci unused=mlx5_core

Network devices using kernel driver
===================================
0000:01:00.0 'MT27800 Family [ConnectX-5] 1017' if=eno33np0 drv=mlx5_core unused=vfio-pci *Active*
0000:01:00.1 'MT27800 Family [ConnectX-5] 1017' if=eno34np1 drv=mlx5_core unused=vfio-pci 

Still results in

EAL: Probe PCI driver: mlx5_pci (15b3:1017) device: 0000:41:00.0 (socket 0)
mlx5_common: No Verbs device matches PCI device 0000:41:00.0, are kernel drivers loaded?
mlx5_common: Verbs device not found: 0000:41:00.0
mlx5_common: Failed to initialize device context.
EAL: Requested device 0000:41:00.0 cannot be used
EAL: Bus (pci) probe failed.
TELEMETRY: No legacy callbacks, legacy socket not created
lib_init_hw@ 129 [CORE 0]  !!!! Port 0 is not present on the board
EAL: Error - exiting with code: 1
  Cause: check_port_config failed

T₄P₄S switch running ./examples/basic-mirror.p4  exited with error code 1 
 - Runtime options were: -a 0000:41:00.0 0000:41:00.1 -- -p 0x3 --config "\"(0,0,0)\"" 
VogelIBR commented 1 year ago

Ok nvm, with mellanox mlx5_core should be the right driver, even though it does not show up as dpdk-compatible in the dpdk-devbind.py --status.

I actually got it working now with the mlx5_core driver. I think it might just have been a typo in the config that causes the error.