Closed hanw closed 6 years ago
I believe it means the packet either originates from the packet_out API or destined to the packet_in API at the controller, see: https://github.com/p4lang/PI/blob/master/proto/p4/p4runtime.proto
@DGeorgeNetro ,
I think this is a good start, but it confirms my point that the definition of the CPU port requires some terminology that lies outside of P4 :), because from P4 perspective it is just another port that happens to send/receive packets with some additional headers, defined by a particular data plane program (or it might send/receive exact same packets as any other port).
Whether the control plane has to use a different API to communicate with this port or not really depends on the particulars of a given API.
We can say that CPU_PORT is such a port that if you send a packet into it it is expected to reach the control plane (and vice versa), and that each PSA device is expected to have one such port.
Quite right, your description makes sense.
There seem to be movements in the PI to link P4 metadata to runtime as well, ie @controller_metadata("packet_in") and @controller_metadata("packet_out"). I suspect this may have dataplane implementation implications as well which may need to be represented in the PSA spec. I wouldn't close this off until that behaviour has been finalised.
Recomendation: Add a few sentences to the PSA that point to the part of the P4 Runtime API spec that is specifically about sending packets from controller to a device and having the device process it via its P4 program (from the PSA perspective, the 'from CPU port' packet path), and for sending packets from a device to the controller (from the PSA perspective, 'to the CPU port'), which mentions how the bits/bytes of the P4 Runtime API calls turn into the bits/bytes in the packets as seen by PSA.
Perhaps this comment by Antonin Bas would be a good reference to link to for this: https://github.com/p4lang/PI/issues/183#issuecomment-319161250
I have created a PR that adds a few sentences to the PSA specification here: https://github.com/p4lang/p4-spec/pull/570
They simply mention that P4 Runtime "Packet Out" becomes a PSA input packet on the CPU port, and a packet that a PSA device sends out on its CPU port becomes a P4 Runtime "Packet In" packet. Also that there is no P4 metadata carried with such packets -- only the headers that the P4 code explicitly emits when sending the packet to the CPU port.
It does mention that some fields in headers may be numerically translated, e.g. fields with type PortId_t at least are expected to have this happen on these packets. Other than that, though, I am not aware of any plans to modify such packets between a controller and a PSA device.
PR merged in, so closing this issue.
What does "send to CPU" mean? (CPU_PORT semantics)