[P4-dev] storing field_list_calculation into a metadata field

Salvatore Signorello salvatore.signorello at uni.lu
Wed Aug 19 09:14:07 EDT 2015


Hi lj,

thanks, more inline

Best,
Salvo

On 08/19/2015 01:26 PM, LJ Wobker wrote:
>
> 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/ {
>
>     ipv4.source;
>
>     ipv4.dest;
>
>     tcp.source;
>
>     tcp.dest;
>
> }
>
> field_list_calculation *output_value* {
>
>     input {
>
> /something/;
>
>     }
>
>     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…
>
that's exactly what I've tried and it hasn't worked. This produces a 
semantic error for a type mismatch, that is,

Semantic error: Error when calling primitive modify_field (countComp -> 
countComponents -> modify_field) in file myfile.p4 at line 40: argument 
1 has type field list calculation, but formal src has type field, 
integer value

I guess that you may have a look at the primitives.json file to see 
which are the types accepted by this primitive action. Field_list is not 
included.


> --lj
>
> -----Original Message-----
> From: P4-dev [mailto:p4-dev-bounces at p4.org 
> <mailto:p4-dev-bounces at p4.org>] On Behalf Of Salvatore Signorello
> Sent: Wednesday, August 19, 2015 12:07 PM
> To: p4-dev at p4.org <mailto: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).
>
> Best,
>
> Salvatore
>
> -- 
>
> Salvatore Signorello
>
> PhD student @ SecanLab
>
> Interdisciplinary Centre for Security, Reliability and Trust
>
> SnT, University of Luxembourg
>
> http://wwwen.uni.lu/snt/people/salvatore_signorello
>
> _______________________________________________
>
> P4-dev mailing list
>
> P4-dev at p4.org <mailto: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/
>

-- 
Salvatore Signorello
PhD student @ SecanLab

Interdisciplinary Centre for Security, Reliability and Trust
SnT, University of Luxembourg
http://wwwen.uni.lu/snt/people/salvatore_signorello

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


More information about the P4-dev mailing list