-
Notifications
You must be signed in to change notification settings - Fork 334
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
Added Recirculation functionality in PNA_NIC #1273
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,7 @@ class PnaNic : public Switch { | |
|
||
private: | ||
static packet_id_t packet_id; | ||
static constexpr port_t PNA_PORT_RECIRCULATE = 0xfffffffa; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no mention of a recirculation port in the PNA spec. @jafingerhut is this correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, there is a recirculate() operation in PNA, and if that is done, then the packet should recirculate when it completes the current execution of the main control. There is NO recirculation port like there is in PSA or v1model architectures. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: As an implementation technique, it is probably a reasonable idea to have a C++ boolean or 1-bit flag somewhere associated with the packet in the PNA implementation that is initialized to 0/false whenever a packet begins execution of the main control, and it is set to 1/true when the recirculate() extern function is called. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't find a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I didn't find any If introducing a new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @antoninbas, Is the current approach Ok? Or should I change it recirculate() extern approach? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One approach is to wait until there is an official PNA definition for how recirculation is done, and behaves, and implement other features that are already well-defined. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||
|
||
enum PktInstanceType { | ||
FROM_NET_PORT, | ||
|
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.
what's the expected value of
pna_main_parser_input_metadata.input_port
for recirculated packets?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 believe it should be unchanged from the original. Unfortunately some things like this are not yet spelled out in as precise a form in the PNA architecture as they are in the PSA architecture, but I believe "input_port is unchanged after recirculate operation" is a reasonable starting place (and maybe finishing place, too).
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.
Thanks. This is not what the current PR does, but it can be done easily. See PSA implementation:
behavioral-model/targets/psa_switch/psa_switch.cpp
Lines 618 to 619 in 28b736c
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.
Ok. Will update the line.
Just a doubt: Why are we setting
ingress_port
field toPSA_PORT_RECIRCULATE
? The P4 programs will find whether the packet is recirculated on not usingrecirculated_flag
field.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.
According to @jafingerhut, the port should be set to the original ingress port, not
PSA_PORT_RECIRCULATE
But we should still set the port to something. With your current implementation, the port will always be set to 0. At least that's what will happen I think based on the
reset_metadata
call (I didn't test).