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

DPDK Backend: PNA Pass metadata support #3245

Merged
merged 5 commits into from
May 2, 2022
Merged

Conversation

usha1830
Copy link
Contributor

DPDK implements pass metadata using "recircid" instruction.

All occurrences of pass metadata usage should be prepended with recircid instruction to fetch the latest pass_id from the target.

"recircid" instruction takes a metadata type as argument to fetch the pass_id into that metadata.

@usha1830 usha1830 changed the title Pass DPDK Backend: PNA Pass metadata support Apr 23, 2022
@@ -69,5 +69,17 @@ class DirectionToRegRead : public Transform {
replaceDirectionWithRegRead(IR::IndexedVector<IR::DpdkAsmStatement> stmts);
};

class PrependPassRecircId : public Transform {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment that accompanies this PR should be present in the code too, here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with PNA, can you also explain how this recirc works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The recirculate() extern corresponds to "recirculate" instruction and marks the packet for recirculation. This means that when packet reaches tx instruction, it is reinjected into the pipeline for another full pass instead of being sent to the output port.

The same packet can be recirculated multiple times, with the recirculation pass number retrieved by the "recircid" instruction which corresponds to "pass" metadata. The pass number can be used by the program to execute different code on the same packet in different pipeline passes. The packet meta-data is preserved between the pipeline passes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DPDK reference patch for packet recirculation
https://patches.dpdk.org/project/dpdk/patch/[email protected]/

@usha1830 usha1830 requested a review from mihaibudiu April 29, 2022 01:46
@mihaibudiu
Copy link
Contributor

There is no "recirculate" extern in your P4 examples.
What triggers recirculation?

@usha1830
Copy link
Contributor Author

There is no "recirculate" extern in your P4 examples. What triggers recirculation?

Updated the examples.

@usha1830
Copy link
Contributor Author

usha1830 commented May 2, 2022

@mbudiu-vmw Can this PR be merged?.

@mihaibudiu mihaibudiu merged commit dd2b243 into p4lang:main May 2, 2022
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

Successfully merging this pull request may close these issues.

2 participants