Merge "Set VFs for private network only on compute nodes"
This commit is contained in:
commit
6f4f3beef5
|
@ -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`
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -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}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue