-
-
Notifications
You must be signed in to change notification settings - Fork 297
WIP: use netlink instead of calling iproute2 commands #1990
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
base: main
Are you sure you want to change the base?
Conversation
@stgraber we currently don't have any tests specifically for this package, if any of the functions are tested then only incidentally. |
a27e9ff
to
687b6a6
Compare
Yeah, it's not the kind of code that's particularly directly testable, it makes more sense to have it be indirectly tested through or normal system tests and the daily test runs we have on Jenkins too. |
Hmh can we generate coverage data from the existing tests to see if they hit all the code paths in this package? |
Hmm, not particularly easily as we typically run our tests across a LOT of |
Hmh I see |
@gwenya yeah, the best we can do is land this one early in the release to maximize the time we have for all our various tests to catch issues. |
cca145f
to
0ef08ac
Compare
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
623d642
to
e2d12a6
Compare
_ = qdisc.Delete() | ||
qdisc = &ip.Qdisc{Dev: veth, Ingress: true} | ||
_ = qdisc.Delete() | ||
qdiscIngress := &ip.QdiscIngress{Qdisc: ip.Qdisc{Dev: veth, Handle: "ffff:0"}} |
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.
@stgraber should I put these kinds of changes into their own commit or leave them together with the corresponding change in the ip package?
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.
it's fine to leave them with the change I think
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
vf = vfInfo // Found a match. | ||
found = true | ||
for _, vf := range link.Attrs().Vfs { | ||
if vf.ID == vfID { |
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 confident about this ID being the number we want.
In the iproute2 code the vf is taken from IFLA_VF_MAC
, and that's where the netlink library puts it when setting it, but this ID
seems to be just the index in the list of vfs returned from the kernel.
I don't have any SR-IOV capable devices to try out if this is the same. If not then we might have to request a change on the netlink library to expose the correct value.
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.
You may want to request access to https://discuss.linuxcontainers.org/t/opening-up-the-linux-containers-lab-environment/22588
The lab has quite a few SR-IOV capable systems:
- lantea (dual-port ConnectX-4, single-port Intel 10Gbit)
- asuras (dual-port ConnectX-6)
- entak (dual-port ConnectX-6)
- velona (dual-port ConnectX-6)
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.
Of those at least lantea is known to be correctly configured at the firmware level as it does run SR-IOV daily tests for us.
The vlan link type is blocked on vishvananda/netlink#1078, since the netlink library currently does not support setting the The veth link type is semi-blocked on vishvananda/netlink#1079 since the netlink library currently does not support setting more than peer name and address on veth create, but we could probably work around that by adjusting the other settings after creating it. |
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
…g netlink ourselves (incomplete) Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
…o int Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
Signed-off-by: Gwendolyn <[email protected]>
See #1978
This is still WIP, the PR at this time is mainly for running the CI. Feedback is very welcome though, especially on the non-trivial TODOs.