Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resubmit with annotations in v1model #2947

Closed
castilhorosa opened this issue Nov 9, 2021 · 4 comments
Closed

Resubmit with annotations in v1model #2947

castilhorosa opened this issue Nov 9, 2021 · 4 comments
Labels
question This is a topic requesting clarification.

Comments

@castilhorosa
Copy link

castilhorosa commented Nov 9, 2021

Hello,

I'm trying to use the examples in https://github.com/jafingerhut/p4-guide/blob/master/v1model-special-ops/README-resubmit-examples.md to resubmit packets preserving user metadata. When I try to compile it though, I get the following error:

[--Werror=type-error] error: 1: could not infer a width resubmit(1);

When I try to use @field_list like in v1model-multiple-resubmit-reasons-field-list-annot.p4 I get a similar error:

[--Werror=not-found] error: fl_resubmit1: declaration not found resubmit(fl_resubmit1);

Are these examples working? If so, what should I do to get them compile?

@mihaibudiu
Copy link
Contributor

resubmit has been broken for a long time. There is a patch currently that attempts to fix it, but it has not been merged yet.
#2902

For the "cannot infer width" error you should specify an integer with a width, e.g. 32w1 instead of 1.

@mihaibudiu mihaibudiu added the question This is a topic requesting clarification. label Nov 9, 2021
@jafingerhut
Copy link
Contributor

@castilhorosa With this commit made to p4c on 2012-Dec-06, the operation resubmit in the v1model architecture has been renamed resubmit_preserving_field_list and takes a numeric field list id, and you can use the @field_list annotation on user-defined metadata fields to define which numeric field list ids that the field is included in.

Also with that commit, the older way of doing things using resubmit({field1, field2, field, 3...}) is now deprecated.

@castilhorosa
Copy link
Author

Thanks @jafingerhut and @mbudiu-vmw

@jafingerhut
Copy link
Contributor

Feel free to reopen this issue, or create a new one, if you find some other problems, but it appears this question has been answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a topic requesting clarification.
Projects
None yet
Development

No branches or pull requests

3 participants