From 7320acf36c5b7c21e0ebcc9b04c175add85f3286 Mon Sep 17 00:00:00 2001 From: Aviram Bar-Haim Date: Mon, 29 Feb 2016 17:20:21 +0200 Subject: [PATCH] Set VFs for private network only on compute nodes And inherite driver's log_level configurations from Fuel's log level. Change-Id: Ib07b9b1495bac3b239e2276e9a9a51a1780fec53 --- deployment_scripts/common | 10 +++++++++- deployment_scripts/sriov.sh | 21 ++++++++++++--------- deployment_scripts/vxlan_offloading.sh | 5 ++++- metadata.yaml | 2 +- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/deployment_scripts/common b/deployment_scripts/common index 1ded41c..bdf4d81 100755 --- a/deployment_scripts/common +++ b/deployment_scripts/common @@ -73,11 +73,19 @@ function get_distro () { echo $dist } +function get_param () { + param="$1" + val=$(ruby -r hiera -r yaml -e 'hiera = Hiera.new(:config => '\''/etc/puppet/hiera.yaml'\''); out = hiera.lookup '\'''"$param"''\'', [], {}; puts out') + echo $val +} + readonly DISTRO=`get_distro` readonly DRIVER=`get_mlnx_param driver` readonly SRIOV=`get_mlnx_param sriov` readonly USER_NUM_OF_VFS=`get_mlnx_param num_of_vfs` readonly ISER=`get_mlnx_param iser` -readonly MAX_VFS=64 +readonly MAX_VFS=128 readonly MIN_VFS=1 readonly VXLAN_OFFLOADING=`get_mlnx_param vxlan_offloading` +readonly ROLE=`get_param role` +readonly DEBUG=`get_param debug` diff --git a/deployment_scripts/sriov.sh b/deployment_scripts/sriov.sh index 31bc21c..9dddf41 100755 --- a/deployment_scripts/sriov.sh +++ b/deployment_scripts/sriov.sh @@ -35,10 +35,8 @@ function get_port_type() { } function get_num_probe_vfs () { - if [ $SRIOV == true ] && [ $DRIVER == 'mlx4_en' ]; then + if [ $DRIVER == 'mlx4_en' ]; then probe_vfs=`calculate_total_vfs` - elif [ $ISER == true ] && [ $DRIVER == 'mlx4_en' ]; then - probe_vfs=1 else probe_vfs=0 fi @@ -55,14 +53,17 @@ function calculate_total_vfs () { return 1 fi num_of_vfs=0 + # SR-IOV is enabled, the given number of VFs is used # iSER is also enabled, the iSER VF is among the given SR-IOV VFs - if [ $SRIOV == true ]; then + if [ $SRIOV == true ] && [ $ROLE == compute ]; then num_of_vfs=${USER_NUM_OF_VFS} + # SR-IOV is disabled with iSER enabled, then use only the storage VF - elif [ $ISER == true ]; then - num_of_vfs=`get_num_probe_vfs` + elif [ $ISER == true ] && [ $DRIVER == 'mlx4_en' ]; then + num_of_vfs=1 fi + # Enforce even num of vfs if [ $((${num_of_vfs} % 2)) -eq 1 ]; then let num_of_vfs="${num_of_vfs} + 1" # number of vfs is odd and <= 64, then +1 is legal @@ -73,7 +74,7 @@ function calculate_total_vfs () { # Reduce mac caching time since VF is used for iSER with non permanent MAC function reduce_mac_caching_timeout () { probes=`get_num_probe_vfs` - if [ "$probes" == "1" ]; then + if [ $probes -ge 1 ]; then timeout=$VF_MAC_CACHING_TIMEOUT else timeout=$VF_MAC_CACHING_TIMEOUT_DEF @@ -91,8 +92,10 @@ function set_modprobe_file () { MLX4_CORE_FILE="/etc/modprobe.d/mlx4_core.conf" PORT_TYPE=`get_port_type` MLX4_CORE_STR="options mlx4_core - enable_64b_cqe_eqe=0 - debug_level=1" + enable_64b_cqe_eqe=0" + if [[ $DEBUG == "true" ]];then + MLX4_CORE_STR="${MLX4_CORE_STR} debug_level=1" + fi TOTAL_VFS=$1 MLX4_CORE_STR="${MLX4_CORE_STR} port_type_array=${PORT_TYPE},${PORT_TYPE}" diff --git a/deployment_scripts/vxlan_offloading.sh b/deployment_scripts/vxlan_offloading.sh index fabd376..5b5b546 100755 --- a/deployment_scripts/vxlan_offloading.sh +++ b/deployment_scripts/vxlan_offloading.sh @@ -56,8 +56,11 @@ function set_modprobe_file () { MLX4_CORE_STR="options mlx4_core enable_64b_cqe_eqe=0 log_num_mgm_entry_size=-1 - debug_level=1 port_type_array=${PORT_TYPE},${PORT_TYPE}" + if [[ $DEBUG == "true" ]];then + MLX4_CORE_STR="${MLX4_CORE_STR} debug_level=1" + fi + echo ${MLX4_CORE_STR} > ${MLX4_CORE_FILE} } diff --git a/metadata.yaml b/metadata.yaml index b852817..03805d3 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -5,7 +5,7 @@ name: mellanox-plugin title: Mellanox Openstack features # Plugin version -version: 2.0.28 +version: 2.0.29 # Description description: Enable features over Mellanox hardware