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 using systemd service.

Signed-off-by: Ivan Kolodyazhny <[email protected]>
  • Loading branch information
e0ne committed Feb 2, 2022
1 parent fb8ced0 commit 226ec73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ contents: |
Description=Configures SRIOV NIC to switchdev mode
# Removal of this file signals firstboot completion
ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json
# This service is used to move a SRIOV NIC to switchdev mode
# This service is used to configure SR-IOV NICs.
Wants=network-pre.target
Before=network-pre.target
Expand Down
20 changes: 10 additions & 10 deletions pkg/plugins/k8s/k8s_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,8 @@ func (p *K8sPlugin) OnNodeStateChange(old, new *sriovnetworkv1.SriovNetworkNodeS
needReboot = false

p.updateTarget.reset()

// TODO add check for enableOvsOffload in OperatorConfig later
// Update services if switchdev required
if !utils.IsSwitchdevModeSpec(new.Spec) {
return
}

// Check services
err = p.servicesStateUpdate()
Expand All @@ -141,6 +138,15 @@ func (p *K8sPlugin) OnNodeStateChange(old, new *sriovnetworkv1.SriovNetworkNodeS
return
}

// Update services if switchdev required
if utils.IsSwitchdevModeSpec(new.Spec) {
err = p.systemServicesStateUpdate()
if err != nil {
glog.Errorf("k8s-plugin OnNodeStateChange(): failed : %v", err)
}
return
}

if p.updateTarget.needUpdate() {
needDrain = true
if p.updateTarget.needReboot() {
Expand Down Expand Up @@ -370,12 +376,6 @@ func (p *K8sPlugin) servicesStateUpdate() error {
return err
}

// Check system services
err = p.systemServicesStateUpdate()
if err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit 226ec73

Please sign in to comment.