Update neutron ovs agent for ovs-dpdk

This ps update neutron ovs agent to support properly:
- setting mtu on dpdk bond and nic interface port
- setting vhost-iommu-support on dpdk bond and nic interface port
- setting n_txq values on dpdk bond and nic interface port

Change-Id: I422fa21a622642ecb7c49914fef04073e4f984bc
This commit is contained in:
Roy Tang 2019-12-10 11:03:10 -06:00
parent 52c132b935
commit 97ac0575ba
2 changed files with 25 additions and 2 deletions

View File

@ -206,13 +206,17 @@ function process_dpdk_nics {
if [ -n "${n_rxq}" ]; then
dpdk_options+='options:n_rxq=${n_rxq} '
fi
n_txq=$(get_dpdk_config_value ${nic} '.n_txq')
if [ -n "${n_txq}" ]; then
dpdk_options+='options:n_txq=${n_txq} '
fi
pmd_rxq_affinity=$(get_dpdk_config_value ${nic} '.pmd_rxq_affinity')
if [ -n "${pmd_rxq_affinity}" ]; then
dpdk_options+='other_config:pmd-rxq-affinity=${pmd_rxq_affinity} '
fi
mtu=$(get_dpdk_config_value ${nic} '.mtu')
if [ -n "${mtu}" ]; then
dpdk_options+='mtu_request=${mtu} '
dpdk_options+='options:mtu_request=${mtu} '
fi
n_rxq_size=$(get_dpdk_config_value ${nic} '.n_rxq_size')
if [ -n "${n_rxq_size}" ]; then
@ -222,6 +226,10 @@ function process_dpdk_nics {
if [ -n "${n_txq_size}" ]; then
dpdk_options+='options:n_txq_desc=${n_txq_size} '
fi
vhost_iommu_support=$(get_dpdk_config_value ${nic} '.vhost-iommu-support')
if [ -n "${vhost_iommu_support}" ]; then
dpdk_options+='options:vhost-iommu-support=${vhost_iommu_support} '
fi
ovs-vsctl --db=unix:${OVS_SOCKET} --may-exist add-port ${bridge} ${port_name} \
-- set Interface ${port_name} type=dpdk options:dpdk-devargs=${pci_id} ${dpdk_options}
@ -239,9 +247,11 @@ function process_dpdk_bonds {
local migrate_ip=$(get_dpdk_config_value ${bond} '.migrate_ip')
local mtu=$(get_dpdk_config_value ${bond} '.mtu')
local n_rxq=$(get_dpdk_config_value ${bond} '.n_rxq')
local n_txq=$(get_dpdk_config_value ${bond} '.n_txq')
local ofport_request=$(get_dpdk_config_value ${bond} '.ofport_request')
local n_rxq_size=$(get_dpdk_config_value ${bond} '.n_rxq_size')
local n_txq_size=$(get_dpdk_config_value ${bond} '.n_txq_size')
local vhost_iommu_support=$(get_dpdk_config_value ${bond} '.vhost-iommu-support')
local ovs_options=$(get_dpdk_config_value ${bond} '.ovs_options')
local nic_name_str=""
@ -283,13 +293,17 @@ function process_dpdk_bonds {
dev_args_str+=" -- set Interface "${nic_name}" type=dpdk options:dpdk-devargs=""${dpdk_pci_id}"
if [[ -n ${mtu} ]]; then
dev_args_str+=" -- set Interface "${nic_name}" mtu_request=${mtu}"
dev_args_str+=" -- set Interface "${nic_name}" options:mtu_request=${mtu}"
fi
if [[ -n ${n_rxq} ]]; then
dev_args_str+=" -- set Interface "${nic_name}" options:n_rxq=${n_rxq}"
fi
if [[ -n ${n_txq} ]]; then
dev_args_str+=" -- set Interface "${nic_name}" options:n_txq=${n_txq}"
fi
if [[ -n ${ofport_request} ]]; then
dev_args_str+=" -- set Interface "${nic_name}" ofport_request=${ofport_request}"
fi
@ -305,6 +319,10 @@ function process_dpdk_bonds {
if [[ -n ${n_txq_size} ]]; then
dev_args_str+=" -- set Interface "${nic_name}" options:n_txq_desc=${n_txq_size}"
fi
if [[ -n ${vhost_iommu_support} ]]; then
dev_args_str+=" -- set Interface "${nic_name}" options:vhost-iommu-support=${vhost_iommu_support}"
fi
done < /tmp/nics_array
ovs-vsctl --db=unix:${OVS_SOCKET} --if-exists del-port "${bond_name}"

View File

@ -2011,6 +2011,7 @@ conf:
bridge: br-phy
migrate_ip: true
n_rxq: 2
n_txq: 2
pmd_rxq_affinity: "0:3,1:27"
ofport_request: 1
# optional parameters for tuning the OVS DPDK config
@ -2018,6 +2019,7 @@ conf:
# mtu: 2000
# n_rxq_size: 1024
# n_txq_size: 1024
# vhost-iommu-support: true
bridges:
- name: br-phy
# Optional parameter for configuring bonding in OVS-DPDK
@ -2032,10 +2034,13 @@ conf:
# # rather than denoting the total number of rx queues for
# # the bond as a whole. So setting n_rxq = 2 below for ex.
# # would be 4 rx queues in total for the bond.
# # Same for n_txq
# n_rxq: 2
# n_txq: 2
# ofport_request: 1
# n_rxq_size: 1024
# n_txq_size: 1024
# vhost-iommu-support: true
# ovs_options: "bond_mode=active-backup"
# nics:
# - name: dpdk_b0s0