Unknown format for p4_device_config error

19 views
Skip to first unread message

Prashanth Iyengar

unread,
Feb 8, 2022, 5:56:20 PM2/8/22
to ONOS Discuss
Hello,

I am trying figure out the necessary steps needed to write an ONOS app to push a P4 program on to a physical Stratum Tofino switch.

I get the following error while attempting to push the pipeline using netcfg.

INVALID_ARGUMENT: Unknown format for p4_device_config.

I verified that the same P4 program can be pushed to the physical Tofino switch running Stratum using the p4lang/p4runtime-shell successfully.

Probably, there is some mistake in the how the P4 compiler outputs are being packaged in the pipeconf/Pipeconfloader.java.

    private PiPipeconf buildPipeconf() throws P4InfoParserException {

        final URL p4InfoUrl = PipeconfLoader.class.getResource(P4INFO_PATH);
        final URL tofinoBinUrl = PipeconfLoader.class.getResource(TOFINO_BIN_PATH);
        final URL tofinoContextJsonPathUrl = PipeconfLoader.class.getResource(TOFINO_CONTEXT_JSON_PATH);
        final PiPipelineModel pipelineModel = P4InfoParser.parse(p4InfoUrl);

        return DefaultPiPipeconf.builder()
                .withId(PIPECONF_ID)
                .withPipelineModel(pipelineModel)
                .addBehaviour(PiPipelineInterpreter.class, InterpreterImpl.class)
                .addBehaviour(Pipeliner.class, PipelinerImpl.class)
                .addExtension(P4_INFO_TEXT, p4InfoUrl)
                .addExtension(TOFINO_BIN, tofinoBinUrl)
                .addExtension(TOFINO_CONTEXT_JSON, tofinoContextJsonPathUrl)
                .build();
    }

   
Any suggestions or debugging tips would be really helpful.

Please see my previously posted query for more on this - https://groups.google.com/a/onosproject.org/g/onos-dev/c/9VGmfYGqmNk

Thanks,
Prashanth



Carmelo Cascone

unread,
Feb 8, 2022, 6:31:58 PM2/8/22
to Prashanth Iyengar, ONOS Discuss, ONOS Developers
Hi,

We changed the supported pipeline config format in Stratum some time ago:

Instead of providing the TOFINO_BIN and TOFINO_CONTEXT_JSON separately, you should provide a single file with extension type RAW_DEVICE_CONFIG.

You can find an example of how to package such pipeconf here:

And how to generate the new pipeline config file for Stratum here:

Hope it helps
Carmelo

--
You received this message because you are subscribed to the Google Groups "ONOS Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-discuss...@onosproject.org.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-discuss/93ed6b6d-f94e-4844-9959-4df233ae7484n%40onosproject.org.

Prashanth Iyengar

unread,
Feb 8, 2022, 8:06:21 PM2/8/22
to ONOS Discuss, Carmelo Cascone, ONOS Discuss, ONOS Developers, Prashanth Iyengar
Hi Carmelo,

Thank you for your prompt response.
I will follow the instructions that you have mentioned.

Thanks,
Prashanth
Reply all
Reply to author
Forward
0 new messages