fix dpdk nic name support chart patch
Skip-Release-Notes
Change-Id: I44013750af98f7adbfbf89b5df752015d4f2aa78
diff --git a/charts/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl b/charts/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl
index c15e40a..909622a 100644
--- a/charts/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl
+++ b/charts/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl
@@ -196,6 +196,12 @@
while IFS= read -r nic; do
local port_name=$(get_dpdk_config_value ${nic} '.name')
local pci_id=$(get_dpdk_config_value ${nic} '.pci_id')
+ local iface=$(get_dpdk_config_value ${nic} '.iface')
+ if [ -n ${iface} ] && [ -z ${pci_id} ]; then
+ local pci_id=$(get_address_by_nicname ${iface})
+ else
+ iface=$(get_name_by_pci_id "${pci_id}")
+ fi
local bridge=$(get_dpdk_config_value ${nic} '.bridge')
local vf_index=$(get_dpdk_config_value ${nic} '.vf_index')
@@ -203,8 +209,6 @@
migrate_ip "${pci_id}" "${bridge}"
fi
- iface=$(get_name_by_pci_id "${pci_id}")
-
if [ -n "${iface}" ]; then
ip link set ${iface} promisc on
if [ -n "${vf_index}" ]; then
@@ -292,6 +296,12 @@
echo $bond | jq -r -c '.nics[]' > /tmp/nics_array
while IFS= read -r nic; do
local pci_id=$(get_dpdk_config_value ${nic} '.pci_id')
+ local iface=$(get_dpdk_config_value ${nic} '.iface')
+ if [ -n ${iface} ] && [ -z ${pci_id} ]; then
+ local pci_id=$(get_address_by_nicname ${iface})
+ else
+ iface=$(get_name_by_pci_id "${pci_id}")
+ fi
local nic_name=$(get_dpdk_config_value ${nic} '.name')
local pmd_rxq_affinity=$(get_dpdk_config_value ${nic} '.pmd_rxq_affinity')
local vf_index=$(get_dpdk_config_value ${nic} '.vf_index')
@@ -302,8 +312,6 @@
ip_migrated=true
fi
- iface=$(get_name_by_pci_id "${pci_id}")
-
if [ -n "${iface}" ]; then
ip link set ${iface} promisc on
if [ -n "${vf_index}" ]; then
@@ -407,6 +415,12 @@
fi
}
+function get_address_by_nicname {
+ if [[ -e /sys/class/net/$1/device ]]; then
+ readlink -f /sys/class/net/$1/device | xargs basename
+ fi
+}
+
function init_ovs_dpdk_bridge {
bridge=$1
ovs-vsctl --db=unix:${OVS_SOCKET} --may-exist add-br ${bridge} \
diff --git a/charts/patches/neutron/0004-nic-name-feature.patch b/charts/patches/neutron/0007-dpdk-nic-name-support.patch
similarity index 87%
rename from charts/patches/neutron/0004-nic-name-feature.patch
rename to charts/patches/neutron/0007-dpdk-nic-name-support.patch
index c2325e7..3fa2963 100644
--- a/charts/patches/neutron/0004-nic-name-feature.patch
+++ b/charts/patches/neutron/0007-dpdk-nic-name-support.patch
@@ -1,7 +1,7 @@
-diff --git a/charts/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl b/charts/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl
+diff --git a/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl b/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl
index bd0a64a..08833a5 100644
---- a/charts/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl
-+++ b/charts/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl
+--- a/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl
++++ b/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl
@@ -196,6 +196,12 @@ function process_dpdk_nics {
while IFS= read -r nic; do
local port_name=$(get_dpdk_config_value ${nic} '.name')