Skip to content

Commit

Permalink
Updated netlink dependency version
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Maslennikov <[email protected]>
  • Loading branch information
almaslennikov committed Nov 17, 2021
1 parent 889d422 commit 3414784
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/onsi/gomega v1.9.0
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
github.com/vishvananda/netlink v1.1.1-0.20210518155637-4cb3795f2ccb
github.com/vishvananda/netlink v1.1.1-0.20211101163509-b10eb8fe5cf6
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect
google.golang.org/grpc v1.28.1
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netlink v1.1.1-0.20210518155637-4cb3795f2ccb h1:zjAvI0rxQJQruCr5KOFzryjK5F1GGolyVXy90jYdxUE=
github.com/vishvananda/netlink v1.1.1-0.20210518155637-4cb3795f2ccb/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netlink v1.1.1-0.20211101163509-b10eb8fe5cf6 h1:167a2omrzz+nN9Of6lN/0yOB9itzw+IOioRThNZ30jA=
github.com/vishvananda/netlink v1.1.1-0.20211101163509-b10eb8fe5cf6/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae h1:4hwBBUfQCFe3Cym0ZtKyq7L16eZUtYKs+BaHDN6mAns=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
Expand Down
10 changes: 2 additions & 8 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,16 @@ func GetPfAddr(pciAddr string) (string, error) {
// If device is not VF then it will return its own ifname if exist else empty string
func GetPfName(pciAddr string) (string, error) {
pfEswitchMode, err := GetPfEswitchMode(pciAddr)
if err != nil {
errString := strings.ToLower(fmt.Sprint(err))
if pfEswitchMode == "" {
// If device doesn't support eswitch mode query or doesn't have sriov enabled,
// fall back to the default implementation
if strings.Contains(errString, "no such device") || strings.Contains(errString, "operation not supported") {
if err == nil || strings.Contains(strings.ToLower(fmt.Sprint(err)), "no such device") {
glog.Infof("Devlink query for eswitch mode is not supported for device %s. %v", pciAddr, err)
} else {
return "", err
}
}

if pfEswitchMode == "" {
glog.Warningf("Failed to retrieve eswitch mode with devlink query for device %s", pciAddr)
} else if pfEswitchMode == eswitchModeSwitchdev {
name, err := GetSriovnetProvider().GetUplinkRepresentor(pciAddr)

if err != nil {
return "", err
}
Expand Down

0 comments on commit 3414784

Please sign in to comment.