Skip to content

Commit

Permalink
Fix BlueField2 SR-IOV configuration
Browse files Browse the repository at this point in the history
This patch fixes current behaviour for BF2 NICs to configure
SR-IOV VFs in vanilla Kubernetes cluster.

PR #201 broke BF2 NICs configration in Kubernetes. It assumes
that BF2 will be configured via systemd service in OpenShift
using MachineConfigPool object.

Signed-off-by: Ivan Kolodyazhny <[email protected]>
  • Loading branch information
e0ne committed Feb 9, 2022
1 parent fb8ced0 commit dd85271
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,16 @@ func SyncNodeState(newState *sriovnetworkv1.SriovNetworkNodeState) error {

// skip config VF for switchdev mode or BF-2 NICs
func SkipConfigVf(ifSpec sriovnetworkv1.Interface, ifStatus sriovnetworkv1.InterfaceExt) bool {
if ifSpec.EswitchMode == sriovnetworkv1.ESWITCHMODE_SWITCHDEV {
glog.V(2).Infof("SkipConfigVf(): skip config VF for switchdev device")
return true
}
// Nvidia_mlx5_MT42822_BlueField-2_integrated_ConnectX-6_Dx
if ifStatus.Vendor == VendorMellanox && ifStatus.DeviceID == DeviceBF2 {
glog.V(2).Infof("SkipConfigVf(): skip config VF for BF2 device")
return true
if ClusterType == ClusterTypeOpenshift {
if ifSpec.EswitchMode == sriovnetworkv1.ESWITCHMODE_SWITCHDEV {
glog.V(2).Infof("SkipConfigVf(): skip config VF for switchdev device")
return true
}
// Nvidia_mlx5_MT42822_BlueField-2_integrated_ConnectX-6_Dx
if ifStatus.Vendor == VendorMellanox && ifStatus.DeviceID == DeviceBF2 {
glog.V(2).Infof("SkipConfigVf(): skip config VF for BF2 device")
return true
}
}
return false
}
Expand Down

0 comments on commit dd85271

Please sign in to comment.