[P4-dev] P4_16 resubmit/recirculate

cs.lev cs.lev at gmx.com
Fri Sep 7 03:21:52 EDT 2018


I added the structs to my source as you suggested, and called resubmit
in an action :S

I still got an error as follows:

error: MethodCallStatement: Conditional execution in actions is not
supported on this target
            resubmit(meta.resubmit_meta);
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I have also tried with newer p4c compiler (v0.5).

Thanks

On Thu, 2018-09-06 at 14:09 +0000, Costa Molero  Edgar wrote:
> Hi, 
> 
> You can see the extern definition in the v1model:
> 
> extern void resubmit<T>(in T data);
> extern void recirculate<T>(in T data);
> 
> You need some metadata.
> 
> For me this works: (at the ingress pipeline)
> 
> 
> struct resubmit_meta_t {
>    bit<8> i;
> }
> 
> struct metadata {
>     resubmit_meta_t resubmit_meta;
> }
> 
> 
> resubmit(meta.resubmit_meta);
> 
> Edgar
> 
> 
> > On 6 Sep 2018, at 11:52, cs.lev <cs.lev at gmx.com> wrote:
> > 
> > Dear All,
> > 
> > I am trying to play with resubmit/recirculate in P4. From the
> > specification, I have realized the recirculation can only be done
> > in
> > the egress pipeline, so maybe resubmit is the one that I need.
> > 
> > I am expecting a special packet with a special header that I have
> > defined, and once I got it, I want to modify the one of the header
> > fields, and get received the modified packet again through the
> > ingress
> > pipeline.
> > 
> > I have found an old commit message in p4lang/tutorials about
> > resubmit,
> > however the code itself is not part of the repo anymore, and it is
> > also
> > in P4_14 (not in P4_16) from which it is not straightforward how to
> > reproduce it.
> > 
> > My playground:
> > In my pipeline, I don't really want to use any metadata (if it is
> > not
> > necessary), I only want to decrease the value of a specific header
> > field with one and resubmit, then reduce again, and resubmit until
> > that
> > specific header field becomes 1. If it is reached, I would like to
> > send
> > it out to a port.
> > 
> > If in an action I call resubmit() I got the following error:
> > 
> > error: resubmit: Not enough arguments for call
> >             resubmit();
> >             ^^^^^^^^^^
> > If I try to put hdr, meta, standard_metadata (from the Ingress
> > processing control's parameters, I got the following error:
> > error: MethodCallStatement: Conditional execution in actions is not
> > supported on this target
> >             resubmit(hdr);
> > 
> > 
> > I am using the p4tutorial VM with simple_switch version: 1.10.0-
> > 39abe290, with p4c 0.1.
> > 
> > Thank you for considering my request.
> > 
> > BR,
> > cs.lev
> > 
> > _______________________________________________
> > P4-dev mailing list
> > P4-dev at lists.p4.org
> > http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
> 
> 



More information about the P4-dev mailing list