Skip to content

Commit

Permalink
Merge remote-tracking branch 'ykulazhenkov/pr-turn-on-switchdev' into…
Browse files Browse the repository at this point in the history
… downstream-pr-turn-on-switchdev
  • Loading branch information
zeeke committed Mar 20, 2024
2 parents e7d8ae5 + e0bfa73 commit b38aaca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/host/internal/sriov/sriov.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ func (s *sriov) configureHWOptionsForSwitchdev(iface *sriovnetworkv1.Interface)
desiredFlowSteeringMode := "smfs"
currentFlowSteeringMode, err := s.networkHelper.GetDevlinkDeviceParam(iface.PciAddress, "flow_steering_mode")
if err != nil {
if errors.Is(err, syscall.EINVAL) {
log.Log.V(2).Info("configureHWOptionsForSwitchdev(): software flow steering is not supported by the device, skip configuration",
if errors.Is(err, syscall.EINVAL) || errors.Is(err, syscall.ENODEV) {
log.Log.V(2).Info("configureHWOptionsForSwitchdev(): device has no flow_steering_mode parameter, skip",
"device", iface.PciAddress)
return nil
}
Expand All @@ -369,6 +369,10 @@ func (s *sriov) configureHWOptionsForSwitchdev(iface *sriovnetworkv1.Interface)
s.setEswitchModeAndNumVFs(iface.PciAddress, sriovnetworkv1.ESwithModeLegacy, 0)
}
if err := s.networkHelper.SetDevlinkDeviceParam(iface.PciAddress, "flow_steering_mode", desiredFlowSteeringMode); err != nil {
if errors.Is(err, syscall.ENOTSUP) {
log.Log.V(2).Info("configureHWOptionsForSwitchdev(): device doesn't support changing of flow_steering_mode, skip", "device", iface.PciAddress)
return nil
}
log.Log.Error(err, "configureHWOptionsForSwitchdev(): fail to configure flow steering mode for the device", "device", iface.PciAddress)
return err
}
Expand Down

0 comments on commit b38aaca

Please sign in to comment.