diff --git a/lib/puppet/provider/sriov_vf_config/numvfs.rb b/lib/puppet/provider/sriov_vf_config/numvfs.rb index 291289619..fd3899737 100644 --- a/lib/puppet/provider/sriov_vf_config/numvfs.rb +++ b/lib/puppet/provider/sriov_vf_config/numvfs.rb @@ -57,6 +57,9 @@ Puppet::Type.type(:sriov_vf_config).provide(:numvfs) do # Changing the mode of sriov interface to switchdev mode %x{devlink dev eswitch set pci/#{get_interface_pci} mode switchdev} %x{ethtool -K #{sriov_get_interface} hw-tc-offload on} + if get_interface_device == "0x1013" || get_interface_device == "0x1015" + %x{devlink dev eswitch set pci/#{get_interface_pci} inline-mode transport} + end if cur_value == "0x15b3" # Binding virtual functions vfs_pcis.each do|vfs_pci| @@ -98,4 +101,7 @@ Puppet::Type.type(:sriov_vf_config).provide(:numvfs) do %x{ethtool -i #{sriov_get_interface} | grep bus-info | awk {'print$2'}}.strip end + def get_interface_device + %x{cat /sys/class/net/#{sriov_get_interface}/device/device}.strip + end end diff --git a/spec/defines/tripleo_host_sriov_numvfs_persistence_spec.rb b/spec/defines/tripleo_host_sriov_numvfs_persistence_spec.rb index 78c808a0f..876c4084c 100644 --- a/spec/defines/tripleo_host_sriov_numvfs_persistence_spec.rb +++ b/spec/defines/tripleo_host_sriov_numvfs_persistence_spec.rb @@ -80,6 +80,11 @@ then fi interface_pci=`ethtool -i eth0 | grep bus-info | awk {'print\$2'}` devlink dev eswitch set pci/\$interface_pci mode switchdev + interface_device=`cat /sys/class/net/eth0/device/device` + if [ $interface_device == \"0x1013\" ] || [ $interface_device == \"0x1015\" ] + then + devlink dev eswitch set pci/$interface_pci inline-mode transport + fi ethtool -K eth0 hw-tc-offload on if [ `cat /sys/class/net/eth0/device/vendor` == \"0x15b3\" ] then diff --git a/templates/switchdev/switchdev.epp b/templates/switchdev/switchdev.epp index 2e32a9ae5..7ada47db5 100644 --- a/templates/switchdev/switchdev.epp +++ b/templates/switchdev/switchdev.epp @@ -11,6 +11,11 @@ then fi interface_pci=`ethtool -i <%=$interface%> | grep bus-info | awk {'print$2'}` devlink dev eswitch set pci/$interface_pci mode switchdev + interface_device=`cat /sys/class/net/<%=$interface%>/device/device` + if [ $interface_device == "0x1013" ] || [ $interface_device == "0x1015" ] + then + devlink dev eswitch set pci/$interface_pci inline-mode transport + fi ethtool -K <%=$interface%> hw-tc-offload on if [ `cat /sys/class/net/<%=$interface%>/device/vendor` == "0x15b3" ] then