Reduce MAC caching timeout when using probed VFs

In order to use RDMA for iSER, storage network is configured
over virtual function, in the Ethernet case.
VFs doesn't have a permanent MAC, so this change comes to reduce
the MAC caching time in order to support a reboot of servers in
the cluster with VFs that changing their MAC (e.g storage targets).

Change-Id: I2effceebf40d94598c9fe0308873064b0592234f
This commit is contained in:
Aviram Bar-Haim 2015-06-18 11:28:39 +03:00
parent 9d0b917517
commit 65b44b6cf5
2 changed files with 17 additions and 1 deletions

View File

@ -19,6 +19,8 @@ source $SCRIPT_DIR/common
readonly SCRIPT_MODE=$1
readonly FALLBACK_NUM_VFS=8
readonly SRIOV_ENABLED_FLAG=1
readonly VF_MAC_CACHING_TIMEOUT=1
readonly VF_MAC_CACHING_TIMEOUT_DEF=300
readonly NEW_KERNEL_PARAM="intel_iommu=on"
readonly GRUB_FILE_CENTOS="/boot/grub/grub.conf"
readonly GRUB_FILE_UBUNTU="/boot/grub/grub.cfg"
@ -66,6 +68,19 @@ function calculate_total_vfs () {
echo ${num_of_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
timeout=$VF_MAC_CACHING_TIMEOUT
else
timeout=$VF_MAC_CACHING_TIMEOUT_DEF
fi
sed -e "/^.*net\.ipv4\.route\.gc_timeout.*$/d" -i /etc/sysctl.conf
echo "net.ipv4.route.gc_timeout=$timeout" >> /etc/sysctl.conf
sysctl -p
}
function set_modprobe_file () {
PROBE_VFS=`get_num_probe_vfs`
MLX4_CORE_FILE="/etc/modprobe.d/mlx4_core.conf"
@ -104,6 +119,7 @@ function set_kernel_params () {
# insert the corrected line on the same line number
sed -i "${line_num}i\ ${new_kernel_line}" ${grub_file}
fi
reduce_mac_caching_timeout
}
function burn_vfs_in_fw () {

View File

@ -5,7 +5,7 @@ name: mellanox-plugin
title: Mellanox Openstack features
# Plugin version
version: 0.2.23
version: 0.2.24
# Description
description: Enable features over Mellanox hardware