[P4-dev] generate_digest vs copy_to_cpu

ec richard.mayers92 at gmail.com
Wed Aug 29 18:33:54 EDT 2018

Thanks for the reply Hemant,

I know that digest is to send something small, and that sending to cpu sends the entire packet (still you can make it small by truncating).

I was asking more about, if there is any big difference, if one is a better practice than the other in the general case. 

Furthermore, where can I find documentation for the thrift API ?

Kind regards,

> On 29 Aug 2018, at 16:34, hemant at mnkcg.com wrote:
> Hi Richard,
> Please see documentation on digest in the PSA specification: https://p4.org/p4-spec/docs/PSA-v1.0.0.html <https://p4.org/p4-spec/docs/PSA-v1.0.0.html>  
> Just section 7.14.  The digest is used to send abbreviated data to the control-plane.
> In the P4-16 specification (https://p4.org/p4-spec/docs/P4-16-v1.1.0-draft.html <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.
> Hemant
> -----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,
> Richard
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org <mailto:P4-dev at lists.p4.org>
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org <http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20180830/d172e99a/attachment.html>

More information about the P4-dev mailing list