Filling a new construct in P4 Runtime

Hi all,

I want to prepare a new construct for example a new buffer by using an extern. Please let me know if it is possible to fill this buffer (an extern) in p4 Runtime (control plane).


If you mean an extern defined in the Portable Switch Architecture specification [1], then the P4Runtime API should already define a way to configure it today [2]. Search for the name of the extern in the spec and it should document how to do so.

If you mean define some new extern, then that typically can only be done if you are developing P4 code on a target that lets you define your own externs, e.g. a software switch like BMv2 or DPDK, or an FPGA-based P4 target. In that case, you need to define your own control plane API for that extern as well.

One way to do so is to follow the fairly general advice in this section of the P4Runtime spec [3].

Another way that some engineers at Intel have been exploring recently, and may soon write more about, perhaps included in a future, not-yet-written version of the P4Runtime spec, is to define the control plane API of the new extern to “look like” the P4Runtime API for a P4 table, not one that the developer wrote in their program, but one that the designer of the extern object created for the purpose of configuring that extern (it might instead have a control plane API that looks like 2 tables, or 5 tables, depending upon the configuration of the extern and how many independent aspects it has to it). Sorry, I do not have a ready example to link to on this idea at this time.

[1] P4~16~ Portable Switch Architecture (PSA)
[2] P4Runtime Specification
[3] P4Runtime Specification

1 Like

Thank you so much,
Let me know if there is any document about the new P4Runtime you mentioned.

The best places to follow enhancements to the P4Runtime specification as they are being worked on are:

1 Like