-
Notifications
You must be signed in to change notification settings - Fork 447
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
Conversation
@@ -69,5 +69,17 @@ class DirectionToRegRead : public Transform { | |||
replaceDirectionWithRegRead(IR::IndexedVector<IR::DpdkAsmStatement> stmts); | |||
}; | |||
|
|||
class PrependPassRecircId : public Transform { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]/
There is no "recirculate" extern in your P4 examples. |
Updated the examples. |
@mbudiu-vmw Can this PR be merged?. |
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.