From 65b44b6cf55838f8f8e137794d11fa90259bd088 Mon Sep 17 00:00:00 2001 From: Aviram Bar-Haim Date: Thu, 18 Jun 2015 11:28:39 +0300 Subject: [PATCH] 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 --- deployment_scripts/sriov.sh | 16 ++++++++++++++++ metadata.yaml | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/deployment_scripts/sriov.sh b/deployment_scripts/sriov.sh index a6d94ed..bfe0432 100755 --- a/deployment_scripts/sriov.sh +++ b/deployment_scripts/sriov.sh @@ -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 () { diff --git a/metadata.yaml b/metadata.yaml index ae49fae..6ec2878 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -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