Make sure trust on command is applied to avoid race-condition with ovs-dpdk

When i40e driver performs 'vf <n> trust on' it actually resets the device.
Intel recommends to check if the command actually finished by running
'ip link show' to avoid race-condition with too early start of
openvswitch-dpdk which will use its own dpdk-based driver for VF and which
will also try to reset the VF. Double reset of VF sometimes causes
very strange behavior including completely non-functional VF interface..

Change-Id: I28c162a63f89b3cdfe857e00651572bbbaa36748
This commit is contained in:
Alexey Odinokov 2024-02-14 22:35:41 -06:00 committed by Alexey
parent 17ca3983c2
commit 552cab2ff1
3 changed files with 23 additions and 1 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Neutron
name: neutron
version: 0.3.32
version: 0.3.33
home: https://docs.openstack.org/neutron/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png
sources:

View File

@ -174,6 +174,21 @@ function bind_dpdk_nic {
fi
}
function ensure_vf_state {
iface=${1}
vf_string=${2}
check_string=${3}
expected=${4}
# wait for the vf really get the needed state
for i in 0 1 2 4 8 16 32; do
sleep ${i};
if [ "$(ip link show ${iface} | grep "${vf_string} " | grep -Eo "${check_string}")" == "${expected}" ]; then
break;
fi;
done
}
function process_dpdk_nics {
target_driver=$(get_dpdk_config_value ${DPDK_CONFIG} '.driver')
# loop over all nics
@ -195,11 +210,14 @@ function process_dpdk_nics {
if [ -n "${vf_index}" ]; then
vf_string="vf ${vf_index}"
ip link set ${iface} ${vf_string} trust on
ensure_vf_state "${iface}" "${vf_string}" "trust o(n|ff)" "trust on"
# NOTE: To ensure proper toggle of spoofchk,
# turn it on then off.
ip link set ${iface} ${vf_string} spoofchk on
ensure_vf_state "${iface}" "${vf_string}" "spoof checking o(n|ff)" "spoof checking on"
ip link set ${iface} ${vf_string} spoofchk off
ensure_vf_state "${iface}" "${vf_string}" "spoof checking o(n|ff)" "spoof checking off"
fi
fi
@ -291,11 +309,14 @@ function process_dpdk_bonds {
if [ -n "${vf_index}" ]; then
vf_string="vf ${vf_index}"
ip link set ${iface} ${vf_string} trust on
ensure_vf_state "${iface}" "${vf_string}" "trust o(n|ff)" "trust on"
# NOTE: To ensure proper toggle of spoofchk,
# turn it on then off.
ip link set ${iface} ${vf_string} spoofchk on
ensure_vf_state "${iface}" "${vf_string}" "spoof checking o(n|ff)" "spoof checking on"
ip link set ${iface} ${vf_string} spoofchk off
ensure_vf_state "${iface}" "${vf_string}" "spoof checking o(n|ff)" "spoof checking off"
fi
fi

View File

@ -74,4 +74,5 @@ neutron:
- 0.3.30 Fix designate auth url
- 0.3.31 FIX ovn-metadata-agent mountPropagation overrides by parent directory
- 0.3.32 Update dpdk override
- 0.3.33 Make sure trust on command is applied to avoid race-condition with ovs-dpdk
...