-
Notifications
You must be signed in to change notification settings - Fork 201
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
Enable eswitch mode setting on SmartNICs #253
Conversation
33c1468
to
9d69bb0
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #253 +/- ##
==========================================
+ Coverage 99.14% 99.16% +0.02%
==========================================
Files 60 61 +1
Lines 10511 10818 +307
==========================================
+ Hits 10421 10728 +307
Misses 90 90 ☔ View full report in Codecov by Sentry. |
e836b9c
to
46ab0ba
Compare
13d9f33
to
1ba1e1c
Compare
bbb49e2
to
3e73abb
Compare
3e73abb
to
fba8f88
Compare
9f1cdb6
to
8db3301
Compare
We got some positive feedback from Canonical's OpenStack team about the new functionality, especially that the VF LAG (bonding of SR-IOV physical functions) is working as expected. |
|
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.
This PR is in great shape, and the code looks overall solid 🙂
I have a few items, most of them non-blocking, but there's one in particular regarding potential ABI break that needs answering before merging.
@@ -707,6 +707,9 @@ _serialize_yaml( | |||
if (def->sriov_link) | |||
YAML_STRING(def, event, emitter, "link", def->sriov_link->id); | |||
YAML_UINT_DEFAULT(def, event, emitter, "virtual-function-count", def->sriov_explicit_vf_count, G_MAXUINT); | |||
YAML_STRING(def, event, emitter, "embedded-switch-mode", def->embedded_switch_mode); | |||
YAML_BOOL_TRUE(def, event, emitter, "delay-virtual-functions-rebind", |
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.
thought (later-pr): the YAML_BOOL_TRUE
name has the opposite semantics to YAML_UINT_0
. I should fix that, I guess?
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.
ACK.
…F/VF mocks dynamically
Taking lots of (especially the PCIDevice class) from: https://github.com/openstack-charmers/mlnx-switchdev-mode/blob/master/mlnx_switchdev_mode/sriovify.py V2: update copyright notice in comment of PCIDevice class
V2: avoid "# pragma: nocover" by having relevant test cases
8db3301
to
9c99162
Compare
Integration tests are still good, even if the CI is doing funny things by skipping most (all?) tests, due to some package dependency issue. I re-ran it locally:
|
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.
LGTM!
I have a small suggestion for the new API, but feel free to merge if you don't want to pick it up.
V2: * simplify self.assert_sriov() in generator/base.py * add new netplan_state_finish_sriov_write() and netplan_sriov_cleanup() API * move SR-IOV rebind service generation into netplan_state_finish_sriov_write() V3: * move 'any_sriov' udev rules logic into netplan_state_finish_sriov_write()
9c99162
to
34c4da9
Compare
Thanks for the re-review! Turned out the I will be merging this. |
Thanks a lot for this, this is a much needed feature to utilize SR-IOV 👍 In case setting num_vfs needs to be done via systemd in the future, there was some recent work on that too: |
Nice! That's good to know. We should probably switch to that upstream solution in the future, once it lands in stable series (maybe in parallel to our manual way of doing it). |
Description
Certain types of network cards/SmartNICs allow toggling their low-level (
devlink
) embedded switch mode PCI setting in order to utilize the full hardware offloading capabilities. With this PR we're exposing this functionality to the netplan YAML schema:embedded-switch-mode: [switchdev|legacy]
delay-virtual-functions-rebind: [false|true]
Example:
This PR builds upon the new libnetplan YAML parser (#250) for accessing the new settings.
Checklist
make check
successfully.make check-coverage
).