Skip to content

Start a new project on P4Pi

Sandor Laki edited this page Aug 25, 2022 · 2 revisions

Start a new P4 project on P4Pi

You can upload your P4 program as a single P4 file via the web interface. If your program consists or multiple files or for any other reasons, you can run your custom program manually as described below.

T4P4S

Assuming that your project is called 'myfirstp4', you first need to create a folder '/root/t4p4s/examples/p4edge/myfirstp4' and copy the files of your P4 program there. The main file should be named as the folder ('myfirstp4.p4' in this case).

Then you need to add a new line to the /root/t4p4s/examples/p4edge/pi-examples.cfg configuration file.

myfirstp4    arch=dpdk hugepages=1024 model=v1model smem vethmode pieal piports

After this your program can be launched with the T4P4S service as described above.

By default, all T4P4S example programs use the EAL options specified with pieal and piports. You can edit these options in /root/t4p4s/opts_dpdk.cfg.

A general description on running T4P4S projects on P4Pi: Creating a new T4P4S project on P4Pi.

Bmv2

The process is similar to T4P4S. Assuming that your project is called 'myfirstp4', you first need to create a folder '/root/bmv2/examples/myfirstp4' and copy the files of your P4 program there. The main file should be named as the folder ('myfirstp4.p4' in this case).

In contrast to T4P4S, further configuration steps are not needed, your program can be launched with the Bmv2 service as described above.

A general description on running Bmv2 projects on P4Pi: Creating a new Bmv2 project on P4Pi.

Clone this wiki locally