[P4-dev] generate_digest vs copy_to_cpu

hemant at mnkcg.com hemant at mnkcg.com
Wed Aug 29 10:34:34 EDT 2018

Hi Richard,


Please see documentation on digest in the PSA specification:

Just section 7.14.  The digest is used to send abbreviated data to the


In the P4-16 specification
(https://p4.org/p4-spec/docs/P4-16-v1.1.0-draft.html) , there is also an
example to send a packet to a specific port.  Search for "to_cpu" in the doc
and see the example.





-----Original Message-----
From: P4-dev <p4-dev-bounces at lists.p4.org> On Behalf Of ecm
Sent: Tuesday, August 28, 2018 7:40 PM
To: p4-dev at lists.p4.org
Subject: [P4-dev] generate_digest vs copy_to_cpu


Hi all,


I want to know which are the differences between using digests or normal
switch_ports when writing some sort of control plane. At the moment the
easiest way I found is to simply send a norma packet to a special port where
you have a process listening and then if needed update the switch using the
CLI, thrift, etc..


When reading the spec, I saw that there was a primitive (not an extern in
simple_switch) called digest. I never used it due to lack of documentation,
examples, etc. However, today I wanted to give it a try, and after checking
the l2 learning example + several mailing list posts + some github issues I
managed to do something.


Putting the P4Runtime aside, and considering only digest, and copy_to_cpu (
is there more ways of having dp-cp communication ???), I would like to know
what is the best way to do DP-CP things, or when is one more useful than the
other ? Because for example using digests seems quite cumbersome, since you
have to acknowledge every packet you receive.


PD: is there any good documentation of how to use the thrift API? The best I
found at the moment is the the runtime_CLI.py


Thanks in advance,




P4-dev mailing list

 <mailto:P4-dev at lists.p4.org> P4-dev at lists.p4.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20180829/0d912086/attachment.html>

More information about the P4-dev mailing list