-
Notifications
You must be signed in to change notification settings - Fork 179
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 vDPA support #306
Add vDPA support #306
Conversation
Still in WIP state because I'd like to post a PR on the SRIOV-CNI with some code that is needed to test the E2E solution. One specific design decision that I'm not 100% sure about the selector value, current state is:
We could use vdpaDriver: ["vhost_vdpa" , "virtio_vdpa"]. I finally went with the former in the hope of:
The not so good side of this is: we have to add some vdpaType to vdpaDriver boilerplate code here and there WDYT? |
Works in combination with k8snetworkplumbingwg/sriov-cni#163 |
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 minor cosmetic comments, otherwise loks good to me.
Thanks,
Maxime
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.
@amorenoz just to understand the scope, this vDPA support is for SR-IOV + vDPA, it will/can not be used for SF/ADI vDPA, correct?
069d2ac
to
581c03c
Compare
Correct, this PR implements SR-IOV + vDPA SF/ADI is a different story: will it even be supported by DevicePlugin? |
Haven't discussed this, my understanding is perhaps not. |
/cc @martinkennelly |
That is one strange CI error. Has anyone seen this before?
|
581c03c
to
5a58d13
Compare
I think @martinkennelly mentioned this in last resource mgmt meeting, he might be working on the fix (to update ghw lib). |
Couldn't reproduce consistently locally so doesn't seem like ghw issue. I was hoping it was transient error so gave up. @adrianchiris suggested upgrading to bionic (18.04) VM. Ill post a test PR with updated travis file to see if it fixes it. I looked at the Ghw code and it seems to fetch pci-ids file in gzip format from a network location if it cannot find pci ids file locally: https://github.com/jaypipes/pcidb/blob/98ef3ee36c69f20650fe7855047ad042338c6983/discover.go#L36 referenced by const PCIIDS_URI. If this fails, you'd see the error shown by @amorenoz |
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.
some comments on the first two commits
Hi folks! Hey, please check out this PR from @pearsonk in the pcidb library that addresses systems that store the PCIIDS file in gzip-format: I plan to merge that today along with some other PRs from @martinkennelly and cut a new release for pcidb and the upstream ghw project today. Best, |
/cc @fromanirh you might be interested in this repo/PR as well |
5a58d13
to
d2889e2
Compare
d287384
to
b17bc28
Compare
b17bc28
to
8b1c583
Compare
8b1c583
to
f3681b5
Compare
f3681b5
to
bf92414
Compare
7085a49
to
87bf902
Compare
Updated to pull govdpa from NPWG organization |
@adrianchiris , do you have any further comments on this PR? |
87bf902
to
5a1ce79
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.
/lgtm
Few minor things in the documentation.
5a1ce79
to
e86c05f
Compare
Thanks @Billy99 |
@adrianchiris if you want to try this PR, I've tested it with linux v5.14. |
@amorenoz planning to look at it today, sorry for the delay |
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 it Adrian !
overall i think it looks good, added some comments
e86c05f
to
e48b4e4
Compare
@adrianchiris at your convenience, PTAL |
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.
a couple of nits but otherwise LGTM.
Thank you for your patience Adrian !
pkg/types/types.go
Outdated
|
||
// VdpaDevice is an interface to access vDPA device information | ||
type VdpaDevice interface { | ||
GetDriver() string |
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.
GetDriver() is currently not being used by sriov-network-device-plugin. i think we can remove it for now WDYT ?
when filling device information i see that the VDPA type is used as driver:
in netResourcePool.go
L#88
Driver: string(vdpaDev.GetType()),
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.
Right, I'll remove it from the interface
@@ -159,6 +171,8 @@ type DeviceProvider interface { | |||
GetDevices(*ResourceConfig) []PciDevice | |||
|
|||
GetFilteredDevices([]PciDevice, *ResourceConfig) ([]PciDevice, error) | |||
|
|||
ValidConfig(*ResourceConfig) bool |
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.
nit: could you add a docstring to this interface method ?
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.
was not addressed, however will not block on it. it can be addressed as followup.
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.
Sorry, I added it to the implementations in netDeviceProvider
and accelDeviceProvider
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.
Now added it to the interface method
Low level vdpa management is performed on github.com/k8snetworkplumbingwg/govdpa Two new types are introduced: - VdpaDevice is an interface to expose vDPA device information. - VdpaType is used to define the types of supported vdpa devices to use It can have two values: "vhost" or "virtio". Signed-off-by: Adrian Moreno <[email protected]>
The vdpaInfoProvider determines device information (as required by the API) from a vdpa device. Signed-off-by: Adrian Moreno <[email protected]>
If a vdpaType is given, select the appropriate infoProvider Also, filter devices based on the vdpaType configured Signed-off-by: Adrian Moreno <[email protected]>
e48b4e4
to
4219f1c
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.
LGTM !
Add a config validation function to the DeviceProvider API so each one of them can do DeviceType-specific config validation. Specifically, the netDevice config validation checks that both IsRdma and VdpaType are not configured simultaneously. Doing this at the manager level makes the rest of the code cleaner. Signed-off-by: Adrian Moreno <[email protected]>
Signed-off-by: Adrian Moreno <[email protected]>
Signed-off-by: Adrian Moreno <[email protected]>
Signed-off-by: Adrian Moreno <[email protected]>
4219f1c
to
d51e6a1
Compare
@zshi-redhat @SchSeba PTAL Its been a long ride with this PR :) |
/cc @bn222 |
@zshi-redhat do you have any further comments on this PR? |
vDPA devices can be exposed to Pods in two different ways:
If they are bound to the
virtio_vdpa
driver, they are exposed as normal netdevsIf they are bound to the
vhost_vdpa
driver they are exposed as vhost-vdpa devices. These are char devices that support the vhost-vdpa extensions to the vhost uAPIThe implementation of the vDPA support is done by implementing the
DeviceInfoProvider
interface.A new string field is added to the 'NetDeviceSelectors':
vdpaType
. It can optionally have two values:vhost
orvirtio
. This selector is used to determine the way the devices are exposed to the Pods as well as to filter the discovered devices based on their vdpa driver.For the low level vdpa bus handling, we depend on github.com/redhat-virtio-net/govdpa a golang library to interact with the vdpa subsystem.
This PR also adds support for writing the vdpa DeviceInfo file as per the specification.
Fixes: #305