[P4-dev] storing field_list_calculation into a metadata field

LJ Wobker ljw at barefootnetworks.com
Wed Aug 19 07:26:01 EDT 2015

Per section 2.4 & 3 of the spec, you should be able to use

*field_list_calculation* *output_value*

 to obtain a hash value from your set of fields.  The output of this
(output_value) can then be referenced in action primitives…

field_list *something* {






field_list_calculation *output_value* {

    input {



    algorithm : crc32;

    output_width : 32;


modify_field (salvatores_metadata.hashfield, *output_value*)

// “salvatores_metadata.hashfield” is a 32b field defined in the metadata
header somewhere…

Have you tried this and found it not to be working?  I didn’t pull this
from working code, but it should be pretty close…


-----Original Message-----
From: P4-dev [mailto:p4-dev-bounces at p4.org] On Behalf Of Salvatore
Sent: Wednesday, August 19, 2015 12:07 PM
To: p4-dev at p4.org
Subject: [P4-dev] storing field_list_calculation into a metadata field

Hi all,

is there any way to store the hash of a fields list (so a field list

calculation) into a metadata field for further matching into a table?

The signature of the primitive action "modify_field" does not accept a

field list as src parameter. Could please someone point out if there was

any specific rationale for not allowing such thing?

Note: I still refer to the old specification (ver 1.0.2).




Salvatore Signorello

PhD student @ SecanLab

Interdisciplinary Centre for Security, Reliability and Trust

SnT, University of Luxembourg



P4-dev mailing list

P4-dev at p4.org

Listinfo - http://mail.p4.org/mailman/listinfo/p4-dev_p4.org

Archives - http://mail.p4.org/pipermail/p4-dev_p4.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20150819/f459c81c/attachment-0001.html>

More information about the P4-dev mailing list