From 26682ea78a9bcd525a97df2bb507e2edc9380682 Mon Sep 17 00:00:00 2001 From: Charlie Kang Date: Tue, 19 Sep 2017 08:28:50 -0700 Subject: [PATCH] ovs-dpdkctl.sh function list_dpdk_nics only grabs the first nic Adding translate, new line in for loop /etc/default/ovs-dpdkctl.conf Removed '' around pci_whitelist args for DPDK. When multiple entries present vswitchd does not start. Closes-bug: #1718240 Change-Id: I8196d56fe78e9ec1a0504059b98bcb9d1ee33f76 --- tools/ovs-dpdkctl.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tools/ovs-dpdkctl.sh b/tools/ovs-dpdkctl.sh index 6b6e3bfd5b..c581b1ec0a 100755 --- a/tools/ovs-dpdkctl.sh +++ b/tools/ovs-dpdkctl.sh @@ -94,8 +94,7 @@ function gen_config { for nic in $(list_dpdk_nics); do set_value $nic driver ${dpdk_interface_driver:-"uio_pci_generic"} done - set_value ovs pci_whitelist "'${pci_whitelist:-$(generate_pciwhitelist)}'" - + set_value ovs pci_whitelist "${pci_whitelist:-$(generate_pciwhitelist)}" } function bind_nic { @@ -106,11 +105,10 @@ function bind_nic { function unbind_nic { echo $1 > /sys/bus/pci/drivers/$2/unbind echo > /sys/bus/pci/devices/$1/driver_override - } function list_dpdk_nics { - for nic in $(crudini --get $CONFIG_FILE ovs port_mappings | cut -d : -f 1); do + for nic in $(get_value ovs port_mappings | tr ',' '\n' | cut -d : -f 1); do echo $nic; done } @@ -152,7 +150,7 @@ function get_driver_by_address { } function get_port_bridge { - for pair in $(get_value ovs port_mappings); do + for pair in $(get_value ovs port_mappings | tr ',' '\n'); do nic=`echo $pair | cut -f 1 -d ":"` if [[ "$nic" == "$1" ]]; then bridge=`echo $pair | cut -f 2 -d ":"` @@ -209,7 +207,6 @@ function init_ovs_interfaces { dpdk_port_number=$((dpdk_port_number+1)) done - } function init { @@ -381,7 +378,6 @@ function uninstall { if [ -e "$CONFIG_FILE" ]; then rm -f "$CONFIG_FILE" fi - } function usage {