Skip to content

Commit

Permalink
Updated dependency to govdpa v0.1.4
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Milleri <lmilleri@redhat.com>
  • Loading branch information
lmilleri committed Nov 4, 2022
1 parent 8897972 commit ee08251
Show file tree
Hide file tree
Showing 11 changed files with 773 additions and 250 deletions.
2 changes: 1 addition & 1 deletion go-controller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/google/uuid v1.2.0
github.com/gorilla/mux v1.8.0
github.com/j-keck/arping v1.0.2
github.com/k8snetworkplumbingwg/govdpa v0.1.3
github.com/k8snetworkplumbingwg/govdpa v0.1.4
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.3.0
github.com/miekg/dns v1.1.31
github.com/mitchellh/copystructure v1.2.0
Expand Down
4 changes: 2 additions & 2 deletions go-controller/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ github.com/juju/utils v0.0.0-20180808125547-9dfc6dbfb02b/go.mod h1:6/KLg8Wz/y2KV
github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/k8snetworkplumbingwg/govdpa v0.1.3 h1:FZRhTMB1e3yWwSEy+l4eS73WioyMaL+vmFZ8JNwn+Uk=
github.com/k8snetworkplumbingwg/govdpa v0.1.3/go.mod h1:Jx2rlMquENdCd8M5Oc51xHCt10bQIXTloDU8F4nS4T4=
github.com/k8snetworkplumbingwg/govdpa v0.1.4 h1:e6mM7JFZkLVJeMQw3px96EigHAhnb4VUlqhNub/2Psk=
github.com/k8snetworkplumbingwg/govdpa v0.1.4/go.mod h1:UQR1xu7A+nnRK1dkLEi12OnNL0OiBPpIKOYDuaQQkck=
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.3.0 h1:MjRRgZyTGo90G+UrwlDQjU+uG4Z7By65qvQxGoILT/8=
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.3.0/go.mod h1:nqCI7aelBJU61wiBeeZWJ6oi4bJy5nrjkM6lWIMA4j0=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down
4 changes: 2 additions & 2 deletions go-controller/pkg/cni/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ func (pr *PodRequest) getVFNetdevName() (string, error) {

// If a vDPA device exists, it takes preference over the vendor device, steering-wize
vdpaDevice, err := util.GetVdpaOps().GetVdpaDeviceByPci(pr.CNIConf.DeviceID)
if err == nil && vdpaDevice.GetDriver() == kvdpa.VirtioVdpaDriver {
return vdpaDevice.GetNetDev(), nil
if err == nil && vdpaDevice.Driver() == kvdpa.VirtioVdpaDriver {
return vdpaDevice.VirtioNet().NetDev(), nil
}

vfNetdevices, err := util.GetSriovnetOps().GetNetDevicesFromPci(pr.CNIConf.DeviceID)
Expand Down
6 changes: 5 additions & 1 deletion go-controller/pkg/util/vdpa_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@ func GetVdpaOps() VdpaOps {
}

func (v *defaultVdpaOps) GetVdpaDeviceByPci(pciAddress string) (kvdpa.VdpaDevice, error) {
return kvdpa.GetVdpaDeviceByPci(pciAddress)
vdpaDevices, err := kvdpa.GetVdpaDevicesByPciAddress(pciAddress)
if len(vdpaDevices) > 0 {
return vdpaDevices[0], nil
}
return nil, err
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ee08251

Please sign in to comment.