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

cpf_ran.p4 exit statements for v1model use #3

Open
hesingh opened this issue Jun 6, 2021 · 5 comments
Open

cpf_ran.p4 exit statements for v1model use #3

hesingh opened this issue Jun 6, 2021 · 5 comments

Comments

@hesingh
Copy link

hesingh commented Jun 6, 2021

I see one exit statement below:

https://github.com/P4ELTE/use_cases/blob/master/p4-16/bst/cpf_ran.p4#L170

The exit statement causes exit out of RANIngress control. But the RANIngressDeparser still runs and emits the packet. Sorry, I don't understand if the packet is dropped, the deparser should not emit anything.

@jafingerhut
Copy link

An exit statement in a P4 control means that the enclosing control is immediately exited. It is up to the definition of the architecture whether other parsers or controls are executed on the packet later.

In TNA, the ingress deparser control is always executed on a packet after the ingress control is finished executing, regardless of whether the ingress control finishes by executing an exit statement, or some other means.

Whether a packet is dropped or not depends upon the values of TNA output metadata field values when the ingress control is finished executing.

@gpz76
Copy link
Collaborator

gpz76 commented Jun 8, 2021 via email

@hesingh
Copy link
Author

hesingh commented Jun 8, 2021

If the v1model.p4 is used for cpf_ran.p4, this model has no metadata in deparser. So the deparser has no means to check if 'meta.drop == 1' and the deparser emits the hdr. v1model P4 code should invalidate all headers in hdr for drop case and then the deparser won't emit anything.

@jafingerhut
Copy link

@hesingh In v1model in BMv2 at least (which is the only v1model architecture implementation I know of), if the packet is dropped in ingress, the deparser never executes. It doesn't get enqueued in the traffic manager, even.

@hesingh
Copy link
Author

hesingh commented Jun 9, 2021

Wow, @jafingerhut I didn't know that. thanks. We can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants