Merge "Allow neutron sriov agent to set num_queues per vf"

This commit is contained in:
Zuul 2020-06-02 15:18:25 +00:00 committed by Gerrit Code Review
commit 08e652a06f
2 changed files with 33 additions and 3 deletions

View File

@ -17,8 +17,10 @@ limitations under the License.
#NOTE: Please limit "besteffort" to dev env with mixed hardware computes only
# For prod env, the target nic should be there, if not, script should error out.
set -ex
BESTEFFORT=false
{{- if ( has "besteffort" .Values.conf.sriov_init ) }}
set +e
BESTEFFORT=true
{{- end }}
{{- range $k, $sriov := .Values.network.interface.sriov }}
@ -48,6 +50,31 @@ echo "{{ $qos.share }}" > /sys/class/net/{{ $sriov.device }}/device/sriov/{{ $qo
echo "1" > /sys/class/net/{{ $sriov.device }}/device/sriov/qos/apply
{{- end }}
# Set number of queues is best effort in case where VF is already binded,
# NIC will not allow to set, in such case, a node reboot will allow all
# VF to set properly.
{{- if hasKey $sriov "queues_per_vf" }}
set +e
{{- range $v, $qvf := $sriov.queues_per_vf }}
SMOKE=','
MIRROR=' '
SKIPLIST={{ $qvf.exclude_vf }}
SKIPLIST=${SKIPLIST//$SMOKE/$MIRROR}
NUMVF={{ $sriov.num_vfs }}
for vf in `seq 0 $[$NUMVF - 1]`
do
if ! ( echo ${SKIPLIST[@]} | grep -q -w "$vf" ); then
echo "{{ $qvf.num_queues }}" > /sys/class/net/{{ $sriov.device }}/device/sriov/$vf/num_queues
fi
done
{{- end }}
if ! $BESTEFFORT; then
set -e
fi
{{- end }}
{{- if $sriov.mtu }}
ip link set dev {{ $sriov.device }} mtu {{ $sriov.mtu }}
{{- end }}
@ -76,6 +103,6 @@ host = $(hostname --fqdn)
EOF
{{- end }}
{{- if ( has "besteffort" .Values.conf.sriov_init ) }}
exit 0
{{ end }}
if $BESTEFFORT; then
exit 0
fi

View File

@ -121,6 +121,9 @@ network:
# qos:
# - vf_num: 0
# share: 10
# queues_per_vf:
# - num_queues: 16
# exclude_vf: 0,11,21
server:
ingress:
public: true