From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/seastar/scripts/posix_net_conf.sh | 81 +++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 src/seastar/scripts/posix_net_conf.sh (limited to 'src/seastar/scripts/posix_net_conf.sh') diff --git a/src/seastar/scripts/posix_net_conf.sh b/src/seastar/scripts/posix_net_conf.sh new file mode 100755 index 00000000..d3fa52d3 --- /dev/null +++ b/src/seastar/scripts/posix_net_conf.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# ! +# ! Usage: posix_net_conf.sh [iface name, eth0 by default] [-mq|-sq] [--cpu-mask] [-h|--help] [--use-cpu-mask ] +# ! +# ! Ban NIC IRQs from being moved by irqbalance. +# ! +# ! -sq - set all IRQs of a given NIC to CPU0 and configure RPS +# ! to spreads NAPIs' handling between other CPUs. +# ! +# ! -mq - distribute NIC's IRQs among all CPUs instead of binding +# ! them all to CPU0. In this mode RPS is always enabled to +# ! spreads NAPIs' handling between all CPUs. +# ! +# ! --options-file - YAML file with perftune.py options +# ! +# ! If there isn't any mode given script will use a default mode: +# ! - If number of physical CPU cores per Rx HW queue is greater than 4 - use the '-sq' mode. +# ! - Otherwise use the '-mq' mode. +# ! +# ! --use-cpu-mask - mask of cores to use, by default use all available cores +# ! +# ! --cpu-mask - Print out RPS CPU assignments. On MQ NIC, just print all cpus. +# ! +# ! -h|--help - print this help information +# ! +# ! Enable XPS, increase the default values of somaxconn and tcp_max_syn_backlog. +# ! + +usage() +{ + cat $0 | grep ^"# !" | cut -d"!" -f2- +} + +parse_args() +{ + local i + local arg + + until [ -z "$1" ] + do + arg=$1 + case "$arg" in + "-mq") + MQ_MODE="--mode mq" + ;; + "-sq") + MQ_MODE="--mode sq" + ;; + "--cpu-mask") + CPU_MASK="--get-cpu-mask" + ;; + "--use-cpu-mask") + CPU_FILTER_MASK="--cpu-mask $2" + shift + ;; + "--options-file") + OPTIONS_FILE="--options-file $2" + shift + ;; + "-h"|"--help") + usage + exit 0 + ;; + *) + IFACE=$arg + ;; + esac + shift + done +} + +IFACE="eth0" +MQ_MODE="" +CPU_FILTER_MASK="" +CPU_MASK="" +MY_DIR=`dirname $0` +OPTIONS_FILE="" + +parse_args $@ + +$MY_DIR/perftune.py --nic $IFACE $MQ_MODE $CPU_FILTER_MASK $CPU_MASK $OPTIONS_FILE --tune net -- cgit v1.2.3