-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix detection of Mellanox VFs in switchdev mode
Signed-off-by: Alexander Maslennikov <[email protected]>
- Loading branch information
1 parent
5f451ba
commit 72f5883
Showing
6 changed files
with
84 additions
and
1 deletion.
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
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,29 @@ | ||
package utils | ||
|
||
import ( | ||
"github.com/Mellanox/sriovnet" | ||
) | ||
|
||
// SriovnetOps is a wrapper type over sriovnet library | ||
type SriovnetOps interface { | ||
GetUplinkRepresentor(vfPciAddress string) (string, error) | ||
} | ||
|
||
type defaultSriovnetOps struct { | ||
} | ||
|
||
var sriovnetOps SriovnetOps = &defaultSriovnetOps{} | ||
|
||
// SetSriovnetOpsInst method would be used by unit tests in other packages | ||
func SetSriovnetOpsInst(mockInst SriovnetOps) { | ||
sriovnetOps = mockInst | ||
} | ||
|
||
// GetSriovnetOps will be invoked by functions in other packages that would need access to the sriovnet library methods. | ||
func GetSriovnetOps() SriovnetOps { | ||
return sriovnetOps | ||
} | ||
|
||
func (defaultSriovnetOps) GetUplinkRepresentor(vfPciAddress string) (string, error) { | ||
return sriovnet.GetUplinkRepresentor(vfPciAddress) | ||
} |
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