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
Add per-route MTU option (LP: #1860201) #160
Conversation
Codecov Report
@@ Coverage Diff @@
## master #160 +/- ##
===========================================
+ Coverage 98.45% 100.00% +1.54%
===========================================
Files 41 41
Lines 6230 5172 -1058
===========================================
- Hits 6134 5172 -962
+ Misses 96 0 -96
Continue to review full report at Codecov.
|
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.
Thank you @hrasiq, this is looking very good!
I requested some some small inline changes (mostly just wording and some refactoring, to avoid duplicated code). And I'd be glad if you could work on those suggestions.
Also, it would be great if you could add a small integration test inside tests/integration/routing.py
within the _CommonTests()
class (so it is run for networkd
and NetworkManager
backends). E.g. similiar to the test_route_on_link
function of that file, where you bring up the interface using you new config option and then verify it on the running system via a ip route ...
+ regex, to match for the relevant string.
This would be especially interesting, as I could not find a documentation about the NetworkManager route-data/mtu
config key and it would be great if it could be verified to be working via integration-/autopkgtests.
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.
fine from a schema perspective.
Thanks for the review, @slyon! On the NM I've been doing more tests with those on Ubuntu Bionic and Focal, and even if NetworkManager itself seems to pick up the I'll implement the changes you've requested, and also give the integration test a try. I'm thinking of removing the MTU sections from the NM backend and just error out early, since I haven't been able to get it to work in my tests. Do you have any other suggestions, or does that make sense? [0] https://developer.gnome.org/libnm/stable/NMSettingIPConfig.html#NM-IP-ROUTE-ATTRIBUTE-MTU:CAPS |
Thank you @hrasiq Okay... if the MTU shows up in nmcli it must be recognized by NM. I'm not sure how NM is supposed to pass that information down to the routing tables... I found this reference talking about MTUs in the routing cache, maybe you could test if it is showing up there: http://linux-ip.net/html/tools-ip-route.html Or you could try using wireshark/tcpdump to verify what the actual MTU size is on that route, once you configured it via NM... For the integration test it would be great if you could find a way to verify the MTU is actually passed through to |
This patch introduces a way to set MTU for specific routes, which is tracked by the new 'mtubytes' field in the NetplanIPRoute struct. Signed-off-by: Heitor Alves de Siqueira <halves@canonical.com>
Codecov Report
@@ Coverage Diff @@
## master #160 +/- ##
=======================================
Coverage 98.88% 98.88%
=======================================
Files 48 48
Lines 6737 6753 +16
=======================================
+ Hits 6662 6678 +16
Misses 75 75
Continue to review full report at Codecov.
|
@slyon Apologies for the long delays on this one. I've sorted out the NetworkManager issues on picking up the route MTU values, and it seems to be working fine now. I've addressed the changes you've requested, and added an integration test as well. It passed correctly on my tests with Ubuntu Bionic and Focal, but please let me know if you'd like any changes there. Thanks again for the review! |
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.
Thank you very much for your continued work @hrasiq
This is looking very good!
Let me run a full set of integration test on this, before I merge it.
Update:
All tests pass on hirsute as well. Great work! Merging.
autopkgtest [11:03:30]: @@@@@@@@@@@@@@@@@@@@ summary
ovs PASS
ethernets PASS
bridges PASS
bonds PASS
routing PASS
vlans PASS
wifi PASS
tunnels PASS
scenarios PASS
regressions PASS
autostart PASS
cloud-init PASS
qemu-system-x86_64: terminating on signal 15 from pid 395416 (/usr/bin/python3)
This patch introduces a way to set MTU for specific routes. It adds an 'mtu'
field to the
NetplanIPRoute
struct, and makes use of already existing routehandling code to add the MTU-related fields for networkd and NM backends.
Checklist
make check
successfully.make check-coverage
).