From 4c5aa0e4c6ca4d537aa66b2c07eeee1c360a906d Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 14 Aug 2018 21:46:00 +0200 Subject: Fix reloading, add bonding sample --- bonding.sh | 27 +++++++++++++++++++++++++++ ip/functions.sh | 22 ++++++++++++++++++++++ mlxreload.sh | 6 ++++++ 3 files changed, 55 insertions(+) create mode 100755 bonding.sh create mode 100755 mlxreload.sh diff --git a/bonding.sh b/bonding.sh new file mode 100755 index 0000000..cf2f152 --- /dev/null +++ b/bonding.sh @@ -0,0 +1,27 @@ +#! /bin/bash + +. ip/functions.sh + + +# Modes for balancing input traffic. +# balance-alb: Does not require switch configuration, but not supported by libvma +# 802.3ad: Requires switch configuration, but supported by libvma + + +modprobe bonding +ip link delete bond0 +ip link add bond0 type bond +ip link set bond0 type bond miimon 100 mode balance-alb +#ip link set bond0 type bond miimon 100 mode 802.3ad + +ip addr flush enp5s0d1 +ip link set enp5s0d1 down +ip link set enp5s0d1 master bond0 +ip addr flush enp10s0d1 +ip link set enp10s0d1 down +ip link set enp10s0d1 master bond0 + +ip link set bond0 up +ipset bond0 192.168.2.86 +ip link set enp5s0d1 up +ip link set enp10s0d1 up diff --git a/ip/functions.sh b/ip/functions.sh index 3f45f63..f912a6e 100644 --- a/ip/functions.sh +++ b/ip/functions.sh @@ -1,3 +1,23 @@ +function mlxreload { + rmmod ib_ucm + rmmod rdma_ucm + rmmod ib_uverbs + modprobe ib_uverbs disable_raw_qp_enforcement=1 + modprobe ib_ucm + modprobe rdma_ucm + modprobe mlx4_core fast_drop=1 log_num_mgm_entry_size=-1 + modprobe mlx4_en +} + +function mlxload { + reload=0 + + param=$(cat /sys/module/mlx4_core/parameters/log_num_mgm_entry_size) + [ $param -ne -1 ] && reload=1 + + [ $reload -eq 1 ] && mlxreload +} + function portset { pci=$1 mode=$2 @@ -7,6 +27,8 @@ function portset { function mlxconf { mode=$1 + mlxload + pci=$(./connectx_port_config -s | grep PCI | grep -Po "[\da-f]{4}:[\da-f]{2}:[\da-f]{2}\.[\da-f]") for dev in $pci; do echo "Configuring: $dev" diff --git a/mlxreload.sh b/mlxreload.sh new file mode 100755 index 0000000..2b52f97 --- /dev/null +++ b/mlxreload.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +. ip/functions.sh + +mlxreload +bash ip.sh -- cgit v1.2.1