-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to sriov-based virtio-vdpa devices. When a sr-iov device has a vdpa device created, and it is bound to virtio_vdpa driver, use the associated virtio-net device instead of the vendor one. In order to determine whether a device is vdpa or not as well as its device path, use external library github.com/k8snetworkplumbingwg/govdpa Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
- Loading branch information
Showing
9 changed files
with
590 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package util | ||
|
||
import ( | ||
"github.com/k8snetworkplumbingwg/govdpa/pkg/kvdpa" | ||
) | ||
|
||
type VdpaDevice interface { | ||
kvdpa.VdpaDevice | ||
} | ||
|
||
type VdpaOps interface { | ||
GetVdpaDeviceByPci(pciAddress string) (kvdpa.VdpaDevice, error) | ||
} | ||
|
||
type defaultVdpaOps struct { | ||
} | ||
|
||
var vdpaOps VdpaOps = &defaultVdpaOps{} | ||
|
||
// SetVdpaOpsInst method should be used by unit tests in | ||
func SetVdpaOpsInst(mockInst VdpaOps) { | ||
vdpaOps = mockInst | ||
} | ||
|
||
// GetVdpaOps will be invoked by functions in other packages that would need access to the govdpa library methods. | ||
func GetVdpaOps() VdpaOps { | ||
return vdpaOps | ||
} | ||
|
||
func (v *defaultVdpaOps) GetVdpaDeviceByPci(pciAddress string) (kvdpa.VdpaDevice, error) { | ||
return kvdpa.GetVdpaDeviceByPci(pciAddress) | ||
} |
201 changes: 201 additions & 0 deletions
201
go-controller/vendor/github.com/k8snetworkplumbingwg/govdpa/LICENSE
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.