[P4-dev] Error on building soft switch with openflow agent

Antonin Bas antonin at barefootnetworks.com
Tue Nov 8 12:31:46 EST 2016

Hi Tanja,

Now that switch.p4 is leveraging the P4 "range" match type, it can no
longer be compiled for bmv1 (p4c-behavioral), and we should be removing
bmv1 from p4lang very soon.
The "range" match type is supported by the new version of the
behavioral-model, aka bmv2 (https://github.com/p4lang/behavioral-model).
You should be able to compile switch.p4 with OF support for bmv2 (outside
of p4factory). Unfortunately, I did not find step-by-step instructions, but
is should basically be as follows:
- install bmv2 (https://github.com/p4lang/behavioral-model). The configure
script needs to be run with --with-pdfixed.
- install the bmv2 compiler (
- install the OF agent (https://github.com/p4lang/p4ofagent). You need to
export CPPFLAGS=-D_BMV2_ when doing this.
- compile switch (https://github.com/p4lang/switch). You need to run
configure with --with-bmv2 and --with-of. If you are missing any
dependency, you should get an error at this point.
If you run into an issue for one of these steps, please reach out to us.



On Tue, Nov 8, 2016 at 4:57 AM, Tanja Ulmen <tanja.ulmen at rwth-aachen.de>

> Hello everyone,
> I get an error on building the Soft Switch from the p4factory with an
> Openflow agent. When I run "make bm-p4ofagent PLUGIN_OPENFLOW=1" I get the
> following error:
> ...
> Header type security_metadata_t not byte-aligned, adding padding
> Header type fabric_metadata_t not byte-aligned, adding padding
> Header type int_metadata_i2e_t not byte-aligned, adding padding
> Header type meter_metadata_t not byte-aligned, adding padding
> Header type qos_metadata_t not byte-aligned, adding padding
> Generating files in directory /home/tanja/Desktop/test/
> p4factory/targets/switch/build/bm
> total phv length (in bytes): 2020
> P4_MATCH_RANGE match not yet supported
> Traceback (most recent call last):
>   File "/home/tanja/Desktop/test/p4factory/submodules/p4c-behavioral/p4c_bm/shell.py",
> line 150, in <module>
>     main()
>   File "/home/tanja/Desktop/test/p4factory/submodules/p4c-behavioral/p4c_bm/shell.py",
> line 138, in main
>     dump_yaml = args.dump_yaml)
>   File "/home/tanja/Desktop/test/p4factory/submodules/p4c-behavioral/p4c_bm/smart.py",
> line 1164, in render_dict_create
>     render_dict_populate_tables(render_dict, hlir)
>   File "/home/tanja/Desktop/test/p4factory/submodules/p4c-behavioral/p4c_bm/smart.py",
> line 661, in render_dict_populate_tables
>     assert(False)
> AssertionError
> /home/tanja/Desktop/test/p4factory/submodules/p4c-behavioral/p4c-bm.mk:96:
> recipe for target 'bm_tenjin_output_oldest' failed
> make: *** [bm_tenjin_output_oldest] Error 1
> Does anyone know, how to solve it? I use the p4factory repository as it
> is, without any changes.
> Regards,
> Tanja
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161108/026cebac/attachment-0002.html>

More information about the P4-dev mailing list