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
chore(pipelined): datapath refactor inout #12495
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
Oops! Looks like you failed the Howto
♻️ Updated: ✅ The check is passing the Python Format Check after the last commit. |
Oops! Looks like you failed the Howto
♻️ Updated: ✅ The check is passing the Markdown lint check after the last commit. |
ad0537c
to
928db64
Compare
from ryu.controller.handler import MAIN_DISPATCHER, set_ev_cls | ||
|
||
|
||
class MandatoryController(RestartMixin, MagmaController): |
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.
Hm I'm not sure why we're adding unnecessary inheritance here, whats the purpose of MandatoryController class?
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 think we shouldn't introduce this
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 reason is the common logic used in the three new controllers - would you prefer to handle this in a util class? (at least the ryu annotated functions would need to be duplicated in ingress, middle and egress apps).
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.
Yeah we already have a MagmaController class, lets either put stuff there(only if its applicable to all controllers) or duplicate the code
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.
Hi Nick, MagmaController is super class of a lot of apps so we should not move the common logic for ingress, middle and egress there. We will remove the new abstract controller and inline the code.
f.e this seems to be only used in middle
_get_vlan_egress_flow_msgs is used in middle and egress and please note that this does not belong to the class MandatoryController - this is the same patter as in inout.py before. We will move it to a util file/module.
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.
pushed - running integ test on fork to be sure
https://github.com/nstng/magma/actions/runs/2203084202
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.
doc changes seem reasonable, I'll let the pipelined codeowners validate the correctness :D Also, out of scope for this PR but is the diagram better handled with mermaid? (https://mermaid-js.github.io/mermaid/#/)
flows.delete_all_flows_from_table(datapath, self.tbl_num) | ||
|
||
|
||
def _get_vlan_egress_flow_msgs( |
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.
f.e this seems to be only used in middle
from ryu.controller.handler import MAIN_DISPATCHER, set_ev_cls | ||
|
||
|
||
class MandatoryController(RestartMixin, MagmaController): |
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.
Yeah we already have a MagmaController class, lets either put stuff there(only if its applicable to all controllers) or duplicate the code
c17ab9a
to
c9adac6
Compare
FYI for reviewers: added an additional commit for Bazel adaptions. Reason: the pipelined bazelification was merged after this PR was created and the changes here need to be reflected in Bazel. |
c9adac6
to
5952159
Compare
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.
Looking good, just a minor point.
lte/gateway/python/magma/pipelined/app/vlan_egress_flow_msgs.py
Outdated
Show resolved
Hide resolved
2a73083
to
6f9e8ac
Compare
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.
Only reviewed the "docs" change, which LGTM.
@@ -0,0 +1,91 @@ | |||
""" |
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.
Move this file up one directory and rename it to vlan_utils.py
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.
👍 pushed
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 have one nit please fix before merging. Otherwise looks really clean, thanks for working on it!
@pshelar give this a quick glance through maybe
Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
…ess controller Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
…ller Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
…middle and egress controllers Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
…f date register table - reg10->reg12) Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
6f9e8ac
to
72107cb
Compare
priority=priority, output_reg=output_reg, output_port=out_port, | ||
), | ||
) | ||
return msgs |
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.
did you ran non-nat datapath tests from S1AP integ tests with this PR?
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.
@pshelar, we run all tests in the "lte integ tests" workflow. Last run on fork: https://github.com/nstng/magma/runs/6115971885?check_suite_focus=true
Edit latest run: https://github.com/nstng/magma/actions/runs/2252702388
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 dont see test_attach_detach_non_nat_dp_ul_tcp.py
in the test log, can you check it.
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.
test_attach_detach_non_nat_dp_ul_tcp.py
is in the NON_SANITY_TESTS
list. It looks like the NON_SANITY_TESTS
are not executed with the LTE integ-tests workflow. I do not see them executed anywhere automatically. Do you happen to know if this is intentionally?
I will execute them manually - but this will take some time.
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.
Lets move this test to 'PRECOMMIT_TESTS' set.
cc: @ssanadhya
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.
@pshelar executed the tests locally - test_attach_detach_non_nat_dp_ul_tcp.py
was successful.
In general the tests seem to be very flaky (on a fresh vm setup). I still do not have all tests green. Do you have an opinion if one of the following tests might be relevant for the change?:
test_s1_handover_ping_pong.py
test_activate_deactivate_multiple_dedicated.py
test_sctp_shutdown_while_mme_is_stopped.py
test_secondary_pdn_with_dedicated_bearer_multiple_services_restart.py
test_3495_timer_for_dedicated_bearer_with_mme_restart.py
test_no_attach_complete_with_mme_restart.py
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.
these are not related datapath, so we can ignore it.
Looks good to me for these changes. |
) | ||
return msgs | ||
|
||
def _install_default_flows(self, datapath): |
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.
function, _install_default_flows() is duplicated in ingress, middle and egress, can we move it to base calss.
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.
@pshelar: base.py is the super class of other controllers too. And those other controllers also have _install_default_flows()
- but these are diverging implementations. Do we really want to implement _install_default_flows()
of ingress, middle and egress in base.py and let all other controllers override this function?
Another approach would be to add an inheritance layer between base.py and ingress, middle and egress and put common logic there - this was already discussed with @koolzz above - this has the downside of adding inheritance complexity to the model.
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, thats fine.
chan = self._msg_hub.send(default_msgs, datapath) | ||
self._wait_for_responses(chan, len(default_msgs)) | ||
|
||
def _wait_for_responses(self, chan, response_count): |
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.
same as above, this function can be moved to base class.
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.
See answer above - additionally this function is not used by a lot of controllers that extend base.by.
if not result.ok(): | ||
return fail(result.exception()) | ||
|
||
def cleanup_on_disconnect(self, datapath): |
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.
same for this function.
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.
See answers above.
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 for working on this.
* chore(pipelined): split up controllers from inout are added Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com> * chore(pipelined): inout (sudo unit) tests use ingress, middle and egress controller Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com> * chore(pipelined): rpc servicer uses ingress, middle and egress controller Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com> * chore(pipelined): inout is removed and logic is switched to ingress, middle and egress controllers Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com> * chore(pipelined): pipelined documentation is updated (including out of date register table - reg10->reg12) Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com> * chore(pipelined): bazel is adapted to use the new services Signed-off-by: Nils Semmelrock <nils.semmelrock@tngtech.com>
Summary
See #12072.
Done in pairing with @vktng
This PR is best reviewed commit by commit
Open questions:
Test Plan
Additional Information