[P4-dev] Extending P4Runtime demo to support multiple P4 programs
antonin at barefootnetworks.com
Tue Oct 17 11:13:31 EDT 2017
I believe that you are confusing the bmv2 JSON with the P4Info message in
- the bmv2 JSON: a JSON description of the forwarding pipeline, which is
required by the bmv2 simple_switch packet-processing binary
- the P4Info message: a protobuf message which describes the data-model to
be used by the control-plane when generating P4 Runtime requests. Although
the compiler lets you generate this in JSON format by using
"--p4runtime-format json", we scarcely use JSON for this: we usually prefer
the "text" format.
You should try running:
p4c-bm2-ss <p4_program> --p4-16 -o out.json
and use out.json instead in SimpleRouterMgr.
Unfortunately, this demo is not super recent, so it's still trying to
generate the P4Info from the bmv2 JSON instead of using the one generated
by the compiler (which is why I didn't include --p4runtime-file in the
compiler invocation above). It should work anyway, but please do let us
know if you run into an issue, and hopefully the demo will be updated in
the upcoming weeks.
On Mon, Oct 16, 2017 at 10:33 AM, Miguel Neves <mcneves at inf.ufrgs.br> wrote:
> I'm trying to extend the P4Runtime demo ( https://github.com/p4lang/PI/
> tree/master/proto/demo_grpc ) to support other P4 programs in addition to
> the ones provided. I'm aware that I need to modify the SimpleRouterMgr
> class ( https://github.com/p4lang/PI/blob/master/proto/demo_grpc/
> simple_router_mgr.h ) to insert a separate configuration for each program.
> The problem raises when I try to assign a new device configuration. I'm
> getting a “Json version requirement not satisfied” message independently
> of the program I try to install. After that, I cannot install any table
> I've generated the necessary P4 info using the following command:
> p4c-bm2-ss <p4_program> --p4-16 -o <output_file> --p4runtime-file
> <p4info_file> --p4runtime-format json
> I compared the generated jsons against the simple_router example (
> simple_router.json ), and in fact the compiler doesn't add a version tag
> to the file.
> Any idea? Should the compiler add that tag?
> P4-dev mailing list
> P4-dev at lists.p4.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev